diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fc6d24f..db70cfd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,8 @@ - - - + + @@ -29,11 +28,11 @@ - + - - + + @@ -42,17 +41,17 @@ - + - + - + @@ -65,7 +64,7 @@ - + @@ -78,7 +77,7 @@ - + @@ -88,7 +87,7 @@ - + @@ -164,8 +163,8 @@ @@ -202,6 +201,8 @@ + + @@ -234,10 +235,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - @@ -527,22 +592,6 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -581,24 +646,24 @@ - + + - - + - + - @@ -611,11 +676,12 @@ - + + @@ -865,7 +931,6 @@ - @@ -873,9 +938,6 @@ - - - @@ -883,7 +945,6 @@ - @@ -891,7 +952,6 @@ - @@ -899,7 +959,6 @@ - @@ -907,7 +966,6 @@ - @@ -915,7 +973,6 @@ - @@ -941,7 +998,6 @@ - @@ -962,13 +1018,12 @@ - - + @@ -996,26 +1051,26 @@ - + - - + + - + - - + + - + - - + + diff --git a/main.js b/main.js index 617d01e..a533fcb 100644 --- a/main.js +++ b/main.js @@ -15,7 +15,7 @@ function createWindow () { setTimeout(function() { - app.dock.setIcon(electron.nativeImage.createFromPath('./sense/installedPlugins/sense/public/logo128.png')); + app.dock.setIcon(electron.nativeImage.createFromPath(path.resolve('./sense/installedPlugins/sense/public/logo128.png'))); // Create the browser window. mainWindow = new BrowserWindow({ diff --git a/release/Sensitive-darwin-x64/LICENSE b/release/Sensitive-darwin-x64/LICENSE new file mode 100644 index 0000000..4d231b4 --- /dev/null +++ b/release/Sensitive-darwin-x64/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014 GitHub Inc. + +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/release/Sensitive-darwin-x64/LICENSES.chromium.html b/release/Sensitive-darwin-x64/LICENSES.chromium.html new file mode 100644 index 0000000..2fc013b --- /dev/null +++ b/release/Sensitive-darwin-x64/LICENSES.chromium.html @@ -0,0 +1,22242 @@ + + + + +Credits + + + +Credits +Print +
+
+Accessibility Audit library, from Accessibility Developer Tools +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Almost Native Graphics Layer Engine +show license +homepage +
+
// Copyright (C) 2002-2013 The ANGLE Project Authors. 
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//     Redistributions of source code must retain the above copyright
+//     notice, this list of conditions and the following disclaimer.
+//
+//     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.
+//
+//     Neither the name of TransGaming Inc., Google Inc., 3DLabs Inc.
+//     Ltd., nor the names of their contributors may be used to endorse
+//     or promote products derived from this software without specific
+//     prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Android +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Android Crazy Linker +show license +homepage +
+
// Copyright 2014 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+
+ +
+Android Open Source Project - App Compat Library +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Android Open Source Project - Settings App +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Apple sample code +show license +homepage +
+
Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple
+Inc. ("Apple") in consideration of your agreement to the following
+terms, and your use, installation, modification or redistribution of
+this Apple software constitutes acceptance of these terms.  If you do
+not agree with these terms, please do not use, install, modify or
+redistribute this Apple software.
+
+In consideration of your agreement to abide by the following terms, and
+subject to these terms, Apple grants you a personal, non-exclusive
+license, under Apple's copyrights in this original Apple software (the
+"Apple Software"), to use, reproduce, modify and redistribute the Apple
+Software, with or without modifications, in source and/or binary forms;
+provided that if you redistribute the Apple Software in its entirety and
+without modifications, you must retain this notice and the following
+text and disclaimers in all such redistributions of the Apple Software.
+Neither the name, trademarks, service marks or logos of Apple Inc. may
+be used to endorse or promote products derived from the Apple Software
+without specific prior written permission from Apple.  Except as
+expressly stated in this notice, no other rights or licenses, express or
+implied, are granted by Apple herein, including but not limited to any
+patent rights that may be infringed by your derivative works or by other
+works in which the Apple Software may be incorporated.
+
+The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
+MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
+OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
+
+IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
+MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
+AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
+STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+Copyright (C) 2009 Apple Inc. All Rights Reserved.
+
+
+ +
+BSDiff +show license +homepage +
+
Copyright 2003-2005 Colin Percival
+All rights reserved
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted providing that the following conditions 
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. 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.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Binary-, RedBlack- and AVL-Trees in Python and Cython +show license +homepage +
+
Copyright (c) 2012, Manfred Moitzi
+
+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. 
+
+Deutsche Ãœbersetzung:
+
+Copyright (c) 2012, Manfred Moitzi
+
+Hiermit wird unentgeltlich, jeder Person, die eine Kopie der Software 
+und der zugehörigen Dokumentationen (die "Software") erhält, die 
+Erlaubnis erteilt, uneingeschränkt zu benutzen, inklusive und ohne 
+Ausnahme, dem Recht, sie zu verwenden, kopieren, ändern, fusionieren, 
+verlegen, verbreiten, unterlizenzieren und/oder zu verkaufen, und 
+Personen, die diese Software erhalten, diese Rechte zu geben, unter den 
+folgenden Bedingungen: 
+
+Der obige Urheberrechtsvermerk und dieser Erlaubnisvermerk sind in allen 
+Kopien oder Teilkopien der Software beizulegen. 
+
+DIE SOFTWARE WIRD OHNE JEDE AUSDRÃœCKLICHE ODER IMPLIZIERTE GARANTIE 
+BEREITGESTELLT, EINSCHLIESSLICH DER GARANTIE ZUR BENUTZUNG FÃœR DEN 
+VORGESEHENEN ODER EINEM BESTIMMTEN ZWECK SOWIE JEGLICHER 
+RECHTSVERLETZUNG, JEDOCH NICHT DARAUF BESCHRÄNKT. IN KEINEM FALL SIND 
+DIE AUTOREN ODER COPYRIGHTINHABER FÃœR JEGLICHEN SCHADEN ODER SONSTIGE 
+ANSPRÃœCHE HAFTBAR ZU MACHEN, OB INFOLGE DER ERFÃœLLUNG EINES VERTRAGES, 
+EINES DELIKTES ODER ANDERS IM ZUSAMMENHANG MIT DER SOFTWARE ODER 
+SONSTIGER VERWENDUNG DER SOFTWARE ENTSTANDEN. 
+
+
+
+
+ +
+Blackmagic DeckLink SDK - Mac +show license +homepage +
+
Extracted from mac/include/DeckLinkAPI.h:
+
+** Copyright (c) 2014 Blackmagic Design
+**
+** Permission is hereby granted, free of charge, to any person or organization
+** obtaining a copy of the software and accompanying documentation covered by
+** this license (the "Software") to use, reproduce, display, distribute,
+** execute, and transmit the Software, and to prepare derivative works of the
+** Software, and to permit third-parties to whom the Software is furnished to
+** do so, all subject to the following:
+** 
+** The copyright notices in the Software and this entire statement, including
+** the above license grant, this restriction and the following disclaimer,
+** must be included in all copies of the Software, in whole or in part, and
+** all derivative works of the Software, unless such copies or derivative
+** works are solely in the form of machine-executable object code generated by
+** a source language processor.
+** 
+** 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+** DEALINGS IN THE SOFTWARE.
+
+
+
+ +
+Blink javascript libraries. +show license +homepage +
+
// Copyright 2014 The Chromium Authors. All rights reserved.
+//
+// The Chromium Authors can be found at
+// http://src.chromium.org/svn/trunk/src/AUTHORS
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Braille Translation Library +show license +homepage +
+
(Copied from src/liblouis/liblouis.h.in)
+
+/* liblouis Braille Translation and Back-Translation Library
+
+   Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by
+   The BRLTTY Team
+
+   Copyright (C) 2004, 2005, 2006, 2009 ViewPlus Technologies, Inc.
+   www.viewplus.com and JJB Software, Inc. www.jjb-software.com
+
+   liblouis is free software: you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation, either version 3 of the
+   License, or (at your option) any later version.
+
+   liblouis is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this program. If not, see
+   <http://www.gnu.org/licenses/>.
+
+   Maintained by John J. Boyer john.boyer@abilitiessoft.com
+   */
+
+
+
+
+ +
+Breakpad, An open-source multi-platform crash reporting system +show license +homepage +
+
Copyright (c) 2006, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1996 - 2011, Daniel Stenberg, <daniel@haxx.se>.
+
+All rights reserved.
+
+Permission to use, copy, modify, and distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright
+notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 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.
+
+Except as contained in this notice, the name of a copyright holder shall not
+be used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization of the copyright holder.
+
+
+Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+
+@APPLE_LICENSE_HEADER_START@
+
+This file contains Original Code and/or Modifications of Original Code
+as defined in and that are subject to the Apple Public Source License
+Version 2.0 (the 'License'). You may not use this file except in
+compliance with the License. Please obtain a copy of the License at
+http://www.opensource.apple.com/apsl/ and read it before using this
+file.
+
+The Original Code and all software distributed under the License are
+distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+Please see the License for the specific language governing rights and
+limitations under the License.
+
+@APPLE_LICENSE_HEADER_END@
+
+
+Copyright 2007-2008 Google Inc.
+
+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.
+
+
+
+ +
+Brotli +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Checkstyle is a development tool to help programmers write Java code that +show license +homepage +
+
		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+
+ +
+Chrome Custom Tabs - Example and Usage +show license +homepage +
+
+                                 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.
+
+
+
+ +
+ChromeVox +show license +homepage +
+
// Copyright 2013 Google Inc.
+//
+// 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.
+
+
+
+ +
+Chromium OS system API +show license +homepage +
+
// Copyright (c) 2006-2009 The Chromium OS Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Closure compiler +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Cocoa extension code from Camino +show license +homepage +
+
/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+
+ +
+Compact Language Detection +show license +homepage +
+
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Compact Language Detection 2 +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Crashpad +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Darwin +show license +homepage +
+
APPLE PUBLIC SOURCE LICENSE Version 2.0 -  August 6, 2003
+
+Please read this License carefully before downloading this software.  By
+downloading or using this software, you are agreeing to be bound by the terms of
+this License.  If you do not or cannot agree to the terms of this License,
+please do not download or use the software.
+
+Apple Note:  In January 2007, Apple changed its corporate name from "Apple
+Computer, Inc." to "Apple Inc."  This change has been reflected below and
+copyright years updated, but no other changes have been made to the APSL 2.0.
+
+1.	General; Definitions.  This License applies to any program or other work
+which Apple Inc. ("Apple") makes publicly available and which contains a notice
+placed by Apple identifying such program or work as "Original Code" and stating
+that it is subject to the terms of this Apple Public Source License version 2.0
+("License").  As used in this License:
+
+1.1	 "Applicable Patent Rights" mean:  (a) in the case where Apple is the
+grantor of rights, (i) claims of patents that are now or hereafter acquired,
+owned by or assigned to Apple and (ii) that cover subject matter contained in
+the Original Code, but only to the extent necessary to use, reproduce and/or
+distribute the Original Code without infringement; and (b) in the case where You
+are the grantor of rights, (i) claims of patents that are now or hereafter
+acquired, owned by or assigned to You and (ii) that cover subject matter in Your
+Modifications, taken alone or in combination with Original Code.
+
+1.2	"Contributor" means any person or entity that creates or contributes to the
+creation of Modifications.
+
+1.3	 "Covered Code" means the Original Code, Modifications, the combination of
+Original Code and any Modifications, and/or any respective portions thereof.
+
+1.4	"Externally Deploy" means: (a) to sublicense, distribute or otherwise make
+Covered Code available, directly or indirectly, to anyone other than You; and/or
+(b) to use Covered Code, alone or as part of a Larger Work, in any way to
+provide a service, including but not limited to delivery of content, through
+electronic communication with a client other than You.
+
+1.5	"Larger Work" means a work which combines Covered Code or portions thereof
+with code not governed by the terms of this License.
+
+1.6	"Modifications" mean any addition to, deletion from, and/or change to, the
+substance and/or structure of the Original Code, any previous Modifications, the
+combination of Original Code and any previous Modifications, and/or any
+respective portions thereof.  When code is released as a series of files, a
+Modification is:  (a) any addition to or deletion from the contents of a file
+containing Covered Code; and/or (b) any new file or other representation of
+computer program statements that contains any part of Covered Code.
+
+1.7	"Original Code" means (a) the Source Code of a program or other work as
+originally made available by Apple under this License, including the Source Code
+of any updates or upgrades to such programs or works made available by Apple
+under this License, and that has been expressly identified by Apple as such in
+the header file(s) of such work; and (b) the object code compiled from such
+Source Code and originally made available by Apple under this License
+
+1.8	"Source Code" means the human readable form of a program or other work that
+is suitable for making modifications to it, including all modules it contains,
+plus any associated interface definition files, scripts used to control
+compilation and installation of an executable (object code).
+
+1.9	"You" or "Your" means an individual or a legal entity exercising rights
+under this License.  For legal entities, "You" or "Your" includes any entity
+which controls, is controlled by, or is under common control with, You, where
+"control" means (a) the power, direct or indirect, to cause the direction or
+management of such entity, whether by contract or otherwise, or (b) ownership of
+fifty percent (50%) or more of the outstanding shares or beneficial ownership of
+such entity.
+
+2.	Permitted Uses; Conditions & Restrictions.   Subject to the terms and
+conditions of this License, Apple hereby grants You, effective on the date You
+accept this License and download the Original Code, a world-wide, royalty-free,
+non-exclusive license, to the extent of Apple's Applicable Patent Rights and
+copyrights covering the Original Code, to do the following:
+
+2.1	Unmodified Code.  You may use, reproduce, display, perform, internally
+distribute within Your organization, and Externally Deploy verbatim, unmodified
+copies of the Original Code, for commercial or non-commercial purposes, provided
+that in each instance:
+
+(a)	You must retain and reproduce in all copies of Original Code the copyright
+and other proprietary notices and disclaimers of Apple as they appear in the
+Original Code, and keep intact all notices in the Original Code that refer to
+this License; and
+
+(b) 	You must include a copy of this License with every copy of Source Code of
+Covered Code and documentation You distribute or Externally Deploy, and You may
+not offer or impose any terms on such Source Code that alter or restrict this
+License or the recipients' rights hereunder, except as permitted under Section
+6.
+
+2.2	Modified Code.  You may modify Covered Code and use, reproduce, display,
+perform, internally distribute within Your organization, and Externally Deploy
+Your Modifications and Covered Code, for commercial or non-commercial purposes,
+provided that in each instance You also meet all of these conditions:
+
+(a)	You must satisfy all the conditions of Section 2.1 with respect to the
+Source Code of the Covered Code;
+
+(b)	You must duplicate, to the extent it does not already exist, the notice in
+Exhibit A in each file of the Source Code of all Your Modifications, and cause
+the modified files to carry prominent notices stating that You changed the files
+and the date of any change; and
+
+(c)	If You Externally Deploy Your Modifications, You must make Source Code of
+all Your Externally Deployed Modifications either available to those to whom You
+have Externally Deployed Your Modifications, or publicly available.  Source Code
+of Your Externally Deployed Modifications must be released under the terms set
+forth in this License, including the license grants set forth in Section 3
+below, for as long as you Externally Deploy the Covered Code or twelve (12)
+months from the date of initial External Deployment, whichever is longer. You
+should preferably distribute the Source Code of Your Externally Deployed
+Modifications electronically (e.g. download from a web site).
+
+2.3	Distribution of Executable Versions.  In addition, if You Externally Deploy
+Covered Code (Original Code and/or Modifications) in object code, executable
+form only, You must include a prominent notice, in the code itself as well as in
+related documentation, stating that Source Code of the Covered Code is available
+under the terms of this License with information on how and where to obtain such
+Source Code.
+
+2.4	Third Party Rights.  You expressly acknowledge and agree that although
+Apple and each Contributor grants the licenses to their respective portions of
+the Covered Code set forth herein, no assurances are provided by Apple or any
+Contributor that the Covered Code does not infringe the patent or other
+intellectual property rights of any other entity. Apple and each Contributor
+disclaim any liability to You for claims brought by any other entity based on
+infringement of intellectual property rights or otherwise. As a condition to
+exercising the rights and licenses granted hereunder, You hereby assume sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow You to
+distribute the Covered Code, it is Your responsibility to acquire that license
+before distributing the Covered Code.
+
+3.	Your Grants.  In consideration of, and as a condition to, the licenses
+granted to You under this License, You hereby grant to any person or entity
+receiving or distributing Covered Code under this License a non-exclusive,
+royalty-free, perpetual, irrevocable license, under Your Applicable Patent
+Rights and other intellectual property rights (other than patent) owned or
+controlled by You, to use, reproduce, display, perform, modify, sublicense,
+distribute and Externally Deploy Your Modifications of the same scope and extent
+as Apple's licenses under Sections 2.1 and 2.2 above.
+
+4.	Larger Works.  You may create a Larger Work by combining Covered Code with
+other code not governed by the terms of this License and distribute the Larger
+Work as a single product.  In each such instance, You must make sure the
+requirements of this License are fulfilled for the Covered Code or any portion
+thereof.
+
+5.	Limitations on Patent License.   Except as expressly stated in Section 2, no
+other patent rights, express or implied, are granted by Apple herein. 
+Modifications and/or Larger Works may require additional patent licenses from
+Apple which Apple may grant in its sole discretion.
+
+6.	Additional Terms.  You may choose to offer, and to charge a fee for,
+warranty, support, indemnity or liability obligations and/or other rights
+consistent with the scope of the license granted herein ("Additional Terms") to
+one or more recipients of Covered Code. However, You may do so only on Your own
+behalf and as Your sole responsibility, and not on behalf of Apple or any
+Contributor. You must obtain the recipient's agreement that any such Additional
+Terms are offered by You alone, and You hereby agree to indemnify, defend and
+hold Apple and every Contributor harmless for any liability incurred by or
+claims asserted against Apple or such Contributor by reason of any such
+Additional Terms.
+
+7.	Versions of the License.  Apple may publish revised and/or new versions of
+this License from time to time.  Each version will be given a distinguishing
+version number.  Once Original Code has been published under a particular
+version of this License, You may continue to use it under the terms of that
+version. You may also choose to use such Original Code under the terms of any
+subsequent version of this License published by Apple.  No one other than Apple
+has the right to modify the terms applicable to Covered Code created under this
+License.
+
+8.	NO WARRANTY OR SUPPORT.  The Covered Code may contain in whole or in part
+pre-release, untested, or not fully tested works.  The Covered Code may contain
+errors that could cause failures or loss of data, and may be incomplete or
+contain inaccuracies.  You expressly acknowledge and agree that use of the
+Covered Code, or any portion thereof, is at Your sole and entire risk.  THE
+COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
+ANY KIND AND APPLE AND APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE"
+FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM
+ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY
+QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT,
+AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  APPLE AND EACH CONTRIBUTOR DOES NOT
+WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE
+FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE
+OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT
+DEFECTS IN THE COVERED CODE WILL BE CORRECTED.  NO ORAL OR WRITTEN INFORMATION
+OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR
+SHALL CREATE A WARRANTY.  You acknowledge that the Covered Code is not intended
+for use in the operation of nuclear facilities, aircraft navigation,
+communication systems, or air traffic control machines in which case the failure
+of the Covered Code could lead to death, personal injury, or severe physical or
+environmental damage.
+
+9.	LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT
+SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT
+OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE
+OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A
+THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR
+OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY
+REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In
+no event shall Apple's total liability to You for all damages (other than as may
+be required by applicable law) under this License exceed the amount of fifty
+dollars ($50.00).
+
+10.	Trademarks.  This License does not grant any rights to use the trademarks
+or trade names  "Apple", "Mac", "Mac OS", "QuickTime", "QuickTime Streaming
+Server" or any other trademarks, service marks, logos or trade names belonging
+to Apple (collectively "Apple Marks") or to any trademark, service mark, logo or
+trade name belonging to any Contributor.  You agree not to use any Apple Marks
+in or as part of the name of products derived from the Original Code or to
+endorse or promote products derived from the Original Code other than as
+expressly permitted by and in strict compliance at all times with Apple's third
+party trademark usage guidelines which are posted at
+http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11.	Ownership. Subject to the licenses granted under this License, each
+Contributor retains all rights, title and interest in and to any Modifications
+made by such Contributor.  Apple retains all rights, title and interest in and
+to the Original Code and any Modifications made by or on behalf of Apple ("Apple
+Modifications"), and such Apple Modifications will not be automatically subject
+to this License.  Apple may, at its sole discretion, choose to license such
+Apple Modifications under this License, or on different terms from those
+contained in this License or may choose not to license them at all.
+
+12.	Termination.
+
+12.1	Termination.  This License and the rights granted hereunder will
+terminate:
+
+(a)	automatically without notice from Apple if You fail to comply with any
+term(s) of this License and fail to cure such breach within 30 days of becoming
+aware of such breach; (b)	immediately in the event of the circumstances
+described in Section 13.5(b); or (c)	automatically without notice from Apple if
+You, at any time during the term of this License, commence an action for patent
+infringement against Apple; provided that Apple did not first commence an action
+for patent infringement against You in that instance.
+
+12.2	Effect of Termination.  Upon termination, You agree to immediately stop
+any further use, reproduction, modification, sublicensing and distribution of
+the Covered Code.  All sublicenses to the Covered Code which have been properly
+granted prior to termination shall survive any termination of this License. 
+Provisions which, by their nature, should remain in effect beyond the
+termination of this License shall survive, including but not limited to Sections
+3, 5, 8, 9, 10, 11, 12.2 and 13.  No party will be liable to any other for
+compensation, indemnity or damages of any sort solely as a result of terminating
+this License in accordance with its terms, and termination of this License will
+be without prejudice to any other right or remedy of any party.
+
+13. 	Miscellaneous.
+
+13.1	Government End Users.   The Covered Code is a "commercial item" as defined
+in FAR 2.101.  Government software and technical data rights in the Covered Code
+include only those rights customarily provided to the public as defined in this
+License. This customary commercial license in technical data and software is
+provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
+Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical
+Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software
+or Computer Software Documentation).  Accordingly, all U.S. Government End Users
+acquire Covered Code with only those rights set forth herein.
+
+13.2	Relationship of Parties.  This License will not be construed as creating
+an agency, partnership, joint venture or any other form of legal association
+between or among You, Apple or any Contributor, and You will not represent to
+the contrary, whether expressly, by implication, appearance or otherwise.
+
+13.3	Independent Development.   Nothing in this License will impair Apple's
+right to acquire, license, develop, have others develop for it, market and/or
+distribute technology or products that perform the same or similar functions as,
+or otherwise compete with, Modifications, Larger Works, technology or products
+that You may develop, produce, market or distribute.
+
+13.4	Waiver; Construction.  Failure by Apple or any Contributor to enforce any
+provision of this License will not be deemed a waiver of future enforcement of
+that or any other provision.  Any law or regulation which provides that the
+language of a contract shall be construed against the drafter will not apply to
+this License.
+
+13.5	Severability.  (a) If for any reason a court of competent jurisdiction
+finds any provision of this License, or portion thereof, to be unenforceable,
+that provision of the License will be enforced to the maximum extent permissible
+so as to effect the economic benefits and intent of the parties, and the
+remainder of this License will continue in full force and effect.  (b)
+Notwithstanding the foregoing, if applicable law prohibits or restricts You from
+fully and/or specifically complying with Sections 2 and/or 3 or prevents the
+enforceability of either of those Sections, this License will immediately
+terminate and You must immediately discontinue any use of the Covered Code and
+destroy all copies of it that are in your possession or control.
+
+13.6	Dispute Resolution.  Any litigation or other dispute resolution between
+You and Apple relating to this License shall take place in the Northern District
+of California, and You and Apple hereby consent to the personal jurisdiction of,
+and venue in, the state and federal courts within that District with respect to
+this License. The application of the United Nations Convention on Contracts for
+the International Sale of Goods is expressly excluded.
+
+13.7	Entire Agreement; Governing Law.  This License constitutes the entire
+agreement between the parties with respect to the subject matter hereof.  This
+License shall be governed by the laws of the United States and the State of
+California, except that body of California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following clause
+applies:  The parties hereby confirm that they have requested that this License
+and all related documents be drafted in English.  Les parties ont exigé que le
+présent contrat et tous les documents connexes soient rédigés en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999-2007 Apple Inc.  All Rights Reserved.
+
+This file contains Original Code and/or Modifications of Original Code as
+defined in and that are subject to the Apple Public Source License Version 2.0
+(the 'License').  You may not use this file except in compliance with the
+License.  Please obtain a copy of the License at
+http://www.opensource.apple.com/apsl/ and read it before using this file.
+
+The Original Code and all software distributed under the License are distributed
+on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
+AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION,
+ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
+ENJOYMENT OR NON-INFRINGEMENT.  Please see the License for the specific language
+governing rights and limitations under the License." 
+
+
+
+ +
+David M. Gay's floating point routines +show license +homepage +
+
/****************************************************************
+ *
+ * The author of this software is David M. Gay.
+ *
+ * Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose without fee is hereby granted, provided that this entire notice
+ * is included in all copies of any software which is or includes a copy
+ * or modification of this software and in all copies of the supporting
+ * documentation for such software.
+ *
+ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
+ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
+ * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+ *
+ ***************************************************************/
+
+
+
+ +
+Error Prone +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Expat XML Parser +show license +homepage +
+
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
+                               and Clark Cooper
+Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
+
+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.
+
+
+
+ +
+Flot Javascript/JQuery library for creating graphs +show license +homepage +
+
Copyright (c) 2007-2013 IOLA and Ole Laursen
+
+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.
+
+
+
+ +
+Flot Javascript/JQuery library for creating graphs +show license +homepage +
+
Copyright (c) 2007-2013 IOLA and Ole Laursen
+
+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.
+
+
+
+ +
+GifPlayer Animated GIF Library +show license +homepage +
+
                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Google Cache Invalidation API +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Google Cardboard +show license +homepage +
+
   Copyright (c) 2014, Google Inc.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   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.
+
+
+                                 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
+
+
+
+
+
+ +
+Google Input Tools +show license +homepage +
+
                                 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 2013 Google Inc.
+
+   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.
+
+
+ +
+Google Toolbox for Mac +show license +homepage +
+
See src/COPYING
+
+
+
+ +
+Google code support upload script +show license +homepage +
+
+                                 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 2007-2009 Google Inc.
+   Copyright 2007-2009 WebDriver committers
+
+   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.
+
+
+
+
+ +
+Hardware Composer Plus +show license +homepage +
+
// Copyright 2014 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+IAccessible2 COM interfaces for accessibility +show license +homepage +
+
/*************************************************************************
+ *
+ *  IAccessible2 IDL Specification 
+ * 
+ *  Copyright (c) 2007, 2010 Linux Foundation 
+ *  Copyright (c) 2006 IBM Corporation 
+ *  Copyright (c) 2000, 2006 Sun Microsystems, Inc. 
+ *  All rights reserved. 
+ *   
+ *   
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met: 
+ *   
+ *   1. Redistributions of source code must retain the above copyright 
+ *      notice, this list of conditions and the following disclaimer. 
+ *   
+ *   2. 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. 
+ *
+ *   3. Neither the name of the Linux Foundation nor the names of its 
+ *      contributors may be used to endorse or promote products 
+ *      derived from this software without specific prior written 
+ *      permission. 
+ *   
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+ *  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+ *  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+ *  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
+ *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+ *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+ *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+ *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+ *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
+ *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
+ *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *   
+ *  This BSD License conforms to the Open Source Initiative "Simplified 
+ *  BSD License" as published at: 
+ *  http://www.opensource.org/licenses/bsd-license.php 
+ *   
+ *  IAccessible2 is a trademark of the Linux Foundation. The IAccessible2 
+ *  mark may be used in accordance with the Linux Foundation Trademark 
+ *  Policy to indicate compliance with the IAccessible2 specification. 
+ * 
+ ************************************************************************/ 
+
+
+
+ +
+ISimpleDOM COM interfaces for accessibility +show license +homepage +
+
/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+
+ +
+International Phone Number Library +show license +homepage +
+
Copyright (C) 2011 Google Inc.
+
+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.
+
+
+
+ +
+JMake +show license +homepage +
+
		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
+
+
+
+
+ +
+Khronos header files +show license +homepage +
+
Copyright (c) 2007-2010 The Khronos Group Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and/or associated documentation files (the
+"Materials"), to deal in the Materials without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Materials, and to
+permit persons to whom the Materials are 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 Materials.
+
+THE MATERIALS ARE 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
+MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+
+SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+
+Copyright (C) 1992 Silicon Graphics, Inc. All Rights Reserved.
+
+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 including the dates of first publication and either
+this permission notice or a reference to http://oss.sgi.com/projects/FreeB/
+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 SILICON
+GRAPHICS, INC. 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.
+
+Except as contained in this notice, the name of Silicon Graphics, Inc. shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Silicon
+Graphics, Inc.
+
+
+
+ +
+LCOV - the LTP GCOV extension +show license +homepage +
+
		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
+
+
+
+ +
+LZMA SDK +show license +homepage +
+
LZMA SDK is placed in the public domain.
+
+
+
+ +
+LevelDB: A Fast Persistent Key-Value Store +show license +homepage +
+
Copyright (c) 2011 The LevelDB Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+   * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+   * 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.
+   * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+MediaController android sample. +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Mojo +show license +homepage +
+
// Copyright 2014 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+MojoServices +show license +homepage +
+
// Copyright 2014 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Mozc Japanese Input Method Editor +show license +homepage +
+
Copyright 2010-2011, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+* 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.
+* Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+
+ +
+Mozilla Personal Security Manager +show license +homepage +
+
/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Netscape security libraries.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+
+ +
+NSBezierPath additions from Sean Patrick O'Brien +show license +homepage +
+
Copyright 2008 MolokoCacao
+All rights reserved
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted providing that the following conditions 
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. 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.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+NVidia Control X Extension Library +show license +homepage +
+
/*
+ * Copyright (c) 2008 NVIDIA, Corporation
+ *
+ * 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 (including the next
+ * paragraph) 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.
+ */
+
+
+ +
+Netscape Plugin Application Programming Interface (NPAPI) +show license +homepage +
+
Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+The contents of this file are subject to the Mozilla Public License Version
+1.1 (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.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is mozilla.org code.
+
+The Initial Developer of the Original Code is
+Netscape Communications Corporation.
+Portions created by the Initial Developer are Copyright (C) 1998
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+
+
+ +
+Netscape Portable Runtime (NSPR) +show license +homepage +
+
/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Netscape Portable Runtime (NSPR).
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+
+ +
+Network Security Services (NSS) +show license +homepage +
+
/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Netscape security libraries.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1994-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+
+ +
+OTS (OpenType Sanitizer) +show license +homepage +
+
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Omaha (Google Update) +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+OpenMAX DL +show license +homepage +
+
Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file in the root of the source tree. All
+contributing project authors may be found in the AUTHORS file in the
+root of the source tree.
+
+The files were originally licensed by ARM Limited.
+
+The following files:
+
+    * dl/api/omxtypes.h
+    * dl/sp/api/omxSP.h
+
+are licensed by Khronos:
+
+Copyright © 2005-2008 The Khronos Group Inc. All Rights Reserved. 
+
+These materials are protected by copyright laws and contain material 
+proprietary to the Khronos Group, Inc.  You may use these materials 
+for implementing Khronos specifications, without altering or removing 
+any trademark, copyright or other notice from the specification.
+
+Khronos Group makes no, and expressly disclaims any, representations 
+or warranties, express or implied, regarding these materials, including, 
+without limitation, any implied warranties of merchantability or fitness 
+for a particular purpose or non-infringement of any intellectual property. 
+Khronos Group makes no, and expressly disclaims any, warranties, express 
+or implied, regarding the correctness, accuracy, completeness, timeliness, 
+and reliability of these materials. 
+
+Under no circumstances will the Khronos Group, or any of its Promoters, 
+Contributors or Members or their respective partners, officers, directors, 
+employees, agents or representatives be liable for any damages, whether 
+direct, indirect, special or consequential damages for lost revenues, 
+lost profits, or otherwise, arising from or in connection with these 
+materials.
+
+Khronos and OpenMAX are trademarks of the Khronos Group Inc. 
+
+
+
+ +
+PDFium +show license +homepage +
+
// Copyright 2014 PDFium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+PLY (Python Lex-Yacc) +show license +homepage +
+
PLY (Python Lex-Yacc)                   Version 3.4
+
+Copyright (C) 2001-2011,
+David M. Beazley (Dabeaz LLC)
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.  
+* 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.  
+* Neither the name of the David Beazley or Dabeaz LLC may be used to
+  endorse or promote products derived from this software without
+  specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ +
+Paul Hsieh's SuperFastHash +show license +homepage +
+
Paul Hsieh OLD BSD license
+
+Copyright (c) 2010, Paul Hsieh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+* 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.
+* Neither my name, Paul Hsieh, nor the names of any other contributors to the
+  code use may not be used to endorse or promote products derived from this
+  software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Polymer +show license +homepage +
+
// Copyright (c) 2012 The Polymer Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Proguard +show license +homepage +
+
                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+
+ +
+Protocol Buffers +show license +homepage +
+
Copyright 2008, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Code generated by the Protocol Buffer compiler is owned by the owner
+of the input file used when generating it.  This code is not
+standalone and requires a support library to be linked with it.  This
+support library is itself covered by the above license.
+
+
+
+ +
+Python FTP server library +show license +homepage +
+
======================================================================
+Copyright (C) 2007-2012  Giampaolo Rodola' <g.rodola@gmail.com>
+
+                         All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and
+its documentation for any purpose and without fee is hereby
+granted, provided that the above copyright notice appear in all
+copies and that both that copyright notice and this permission
+notice appear in supporting documentation, and that the name of
+Giampaolo Rodola' not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+Giampaolo Rodola' DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+NO EVENT Giampaolo Rodola' BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+======================================================================
+
+
+
+ +
+Quick Color Management System +show license +homepage +
+
qcms
+Copyright (C) 2009 Mozilla Corporation
+Copyright (C) 1998-2007 Marti Maria
+
+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.
+
+
+
+ +
+SMHasher +show license +homepage +
+
All MurmurHash source files are placed in the public domain.
+
+The license below applies to all other code in SMHasher:
+
+Copyright (c) 2011 Google, Inc.
+
+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.
+
+
+
+ +
+Skia +show license +homepage +
+
// Copyright (c) 2011 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------------------
+third_party/etc1 is under the following license:
+
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+Snappy: A fast compressor/decompressor +show license +homepage +
+
Copyright 2011, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Speech Dispatcher +show license +homepage +
+
		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+
+
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard.  To achieve this, non-free programs must
+be allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+compilation and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at least
+    three years, to give the same user the materials specified in
+    Subsection 6a, above, for a charge no more than the cost of
+    performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License
+may add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+
+
+
+
+
+ +
+Strongtalk +show license +homepage +
+
Copyright (c) 1994-2006 Sun Microsystems Inc.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+- Redistribution 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.
+
+- Neither the name of Sun Microsystems or the names of contributors may
+be used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Sudden Motion Sensor library +show license +homepage +
+
SMSLib Sudden Motion Sensor Access Library
+Copyright (c) 2010 Suitable Systems
+All rights reserved.
+
+Developed by: Daniel Griscom
+              Suitable Systems
+              http://www.suitable.com
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal with 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:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimers.
+
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimers in the
+documentation and/or other materials provided with the distribution.
+
+- Neither the names of Suitable Systems nor the names of its
+contributors may be used to endorse or promote products derived from
+this Software without specific prior written permission.
+
+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 CONTRIBUTORS 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 WITH THE SOFTWARE.
+
+For more information about SMSLib, see
+   <http://www.suitable.com/tools/smslib.html>
+or contact
+   Daniel Griscom
+   Suitable Systems
+   1 Centre Street, Suite 204
+   Wakefield, MA 01880
+   (781) 665-0053
+
+
+
+ +
+SwiftShader software renderer. +show license +homepage +
+
This product includes SwiftShader Software GPU Tookit,
+Copyright(c)2003-2011 TransGaming Inc
+
+
+
+ +
+The USB ID Repository +show license +homepage +
+
Copyright (c) 2012, Linux USB Project
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+o Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.
+
+o 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.
+
+o Neither the name of the Linux USB Project nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+The library to input, validate, and display addresses. +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+V8 JavaScript Engine +show license +homepage +
+
This license applies to all parts of V8 that are not externally
+maintained libraries.  The externally maintained libraries used by V8
+are:
+
+  - PCRE test suite, located in
+    test/mjsunit/third_party/regexp-pcre/regexp-pcre.js.  This is based on the
+    test suite from PCRE-7.3, which is copyrighted by the University
+    of Cambridge and Google, Inc.  The copyright notice and license
+    are embedded in regexp-pcre.js.
+
+  - Layout tests, located in test/mjsunit/third_party/object-keys.  These are
+    based on layout tests from webkit.org which are copyrighted by
+    Apple Computer, Inc. and released under a 3-clause BSD license.
+
+  - Strongtalk assembler, the basis of the files assembler-arm-inl.h,
+    assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
+    assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h,
+    assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h,
+    assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h.
+    This code is copyrighted by Sun Microsystems Inc. and released
+    under a 3-clause BSD license.
+
+  - Valgrind client API header, located at third_party/valgrind/valgrind.h
+    This is release under the BSD license.
+
+These libraries have their own licenses; we recommend you read them,
+as their terms may differ from the terms below.
+
+Further license information can be found in LICENSE files located in 
+sub-directories.
+
+Copyright 2014, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Web Animations JS +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+WebKit +show license +homepage +
+
(WebKit doesn't distribute an explicit license.  This LICENSE is derived from
+license text in the source.)
+
+Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+2006, 2007 Alexander Kellett, Alexey Proskuryakov, Alex Mathews, Allan
+Sandfeld Jensen, Alp Toker, Anders Carlsson, Andrew Wellington, Antti
+Koivisto, Apple Inc., Arthur Langereis, Baron Schwartz, Bjoern Graf,
+Brent Fulgham, Cameron Zwarich, Charles Samuels, Christian Dywan,
+Collabora Ltd., Cyrus Patel, Daniel Molkentin, Dave Maclachlan, David
+Smith, Dawit Alemayehu, Dirk Mueller, Dirk Schulze, Don Gibson, Enrico
+Ros, Eric Seidel, Frederik Holljen, Frerich Raabe, Friedmann Kleint,
+George Staikos, Google Inc., Graham Dennis, Harri Porten, Henry Mason,
+Hiroyuki Ikezoe, Holger Hans Peter Freyther, IBM, James G. Speth, Jan
+Alonzo, Jean-Loup Gailly, John Reis, Jonas Witt, Jon Shier, Jonas
+Witt, Julien Chaffraix, Justin Haygood, Kevin Ollivier, Kevin Watters,
+Kimmo Kinnunen, Kouhei Sutou, Krzysztof Kowalczyk, Lars Knoll, Luca
+Bruno, Maks Orlovich, Malte Starostik, Mark Adler, Martin Jones,
+Marvin Decker, Matt Lilek, Michael Emmel, Mitz Pettel, mozilla.org,
+Netscape Communications Corporation, Nicholas Shanks, Nikolas
+Zimmermann, Nokia, Oliver Hunt, Opened Hand, Paul Johnston, Peter
+Kelly, Pioneer Research Center USA, Rich Moore, Rob Buis, Robin Dunn,
+Ronald Tschalär, Samuel Weinig, Simon Hausmann, Staikos Computing
+Services Inc., Stefan Schimanski, Symantec Corporation, The Dojo
+Foundation, The Karbon Developers, Thomas Boyer, Tim Copperfield,
+Tobias Anton, Torben Weis, Trolltech, University of Cambridge, Vaclav
+Slavik, Waldo Bastian, Xan Lopez, Zack Rusin
+
+The terms and conditions vary from file to file, but are one of:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. 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.
+
+*OR*
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. 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.
+3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+   its contributors may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+                  GNU LIBRARY GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+                  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+
+
+ +
+WebM container parser and writer. +show license +homepage +
+
Copyright (c) 2010, Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * 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.
+
+  * Neither the name of Google nor the names of its contributors may
+    be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+
+ +
+WebP image encoder/decoder +show license +homepage +
+
Copyright (c) 2010, Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * 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.
+
+  * Neither the name of Google nor the names of its contributors may
+    be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Additional IP Rights Grant (Patents)
+------------------------------------
+
+"These implementations" means the copyrightable works that implement the WebM
+codecs distributed by Google as part of the WebM Project.
+
+Google 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, transfer, and otherwise
+run, modify and propagate the contents of these implementations of WebM, where
+such license applies only to those patent claims, both currently owned by
+Google and acquired in the future, licensable by Google that are necessarily
+infringed by these implementations of WebM. This grant does not include claims
+that would be infringed only as a consequence of further modification of these
+implementations. If you or your agent or exclusive licensee institute or order
+or agree to the institution of patent litigation or any other patent
+enforcement activity against any entity (including a cross-claim or
+counterclaim in a lawsuit) alleging that any of these implementations of WebM
+or any code incorporated within any of these implementations of WebM
+constitutes direct or contributory patent infringement, or inducement of
+patent infringement, then any patent rights granted to you under this License
+for these implementations of WebM shall terminate as of the date such
+litigation is filed.
+
+
+
+ +
+WebRTC +show license +homepage +
+
Copyright (c) 2011, The WebRTC project authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * 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.
+
+  * Neither the name of Google nor the names of its contributors may
+    be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+WebRTC +show license +homepage +
+
Copyright (c) 2011, The WebRTC project authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * 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.
+
+  * Neither the name of Google nor the names of its contributors may
+    be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+Webdriver +show license +homepage +
+
NAME: WebDriver
+URL: http://selenium.googlecode.com/svn/trunk/py
+LICENSE: Apache 2 
+
+
+
+ +
+Windows Template Library (WTL) +show license +homepage +
+
Microsoft Permissive License (Ms-PL)
+Published: October 12, 2006
+
+
+This license governs use of the accompanying software. If you use the software,
+you accept this license. If you do not accept the license, do not use the
+software.
+
+
+1. Definitions
+
+The terms "reproduce," "reproduction," "derivative works," and "distribution"
+have the same meaning here as under U.S. copyright law.
+
+A "contribution" is the original software, or any additions or changes to the
+software.
+
+A "contributor" is any person that distributes its contribution under this
+license.
+
+"Licensed patents" are a contributor’s patent claims that read directly on its
+contribution.
+
+
+2. Grant of Rights
+
+(A) Copyright Grant- Subject to the terms of this license, including the
+license conditions and limitations in section 3, each contributor grants you a
+non-exclusive, worldwide, royalty-free copyright license to reproduce its
+contribution, prepare derivative works of its contribution, and distribute its
+contribution or any derivative works that you create.
+
+(B) Patent Grant- Subject to the terms of this license, including the license
+conditions and limitations in section 3, each contributor grants you a
+non-exclusive, worldwide, royalty-free license under its licensed patents to
+make, have made, use, sell, offer for sale, import, and/or otherwise dispose of
+its contribution in the software or derivative works of the contribution in the
+software.
+
+
+3. Conditions and Limitations
+
+(A) No Trademark License- This license does not grant you rights to use any
+contributors’ name, logo, or trademarks.
+
+(B) If you bring a patent claim against any contributor over patents that you
+claim are infringed by the software, your patent license from such contributor
+to the software ends automatically.
+
+(C) If you distribute any portion of the software, you must retain all
+copyright, patent, trademark, and attribution notices that are present in the
+software.
+
+(D) If you distribute any portion of the software in source code form, you may
+do so only under this license by including a complete copy of this license with
+your distribution. If you distribute any portion of the software in compiled or
+object code form, you may only do so under a license that complies with this
+license.
+
+(E) The software is licensed "as-is." You bear the risk of using it. The
+contributors give no express warranties, guarantees or conditions. You may have
+additional consumer rights under your local laws which this license cannot
+change. To the extent permitted under your local laws, the contributors exclude
+the implied warranties of merchantability, fitness for a particular purpose and
+non-infringement.
+
+
+
+ +
+XZ Utils +show license +homepage +
+
See http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/xz/COPYING
+
+
+
+ +
+altgraph +show license +homepage +
+
License
+=======
+
+Copyright (c) 2004 Istvan Albert unless otherwise noted.
+
+Parts are copyright (c) Bob Ippolito
+
+Parts are copyright (c) 2010-2014 Ronald Oussoren
+
+MIT 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.
+
+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.
+
+
+
+
+ +
+blink HTMLTokenizer +show license +homepage +
+
Copyright (C) 2008 Apple Inc. All Rights Reserved.
+Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
+Copyright (C) 2010 Google, Inc. All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. 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.
+ *
+THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+boringssl +show license +homepage +
+
+  LICENSE ISSUES
+  ==============
+
+  The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
+  the OpenSSL License and the original SSLeay license apply to the toolkit.
+  See below for the actual license texts. Actually both licenses are BSD-style
+  Open Source licenses. In case of any license issues related to OpenSSL
+  please contact openssl-core@openssl.org.
+
+  OpenSSL License
+  ---------------
+
+/* ====================================================================
+ * Copyright (c) 1998-2011 The OpenSSL Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. 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.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ *    nor may "OpenSSL" appear in their names without prior written
+ *    permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com).  This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+
+
+
+ +
+bspatch +show license +homepage +
+
BSD Protection License
+February 2002
+
+Preamble
+--------
+
+The Berkeley Software Distribution ("BSD") license has proven very effective
+over the years at allowing for a wide spread of work throughout both
+commercial and non-commercial products.  For programmers whose primary
+intention is to improve the general quality of available software, it is
+arguable that there is no better license than the BSD license, as it
+permits improvements to be used wherever they will help, without idealogical
+or metallic constraint.
+
+This is of particular value to those who produce reference implementations
+of proposed standards: The case of TCP/IP clearly illustrates that freely
+and universally available implementations leads the rapid acceptance of
+standards -- often even being used instead of a de jure standard (eg, OSI
+network models).
+
+With the rapid proliferation of software licensed under the GNU General
+Public License, however, the continued success of this role is called into
+question.  Given that the inclusion of a few lines of "GPL-tainted" work
+into a larger body of work will result in restricted distribution -- and
+given that further work will likely build upon the "tainted" portions,
+making them difficult to remove at a future date -- there are inevitable
+circumstances where authors would, in order to protect their goal of
+providing for the widespread usage of their work, wish to guard against
+such "GPL-taint".
+
+In addition, one can imagine that companies which operate by producing and
+selling (possibly closed-source) code would wish to protect themselves
+against the rise of a GPL-licensed competitor.  While under existing
+licenses this would mean not releasing their code under any form of open
+license, if a license existed under which they could incorporate any
+improvements back into their own (commercial) products then they might be
+far more willing to provide for non-closed distribution.
+
+For the above reasons, we put forth this "BSD Protection License": A
+license designed to retain the freedom granted by the BSD license to use
+licensed works in a wide variety of settings, both non-commercial and
+commercial, while protecting the work from having future contributors
+restrict that freedom.
+
+The precise terms and conditions for copying, distribution, and
+modification follow.
+
+BSD PROTECTION LICENSE
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION, AND MODIFICATION
+----------------------------------------------------------------
+
+0. Definitions.
+   a) "Program", below, refers to any program or work distributed under
+      the terms of this license.
+   b) A "work based on the Program", below, refers to either the Program
+      or any derivative work under copyright law.
+   c) "Modification", below, refers to the act of creating derivative works.
+   d) "You", below, refers to each licensee.
+
+1. Scope.
+   This license governs the copying, distribution, and modification of the
+   Program.  Other activities are outside the scope of this license; The
+   act of running the Program is not restricted, and the output from the
+   Program is covered only if its contents constitute a work based on the
+   Program.
+
+2. Verbatim copies.
+   You may copy and distribute verbatim copies of the Program as you
+   receive it, in any medium, provided that you conspicuously and
+   appropriately publish on each copy an appropriate copyright notice; keep
+   intact all the notices that refer to this License and to the absence of
+   any warranty; and give any other recipients of the Program a copy of this
+   License along with the Program.
+
+3. Modification and redistribution under closed license.
+   You may modify your copy or copies of the Program, and distribute
+   the resulting derivative works, provided that you meet the
+   following conditions:
+   a) The copyright notice and disclaimer on the Program must be reproduced
+      and included in the source code, documentation, and/or other materials
+      provided in a manner in which such notices are normally distributed.
+   b) The derivative work must be clearly identified as such, in order that
+      it may not be confused with the original work.
+   c) The license under which the derivative work is distributed must
+      expressly prohibit the distribution of further derivative works.
+
+4. Modification and redistribution under open license.
+   You may modify your copy or copies of the Program, and distribute
+   the resulting derivative works, provided that you meet the
+   following conditions:
+   a) The copyright notice and disclaimer on the Program must be reproduced
+      and included in the source code, documentation, and/or other materials
+      provided in a manner in which such notices are normally distributed.
+   b) You must clearly indicate the nature and date of any changes made
+      to the Program.  The full details need not necessarily be included in
+      the individual modified files, provided that each modified file is
+      clearly marked as such and instructions are included on where the
+      full details of the modifications may be found.
+   c) You must cause any work that you distribute or publish, that in whole
+      or in part contains or is derived from the Program or any part
+      thereof, to be licensed as a whole at no charge to all third
+      parties under the terms of this License.
+
+5. Implied acceptance.
+   You may not copy or distribute the Program or any derivative works except
+   as expressly provided under this license.  Consequently, any such action
+   will be taken as implied acceptance of the terms of this license.
+
+6. NO WARRANTY.
+   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+   AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+   THE COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+   REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING, BUT
+   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+   TORT, EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGES.
+
+
+
+ +
+chromite +show license +homepage +
+
// Copyright (c) 2006-2009 The Chromium OS Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+chromite +show license +homepage +
+
// Copyright (c) 2006-2009 The Chromium OS Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+chromite +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+class-dump +show license +homepage +
+
(Copied from the README.)
+
+--------------------------------------------------------------------------------
+
+This file is part of class-dump, a utility for examining the
+Objective-C segment of Mach-O files.
+Copyright (C) 1997-1998, 2000-2001, 2004-2013 Steve Nygard.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Contact
+-------
+
+You may contact the author by:
+   e-mail:  nygard at gmail.com
+
+
+ +
+codesighs +show license +homepage +
+
                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation, method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your") means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a) under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code; or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a) under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d) Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2) separate from the Contributor Version;
+          3) for infringements caused by: i) third party modifications of
+          Contributor Version or ii) the combination of Modifications made
+          by that Contributor with other software (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+          (c) Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code. If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice. If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A. You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code. You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1. This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2. If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant") alleging that:
+
+     (a) such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant. If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b) any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3. If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4. In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (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.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above. If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting the provisions above and replace them with the notice and
+     other provisions required by the [___] License. If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
+     ----------------------------------------------------------------------
+
+     AMENDMENTS
+
+     The Netscape Public License Version 1.1 ("NPL") consists of the
+     Mozilla Public License Version 1.1 with the following Amendments,
+     including Exhibit A-Netscape Public License. Files identified with
+     "Exhibit A-Netscape Public License" are governed by the Netscape
+     Public License Version 1.1.
+
+     Additional Terms applicable to the Netscape Public License.
+          I. Effect.
+          These additional terms described in this Netscape Public
+          License -- Amendments shall apply to the Mozilla Communicator
+          client code and to all Covered Code under this License.
+
+          II. "Netscape's Branded Code" means Covered Code that Netscape
+          distributes and/or permits others to distribute under one or more
+          trademark(s) which are controlled by Netscape but which are not
+          licensed for use under this License.
+
+          III. Netscape and logo.
+          This License does not grant any rights to use the trademarks
+          "Netscape", the "Netscape N and horizon" logo or the "Netscape
+          lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript",
+          "Smart Browsing" even if such marks are included in the Original
+          Code or Modifications.
+
+          IV. Inability to Comply Due to Contractual Obligation.
+          Prior to licensing the Original Code under this License, Netscape
+          has licensed third party code for use in Netscape's Branded Code.
+          To the extent that Netscape is limited contractually from making
+          such third party code available under this License, Netscape may
+          choose to reintegrate such code into Covered Code without being
+          required to distribute such code in Source Code form, even if
+          such code would otherwise be considered "Modifications" under
+          this License.
+
+          V. Use of Modifications and Covered Code by Initial Developer.
+               V.1. In General.
+               The obligations of Section 3 apply to Netscape, except to
+               the extent specified in this Amendment, Section V.2 and V.3.
+
+               V.2. Other Products.
+               Netscape may include Covered Code in products other than the
+               Netscape's Branded Code which are released by Netscape
+               during the two (2) years following the release date of the
+               Original Code, without such additional products becoming
+               subject to the terms of this License, and may license such
+               additional products on different terms from those contained
+               in this License.
+
+               V.3. Alternative Licensing.
+               Netscape may license the Source Code of Netscape's Branded
+               Code, including Modifications incorporated therein, without
+               such Netscape Branded Code becoming subject to the terms of
+               this License, and may license such Netscape Branded Code on
+               different terms from those contained in this License.
+
+          VI. Litigation.
+          Notwithstanding the limitations of Section 11 above, the
+          provisions regarding litigation in Section 11(a), (b) and (c) of
+          the License shall apply to all disputes relating to this License.
+
+     EXHIBIT A-Netscape Public License.
+
+          "The contents of this file are subject to the Netscape Public
+          License Version 1.1 (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.mozilla.org/NPL/
+
+          Software distributed under the License is distributed on an "AS
+          IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+          implied. See the License for the specific language governing
+          rights and limitations under the License.
+
+          The Original Code is Mozilla Communicator client code, released
+          March 31, 1998.
+
+          The Initial Developer of the Original Code is Netscape
+          Communications Corporation. Portions created by Netscape are
+          Copyright (C) 1998-1999 Netscape Communications Corporation. All
+          Rights Reserved.
+
+          Contributor(s): ______________________________________.
+
+          Alternatively, the contents of this file may be used under the
+          terms of the _____ license (the "[___] License"), in which case
+          the provisions of [______] License are applicable  instead of
+          those above. If you wish to allow use of your version of this
+          file only under the terms of the [____] License and not to allow
+          others to use your version of this file under the NPL, indicate
+          your decision by deleting the provisions above and replace  them
+          with the notice and other provisions required by the [___]
+          License. If you do not delete the provisions above, a recipient
+          may use your version of this file under either the NPL or the
+          [___] License."
+
+
+
+ +
+colorama +show license +homepage +
+
Copyright (c) 2010 Jonathan Hartley
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* 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.
+
+* Neither the name of the copyright holders, nor those of its contributors
+  may be used to endorse or promote products derived from this software without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+
+ +
+coverage +show license +homepage +
+
"""Code coverage measurement for Python.
+
+Ned Batchelder
+http://nedbatchelder.com/code/coverage
+
+"""
+
+from coverage.version import __version__, __url__
+
+from coverage.control import coverage, process_startup
+from coverage.data import CoverageData
+from coverage.cmdline import main, CoverageScript
+from coverage.misc import CoverageException
+
+# Module-level functions.  The original API to this module was based on
+# functions defined directly in the module, with a singleton of the coverage()
+# class.  That design hampered programmability, so the current api uses
+# explicitly-created coverage objects.  But for backward compatibility, here we
+# define the top-level functions to create the singleton when they are first
+# called.
+
+# Singleton object for use with module-level functions.  The singleton is
+# created as needed when one of the module-level functions is called.
+_the_coverage = None
+
+def _singleton_method(name):
+    """Return a function to the `name` method on a singleton `coverage` object.
+
+    The singleton object is created the first time one of these functions is
+    called.
+
+    """
+    # Disable pylint msg W0612, because a bunch of variables look unused, but
+    # they're accessed via locals().
+    # pylint: disable=W0612
+
+    def wrapper(*args, **kwargs):
+        """Singleton wrapper around a coverage method."""
+        global _the_coverage
+        if not _the_coverage:
+            _the_coverage = coverage(auto_data=True)
+        return getattr(_the_coverage, name)(*args, **kwargs)
+
+    import inspect
+    meth = getattr(coverage, name)
+    args, varargs, kw, defaults = inspect.getargspec(meth)
+    argspec = inspect.formatargspec(args[1:], varargs, kw, defaults)
+    docstring = meth.__doc__
+    wrapper.__doc__ = ("""\
+        A first-use-singleton wrapper around coverage.%(name)s.
+
+        This wrapper is provided for backward compatibility with legacy code.
+        New code should use coverage.%(name)s directly.
+
+        %(name)s%(argspec)s:
+
+        %(docstring)s
+        """ % locals()
+        )
+
+    return wrapper
+
+
+# Define the module-level functions.
+use_cache = _singleton_method('use_cache')
+start =     _singleton_method('start')
+stop =      _singleton_method('stop')
+erase =     _singleton_method('erase')
+exclude =   _singleton_method('exclude')
+analysis =  _singleton_method('analysis')
+analysis2 = _singleton_method('analysis2')
+report =    _singleton_method('report')
+annotate =  _singleton_method('annotate')
+
+
+# On Windows, we encode and decode deep enough that something goes wrong and
+# the encodings.utf_8 module is loaded and then unloaded, I don't know why.
+# Adding a reference here prevents it from being unloaded.  Yuk.
+import encodings.utf_8
+
+# Because of the "from coverage.control import fooey" lines at the top of the
+# file, there's an entry for coverage.coverage in sys.modules, mapped to None.
+# This makes some inspection tools (like pydoc) unable to find the class
+# coverage.coverage.  So remove that entry.
+import sys
+try:
+    del sys.modules['coverage.coverage']
+except KeyError:
+    pass
+
+
+# COPYRIGHT AND LICENSE
+#
+# Copyright 2001 Gareth Rees.  All rights reserved.
+# Copyright 2004-2013 Ned Batchelder.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+# 2. 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+# DAMAGE.
+
+
+
+ +
+d3 +show license +homepage +
+
Copyright (c) 2010-2014, Michael Bostock
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* 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.
+
+* The name Michael Bostock may not be used to endorse or promote products
+  derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+devscripts +show license +homepage +
+
		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+       51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+
+ +
+dom-distiller-js +show license +homepage +
+
Copyright 2014 The Chromium Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+   * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+   * 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.
+   * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+Parts of the following directories are available under Apache v2.0
+
+src/de
+Copyright (c) 2009-2011 Christian Kohlschütter
+
+third_party/gwt_exporter
+Copyright 2007 Timepedia.org
+
+third_party/gwt-2.5.1
+Copyright 2008 Google
+
+java/org/chromium/distiller/dev
+Copyright 2008 Google
+
+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:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+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
+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
+
+
+
+ +
+drawElements Quality Program +show license +homepage +
+
+                                 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 2014 The Android Open Source Project
+
+   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.
+
+
+
+ +
+dynamic annotations +show license +homepage +
+
/* Copyright (c) 2008-2009, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---
+ * Author: Kostya Serebryany
+ */
+
+
+
+ +
+etc1 +show license +homepage +
+
/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * 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.
+ */
+
+
+ +
+fancy_urllib +show license +homepage +
+
Name: fancy_urllib
+URL: http://googleappengine.googlecode.com/svn/trunk/python/lib/fancy_urllib
+License: Apache 2.0
+License File: README.chromium
+Security Critical: no
+
+The fancy_urllib library was obtained from
+http://googleappengine.googlecode.com/svn/trunk/python/lib/fancy_urllib/fancy_urllib/__init__.py
+under the following license (http://googleappengine.googlecode.com/svn/trunk/python/LICENSE):
+
+GOOGLE APP ENGINE SDK
+=====================
+Copyright 2008 Google Inc.
+All rights reserved.
+
+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.
+
+Local Modifications:
+- Python 2.7.9 adds an additional parameter to urllib2.HTTPSHandler.do_open. I
+  modified FancyHTTPSHandler.do_open to take this parameter and forward it to
+  the super function.
+
+
+
+ +
+fdlibm +show license +homepage +
+
Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
+
+Developed at SunSoft, a Sun Microsystems, Inc. business.
+Permission to use, copy, modify, and distribute this
+software is freely granted, provided that this notice
+is preserved.
+
+
+
+ +
+ffmpeg +show license +homepage +
+
#FFmpeg:
+
+Most files in FFmpeg are under the GNU Lesser General Public License version 2.1
+or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other
+files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
+FFmpeg.
+
+Some optional parts of FFmpeg are licensed under the GNU General Public License
+version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of
+these parts are used by default, you have to explicitly pass `--enable-gpl` to
+configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
+
+Specifically, the GPL parts of FFmpeg are:
+
+- libpostproc
+- optional x86 optimizations in the files
+  - `libavcodec/x86/flac_dsp_gpl.asm`
+  - `libavcodec/x86/idct_mmx.c`
+  - `libavfilter/x86/vf_removegrain.asm`
+- libutvideo encoding/decoding wrappers in
+  `libavcodec/libutvideo*.cpp`
+- the X11 grabber in `libavdevice/x11grab.c`
+- the swresample test app in
+  `libswresample/swresample-test.c`
+- the `texi2pod.pl` tool
+- the following filters in libavfilter:
+    - `f_ebur128.c`
+    - `vf_blackframe.c`
+    - `vf_boxblur.c`
+    - `vf_colormatrix.c`
+    - `vf_cover_rect.c`
+    - `vf_cropdetect.c`
+    - `vf_delogo.c`
+    - `vf_eq.c`
+    - `vf_find_rect.c`
+    - `vf_fspp.c`
+    - `vf_geq.c`
+    - `vf_histeq.c`
+    - `vf_hqdn3d.c`
+    - `vf_interlace.c`
+    - `vf_kerndeint.c`
+    - `vf_mcdeint.c`
+    - `vf_mpdecimate.c`
+    - `vf_owdenoise.c`
+    - `vf_perspective.c`
+    - `vf_phase.c`
+    - `vf_pp.c`
+    - `vf_pp7.c`
+    - `vf_pullup.c`
+    - `vf_sab.c`
+    - `vf_smartblur.c`
+    - `vf_repeatfields.c`
+    - `vf_spp.c`
+    - `vf_stereo3d.c`
+    - `vf_super2xsai.c`
+    - `vf_tinterlace.c`
+    - `vf_uspp.c`
+    - `vsrc_mptestsrc.c`
+
+Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
+the configure parameter `--enable-version3` will activate this licensing option
+for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts,
+`COPYING.GPLv3` to learn the exact legal terms that apply in this case.
+
+There are a handful of files under other licensing terms, namely:
+
+* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and
+  `libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for
+  licensing details. Specifically note that you must credit the IJG in the
+  documentation accompanying your program if you only distribute executables.
+  You must also indicate any changes including additions and deletions to
+  those three files in the documentation.
+* `tests/reference.pnm` is under the expat license.
+
+
+external libraries
+==================
+
+FFmpeg can be combined with a number of external libraries, which sometimes
+affect the licensing of binaries resulting from the combination.
+
+compatible libraries
+--------------------
+
+The following libraries are under GPL:
+- frei0r
+- libcdio
+- librubberband
+- libutvideo
+- libvidstab
+- libx264
+- libx265
+- libxavs
+- libxvid
+
+When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
+passing `--enable-gpl` to configure.
+
+The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
+license is incompatible with the LGPL v2.1 and the GPL v2, but not with
+version 3 of those licenses. So to combine these libraries with FFmpeg, the
+license version needs to be upgraded by passing `--enable-version3` to configure.
+
+incompatible libraries
+----------------------
+
+The Fraunhofer AAC library, FAAC and aacplus are under licenses which
+are incompatible with the GPLv2 and v3. We do not know for certain if their
+licenses are compatible with the LGPL.
+If you wish to enable these libraries, pass `--enable-nonfree` to configure.
+But note that if you enable any of these libraries the resulting binary will
+be under a complex license mix that is more restrictive than the LGPL and that
+may result in additional obligations. It is possible that these
+restrictions cause the resulting binary to be unredistributeable.
+
+
+********************************************************************************
+
+libavcodec/arm/vp8dsp_armv6.S
+
+VP8 ARMv6 optimisations
+
+Copyright (c) 2010 Google Inc.
+Copyright (c) 2010 Rob Clark <rob@ti.com>
+Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
+
+This file is part of FFmpeg.
+
+FFmpeg is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+FFmpeg is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with FFmpeg; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+This code was partially ported from libvpx, which uses this license:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+* 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.
+
+* Neither the name of Google nor the names of its contributors may
+be used to endorse or promote products derived from this software
+without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+********************************************************************************
+
+libavformat/oggparsespeex.c
+
+Copyright (C) 2008  Reimar Döffinger
+
+      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.
+
+********************************************************************************
+
+libavcodec/x86/xvididct.asm
+
+XVID MPEG-4 VIDEO CODEC
+
+ Conversion from gcc syntax to x264asm syntax with modifications
+ by Christophe Gisquet <christophe.gisquet@gmail.com>
+
+ ===========     SSE2 inverse discrete cosine transform     ===========
+
+ Copyright(C) 2003 Pascal Massimino <skal@planet-d.net>
+
+ Conversion to gcc syntax with modifications
+ by Alexander Strange <astrange@ithinksw.com>
+
+ Originally from dct/x86_asm/fdct_sse2_skal.asm in Xvid.
+
+ Vertical pass is an implementation of the scheme:
+  Loeffler C., Ligtenberg A., and Moschytz C.S.:
+  Practical Fast 1D DCT Algorithm with Eleven Multiplications,
+  Proc. ICASSP 1989, 988-991.
+
+ Horizontal pass is a double 4x4 vector/matrix multiplication,
+ (see also Intel's Application Note 922:
+  http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
+  Copyright (C) 1999 Intel Corporation)
+
+ More details at http://skal.planet-d.net/coding/dct.html
+
+ =======     MMX and XMM forward discrete cosine transform     =======
+
+ Copyright(C) 2001 Peter Ross <pross@xvid.org>
+
+ Originally provided by Intel at AP-922
+ http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
+ (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm)
+ but in a limited edition.
+ New macro implements a column part for precise iDCT
+ The routine precision now satisfies IEEE standard 1180-1990.
+
+ Copyright(C) 2000-2001 Peter Gubanov <peter@elecard.net.ru>
+ Rounding trick Copyright(C) 2000 Michel Lespinasse <walken@zoy.org>
+
+ http://www.elecard.com/peter/idct.html
+ http://www.linuxvideo.org/mpeg2dec/
+
+ These examples contain code fragments for first stage iDCT 8x8
+ (for rows) and first stage DCT 8x8 (for columns)
+
+ conversion to gcc syntax by Michael Niedermayer
+
+ ======================================================================
+
+ This file is part of FFmpeg.
+
+ FFmpeg is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ FFmpeg is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with FFmpeg; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+********************************************************************************
+
+libavcodec/arm/jrevdct_arm.S
+
+C-like prototype :
+        void j_rev_dct_arm(DCTBLOCK data)
+
+   With DCTBLOCK being a pointer to an array of 64 'signed shorts'
+
+   Copyright (c) 2001 Lionel Ulmer (lionel.ulmer@free.fr / bbrox@bbrox.org)
+
+   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
+   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.
+
+********************************************************************************
+
+libswresample/version.h
+
+Version macros.
+
+This file is part of libswresample
+
+libswresample is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+libswresample is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with libswresample; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+********************************************************************************
+
+libavcodec/faandct.c
+
+Floating point AAN DCT
+this implementation is based upon the IJG integer AAN DCT (see jfdctfst.c)
+
+Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
+Copyright (c) 2003 Roman Shaposhnik
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************************************
+
+libavformat/oggparsetheora.c
+
+Copyright (C) 2005  Matthieu CASTET, Alex Beregszaszi
+
+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.
+
+********************************************************************************
+
+libswresample/swresample.h
+
+Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
+
+This file is part of libswresample
+
+libswresample is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+libswresample is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with libswresample; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+********************************************************************************
+
+libavcodec/jfdctfst.c
+libavcodec/jfdctint_template.c
+libavcodec/jrevdct.c
+
+This file is part of the Independent JPEG Group's software.
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and
+you, its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1994-1996, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to
+these conditions:
+(1) If any part of the source code for this software is distributed, then
+this README file must be included, with this copyright and no-warranty
+notice unaltered; and any additions, deletions, or changes to the original
+files must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work
+of the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG
+code, not just to the unmodified library.  If you use our work, you ought
+to acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company
+name in advertising or publicity relating to this software or products
+derived from it.  This software may be referred to only as "the Independent
+JPEG Group's software".
+
+We specifically permit and encourage the use of this software as the basis
+of commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+********************************************************************************
+
+libavcodec/fft_fixed_32.c
+libavcodec/fft_init_table.c
+libavcodec/fft_table.h
+libavcodec/mdct_fixed_32.c
+libavcodec/mips/aacdec_mips.c
+libavcodec/mips/aacdec_mips.h
+libavcodec/mips/aacpsdsp_mips.c
+libavcodec/mips/aacsbr_mips.c
+libavcodec/mips/aacsbr_mips.h
+libavcodec/mips/amrwbdec_mips.h
+libavcodec/mips/compute_antialias_fixed.h
+libavcodec/mips/compute_antialias_float.h
+libavcodec/mips/lsp_mips.h
+libavcodec/mips/sbrdsp_mips.c
+libavutil/fixed_dsp.c
+libavutil/fixed_dsp.h
+libavutil/mips/float_dsp_mips.c
+libavutil/mips/libm_mips.h
+libavutil/softfloat_tables.h
+
+Copyright (c) 2012
+MIPS Technologies, Inc., California.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. 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.
+3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Authors:
+Branimir Vasic   (bvasic@mips.com)
+Darko Laus       (darko@mips.com)
+Djordje Pesut    (djordje@mips.com)
+Goran Cordasic   (goran@mips.com)
+Nedeljko Babic   (nedeljko.babic imgtec com)
+Mirjana Vulin    (mvulin@mips.com)
+Stanislav Ocovaj (socovaj@mips.com)
+Zoran Lukic      (zoranl@mips.com)
+
+********************************************************************************
+
+libavformat/oggdec.c
+libavformat/oggdec.h
+libavformat/oggparseogm.c
+libavformat/oggparsevorbis.c
+
+Copyright (C) 2005  Michael Ahlberg, Måns Rullgård
+
+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.
+
+********************************************************************************
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+ +
+fips181 +show license +homepage +
+
Copyright (c) 1999, 2000, 2001, 2002
+Adel I. Mirzazhanov. All rights reserved
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+ 
+     1.Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer. 
+     2.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. 
+     3.The name of the author may not be used to endorse or promote products
+       derived from this software without specific prior written permission. 
+ 		  
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR  ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING,  BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN  NO  EVENT  SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES;  LOSS OF USE,  DATA,  OR  PROFITS;  OR BUSINESS
+INTERRUPTION)  HOWEVER  CAUSED  AND  ON  ANY  THEORY OF LIABILITY,
+WHETHER  IN  CONTRACT,   STRICT   LIABILITY,  OR  TORT  (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+		  
+
+
+ +
+flac +show license +homepage +
+
Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+- 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.
+
+- Neither the name of the Xiph.org Foundation nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+fontconfig +show license +homepage +
+
fontconfig/COPYING
+
+Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard
+Copyright © 2005 Patrick Lam
+Copyright © 2009 Roozbeh Pournader
+Copyright © 2008,2009 Red Hat, Inc.
+Copyright © 2008 Danilo Šegan
+Copyright © 2012 Google, Inc.
+
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the name of the author(s) not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission.  The authors make no
+representations about the suitability of this software for any purpose.  It
+is provided "as is" without express or implied warranty.
+
+THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+
+
+
+ +
+google-glog's symbolization library +show license +homepage +
+
// Copyright (c) 2006, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * 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.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+google-jstemplate +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+google-safe-browsing +show license +homepage +
+
Copyright 2009 Google Inc.
+
+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.
+
+
+
+ +
+gsutil +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+harfbuzz-ng +show license +homepage +
+
HarfBuzz is licensed under the so-called "Old MIT" license.  Details follow.
+For parts of HarfBuzz that are licensed under different licenses see individual
+files names COPYING in subdirectories where applicable.
+
+Copyright © 2010,2011,2012  Google, Inc.
+Copyright © 2012  Mozilla Foundation
+Copyright © 2011  Codethink Limited
+Copyright © 2008,2010  Nokia Corporation and/or its subsidiary(-ies)
+Copyright © 2009  Keith Stribley
+Copyright © 2009  Martin Hosken and SIL International
+Copyright © 2007  Chris Wilson
+Copyright © 2006  Behdad Esfahbod
+Copyright © 2005  David Turner
+Copyright © 2004,2007,2008,2009,2010  Red Hat, Inc.
+Copyright © 1998-2004  David Turner and Werner Lemberg
+
+For full copyright notices consult the individual files in the package.
+
+
+Permission is hereby granted, without written agreement and without
+license or royalty fees, to use, copy, modify, and distribute this
+software and its documentation for any purpose, provided that the
+above copyright notice and the following two paragraphs appear in
+all copies of this software.
+
+IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+
+
+ +
+hunspell +show license +homepage +
+
GPL 2.0/LGPL 2.1/MPL 1.1 tri-license
+
+The contents of this software may be used under the terms of
+the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL",
+see COPYING.LGPL) or (excepting the LGPLed GNU gettext library in the
+intl/ directory) the Mozilla Public License Version 1.1 or later
+(the "MPL", see COPYING.MPL).
+
+Software distributed under these licenses is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the licences
+for the specific language governing rights and limitations under the licenses.
+
+
+
+ +
+iccjpeg +show license +homepage +
+
LICENSE extracted from IJG's jpeg distribution:
+-----------------------------------------------
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+
+
+ +
+icu +show license +homepage +
+
ICU License - ICU 1.8.1 and later
+
+   COPYRIGHT AND PERMISSION NOTICE
+
+   Copyright (c) 1995-2014 International Business Machines Corporation and
+   others
+
+   All rights reserved.
+
+   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, and/or sell copies of the Software, and to permit persons to
+   whom the Software is furnished to do so, provided that the above
+   copyright notice(s) and this permission notice appear in all copies of
+   the Software and that both the above copyright notice(s) and this
+   permission notice appear in supporting documentation.
+
+   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 OF
+   THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
+   INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
+   OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+   OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+   PERFORMANCE OF THIS SOFTWARE.
+
+   Except as contained in this notice, the name of a copyright holder shall
+   not be used in advertising or otherwise to promote the sale, use or
+   other dealings in this Software without prior written authorization of
+   the copyright holder.
+     ___________________________________________________________________
+
+   All trademarks and registered trademarks mentioned herein are the
+   property of their respective owners.
+     ___________________________________________________________________
+
+Third-Party Software Licenses
+
+   This section contains third-party software notices and/or additional
+   terms for licensed third-party software components included within ICU
+   libraries.
+
+  1. Unicode Data Files and Software
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright © 1991-2014 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in
+http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software,
+(b) this copyright and permission notice appear in associated
+documentation, and
+(c) there is clear notice in each modified Data File or in the Software
+as well as in the documentation associated with the Data File(s) or
+Software that the data or software has been modified.
+
+THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
+
+  2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ #    The Google Chrome software developed by Google is licensed under the BSD li
+cense. Other software included in this distribution is provided under other licen
+ses, as set forth below.
+ #
+ #      The BSD License
+ #      http://opensource.org/licenses/bsd-license.php
+ #      Copyright (C) 2006-2008, Google Inc.
+ #
+ #      All rights reserved.
+ #
+ #      Redistribution and use in source and binary forms, with or without modifi
+cation, are permitted provided that the following conditions are met:
+ #
+ #      Redistributions of source code must retain the above copyright notice, th
+is list of conditions and the following disclaimer.
+ #      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.
+ #      Neither the name of  Google Inc. nor the names of its contributors may be
+ used to endorse or promote products derived from this software without specific
+prior written permission.
+ #
+ #
+ #      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS I
+S" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPL
+IED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLA
+IMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIR
+ECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDIN
+G, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF L
+IABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O
+F THE POSSIBILITY OF SUCH DAMAGE.
+ #
+ #
+ #      The word list in cjdict.txt are generated by combining three word lists l
+isted
+ #      below with further processing for compound word breaking. The frequency i
+s generated
+ #      with an iterative training against Google web corpora.
+ #
+ #      * Libtabe (Chinese)
+ #        - https://sourceforge.net/project/?group_id=1519
+ #        - Its license terms and conditions are shown below.
+ #
+ #      * IPADIC (Japanese)
+ #        - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ #        - Its license terms and conditions are shown below.
+ #
+ #      ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ #      /*
+ #       * Copyrighy (c) 1999 TaBE Project.
+ #       * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ #       * All rights reserved.
+ #       *
+ #       * Redistribution and use in source and binary forms, with or without
+ #       * modification, are permitted provided that the following conditions
+ #       * are met:
+ #       *
+ #       * . Redistributions of source code must retain the above copyright
+ #       *   notice, this list of conditions and the following disclaimer.
+ #       * . 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.
+ #       * . Neither the name of the TaBE Project nor the names of its
+ #       *   contributors may be used to endorse or promote products derived
+ #       *   from this software without specific prior written permission.
+ #       *
+ #       * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #       * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #       * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #       * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #       * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #       * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #       * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #       * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #       * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #       * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #       * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #       * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #       */
+ #
+ #      /*
+ #       * Copyright (c) 1999 Computer Systems and Communication Lab,
+ #       *                    Institute of Information Science, Academia Sinica.
+ #       * All rights reserved.
+ #       *
+ #       * Redistribution and use in source and binary forms, with or without
+ #       * modification, are permitted provided that the following conditions
+ #       * are met:
+ #       *
+ #       * . Redistributions of source code must retain the above copyright
+ #       *   notice, this list of conditions and the following disclaimer.
+ #       * . 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.
+ #       * . Neither the name of the Computer Systems and Communication Lab
+ #       *   nor the names of its contributors may be used to endorse or
+ #       *   promote products derived from this software without specific
+ #       *   prior written permission.
+ #       *
+ #       * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #       * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #       * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #       * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #       * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #       * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #       * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #       * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #       * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #       * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #       * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #       * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #       */
+ #
+ #      Copyright 1996 Chih-Hao Tsai @ Beckman Institute, University of Illinois
+ #      c-tsai4@uiuc.edu  http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ #      ---------------COPYING.libtabe-----END-----------------------------------
+-
+ #
+ #
+ #      ---------------COPYING.ipadic-----BEGIN----------------------------------
+--
+ #
+ #      Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ #      and Technology.  All Rights Reserved.
+ #
+ #      Use, reproduction, and distribution of this software is permitted.
+ #      Any copy of this software, whether in its original form or modified,
+ #      must include both the above copyright notice and the following
+ #      paragraphs.
+ #
+ #      Nara Institute of Science and Technology (NAIST),
+ #      the copyright holders, disclaims all warranties with regard to this
+ #      software, including all implied warranties of merchantability and
+ #      fitness, in no event shall NAIST be liable for
+ #      any special, indirect or consequential damages or any damages
+ #      whatsoever resulting from loss of use, data or profits, whether in an
+ #      action of contract, negligence or other tortuous action, arising out
+ #      of or in connection with the use or performance of this software.
+ #
+ #      A large portion of the dictionary entries
+ #      originate from ICOT Free Software.  The following conditions for ICOT
+ #      Free Software applies to the current dictionary as well.
+ #
+ #      Each User may also freely distribute the Program, whether in its
+ #      original form or modified, to any third party or parties, PROVIDED
+ #      that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ #      on, or be attached to, the Program, which is distributed substantially
+ #      in the same form as set out herein and that such intended
+ #      distribution, if actually made, will neither violate or otherwise
+ #      contravene any of the laws and regulations of the countries having
+ #      jurisdiction over the User or the intended distribution itself.
+ #
+ #      NO WARRANTY
+ #
+ #      The program was produced on an experimental basis in the course of the
+ #      research and development conducted during the project and is provided
+ #      to users as so produced on an experimental basis.  Accordingly, the
+ #      program is provided without any warranty whatsoever, whether express,
+ #      implied, statutory or otherwise.  The term "warranty" used herein
+ #      includes, but is not limited to, any warranty of the quality,
+ #      performance, merchantability and fitness for a particular purpose of
+ #      the program and the nonexistence of any infringement or violation of
+ #      any right of any third party.
+ #
+ #      Each user of the program will agree and understand, and be deemed to
+ #      have agreed and understood, that there is no warranty whatsoever for
+ #      the program and, accordingly, the entire risk arising from or
+ #      otherwise connected with the program is assumed by the user.
+ #
+ #      Therefore, neither ICOT, the copyright holder, or any other
+ #      organization that participated in or was otherwise related to the
+ #      development of the program and their respective officials, directors,
+ #      officers and other employees shall be held liable for any and all
+ #      damages, including, without limitation, general, special, incidental
+ #      and consequential damages, arising out of or otherwise in connection
+ #      with the use or inability to use the program or any product, material
+ #      or result produced or otherwise obtained by using the program,
+ #      regardless of whether they have been advised of, or otherwise had
+ #      knowledge of, the possibility of such damages at any time during the
+ #      project or thereafter.  Each user will be deemed to have agreed to the
+ #      foregoing by his or her commencement of use of the program.  The term
+ #      "use" as used herein includes, but is not limited to, the use,
+ #      modification, copying and distribution of the program and the
+ #      production of secondary products from the program.
+ #
+ #      In the case where the program, whether in its original form or
+ #      modified, was distributed or delivered to or received by a user from
+ #      any person, organization or entity other than ICOT, unless it makes or
+ #      grants independently of ICOT any specific warranty to the user in
+ #      writing, such person, organization or entity, will also be exempted
+ #      from and not be held liable to the user for any such damages as noted
+ #      above as far as the program is concerned.
+ #
+ #      ---------------COPYING.ipadic-----END------------------------------------
+
+  3. Lao Word Break Dictionary Data (laodict.txt)
+
+ #      Copyright (c) 2013 International Business Machines Corporation
+ #      and others. All Rights Reserved.
+ #
+ #      Project:    http://code.google.com/p/lao-dictionary/
+ #      Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ #      License:    http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICEN
+SE.txt
+ #                  (copied below)
+ #
+ #      This file is derived from the above dictionary, with slight modifications
+.
+ #      -------------------------------------------------------------------------
+-------
+ #      Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ #      All rights reserved.
+ #
+ #      Redistribution and use in source and binary forms, with or without modifi
+cation,
+ #      are permitted provided that the following conditions are met:
+ #
+ #              Redistributions of source code must retain the above copyright no
+tice, this
+ #              list of conditions and the following disclaimer. Redistributions
+in binary
+ #              form must reproduce the above copyright notice, this list of cond
+itions and
+ #              the following disclaimer in the documentation and/or other materi
+als
+ #              provided with the distribution.
+ #
+ #      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS I
+S" AND
+ #      ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMP
+LIED
+ #      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #      DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIA
+BLE FOR
+ #      ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DA
+MAGES
+ #      (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVIC
+ES;
+ #      LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED A
+ND ON
+ #      ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ #      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS
+ #      SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #      -------------------------------------------------------------------------
+-------
+
+  4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ #      Copyright (c) 2014 International Business Machines Corporation
+ #      and others. All Rights Reserved.
+ #
+ #      This list is part of a project hosted at:
+ #        github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ #      -------------------------------------------------------------------------
+-------
+ #      Copyright (c) 2013, LeRoy Benjamin Sharon
+ #      All rights reserved.
+ #
+ #      Redistribution and use in source and binary forms, with or without modifi
+cation,
+ #      are permitted provided that the following conditions are met:
+ #
+ #        Redistributions of source code must retain the above copyright notice,
+this
+ #        list of conditions and the following disclaimer.
+ #
+ #        Redistributions in binary form must reproduce the above copyright notic
+e, this
+ #        list of conditions and the following disclaimer in the documentation an
+d/or
+ #        other materials provided with the distribution.
+ #
+ #        Neither the name Myanmar Karen Word Lists, nor the names of its
+ #        contributors may be used to endorse or promote products derived from
+ #        this software without specific prior written permission.
+ #
+ #      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS I
+S" AND
+ #      ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMP
+LIED
+ #      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #      DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIA
+BLE FOR
+ #      ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DA
+MAGES
+ #      (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVIC
+ES;
+ #      LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED A
+ND ON
+ #      ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ #      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS
+ #      SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #      -------------------------------------------------------------------------
+-------
+
+  5. Time Zone Database
+
+   ICU uses the public domain data and code derived from Time Zone Database
+   for its time zone support. The ownership of the TZ database is explained
+   in BCP 175: Procedure for Maintaining the Time Zone Database section 7.
+
+7.  Database Ownership
+
+   The TZ database itself is not an IETF Contribution or an IETF
+   document.  Rather it is a pre-existing and regularly updated work
+   that is in the public domain, and is intended to remain in the public
+   domain.  Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do not apply
+   to the TZ Database or contributions that individuals make to it.
+   Should any claims be made and substantiated against the TZ Database,
+   the organization that is providing the IANA Considerations defined in
+   this RFC, under the memorandum of understanding with the IETF,
+   currently ICANN, may act in accordance with all competent court
+   orders.  No ownership claims will be made by ICANN or the IETF Trust
+   on the database or the code.  Any person making a contribution to the
+   database or code waives all rights to future claims in that
+   contribution or in the TZ Database.
+
+
+
+ +
+ijar +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+
+ +
+jsoncpp +show license +homepage +
+
The JsonCpp library's source code, including accompanying documentation, 
+tests and demonstration applications, are licensed under the following
+conditions...
+
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all 
+jurisdictions which recognize such a disclaimer. In such jurisdictions, 
+this software is released into the Public Domain.
+
+In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
+2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
+released under the terms of the MIT License (see below).
+
+In jurisdictions which recognize Public Domain property, the user of this 
+software may choose to accept it either as 1) Public Domain, 2) under the 
+conditions of the MIT License (see below), or 3) under the terms of dual 
+Public Domain/MIT License conditions described here, as they choose.
+
+The MIT License is about as close to Public Domain as a license can get, and is
+described in clear, concise terms at:
+
+   http://en.wikipedia.org/wiki/MIT_License
+   
+The full text of the MIT License follows:
+
+========================================================================
+Copyright (c) 2007-2010 Baptiste Lepilleur
+
+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.
+========================================================================
+(END LICENSE TEXT)
+
+The MIT license is compatible with both the GPL and commercial
+software, affording one all of the rights of Public Domain with the
+minor nuisance of being required to keep the above copyright notice
+and license text in the source code. Note also that by accepting the
+Public Domain "license" you can re-license your copy using whatever
+license you like.
+
+
+
+ +
+libcxx +show license +homepage +
+
==============================================================================
+libc++ License
+==============================================================================
+
+The libc++ library is dual licensed under both the University of Illinois
+"BSD-Like" license and the MIT license.  As a user of this code you may choose
+to use it under either license.  As a contributor, you agree to allow your code
+to be used under both.
+
+Full text of the relevant licenses is included below.
+
+==============================================================================
+
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
+
+All rights reserved.
+
+Developed by:
+
+    LLVM Team
+
+    University of Illinois at Urbana-Champaign
+
+    http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+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:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimers.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimers in the
+      documentation and/or other materials provided with the distribution.
+
+    * Neither the names of the LLVM Team, University of Illinois at
+      Urbana-Champaign, nor the names of its contributors may be used to
+      endorse or promote products derived from this Software without specific
+      prior written permission.
+
+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
+CONTRIBUTORS 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 WITH THE
+SOFTWARE.
+
+==============================================================================
+
+Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
+
+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.
+
+
+
+ +
+libcxxabi +show license +homepage +
+
==============================================================================
+libc++abi License
+==============================================================================
+
+The libc++abi library is dual licensed under both the University of Illinois
+"BSD-Like" license and the MIT license.  As a user of this code you may choose
+to use it under either license.  As a contributor, you agree to allow your code
+to be used under both.
+
+Full text of the relevant licenses is included below.
+
+==============================================================================
+
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
+
+All rights reserved.
+
+Developed by:
+
+    LLVM Team
+
+    University of Illinois at Urbana-Champaign
+
+    http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+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:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimers.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimers in the
+      documentation and/or other materials provided with the distribution.
+
+    * Neither the names of the LLVM Team, University of Illinois at
+      Urbana-Champaign, nor the names of its contributors may be used to
+      endorse or promote products derived from this Software without specific
+      prior written permission.
+
+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
+CONTRIBUTORS 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 WITH THE
+SOFTWARE.
+
+==============================================================================
+
+Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
+
+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.
+
+
+
+ +
+libevent +show license +homepage +
+
Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+Copyright 2007-2009 Niels Provos and Nick Mathewson
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. 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.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+libexif +show license +homepage +
+
		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+
+ +
+libjingle +show license +homepage +
+
Copyright (c) 2013, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * 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.
+    * The name of the author may not be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+
+ +
+libjpeg +show license +homepage +
+
(Copied from the README.)
+
+--------------------------------------------------------------------------------
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+--------------------------------------------------------------------------------
+
+jconfig.h is distributed under the MPL 1.1/GPL 2.0/LGPL 2.1 tri-license.
+
+jmorecfg.h contains modifications, which are distributed under the Netscape
+Public License.
+
+
+
+ +
+libjpeg-turbo +show license +homepage +
+
libjpeg-turbo is licensed under a non-restrictive, BSD-style license
+(see README.)  The TurboJPEG/OSS wrapper (both C and Java versions) and
+associated test programs bear a similar license, which is reproduced below:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.
+- 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.
+- Neither the name of the libjpeg-turbo Project nor the names of its
+  contributors may be used to endorse or promote products derived from this
+  software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+libpng +show license +homepage +
+
+This copy of the libpng notices is provided for your convenience.  In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+pngusr.h is distributed under the MPL 1.1/GPL 2.0/LGPL 2.1 tri-license.
+
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.2.52, November 20, 2014, are
+Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.2.5
+with the following individual added to the list of Contributing Authors
+
+   Cosmin Truta
+
+libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
+Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.0.6
+with the following individuals added to the list of Contributing Authors
+
+   Simon-Pierre Cadieux
+   Eric S. Raymond
+   Gilles Vollant
+
+and with the following additions to the disclaimer:
+
+   There is no warranty against interference with your enjoyment of the
+   library or against infringement.  There is no warranty that our
+   efforts or the library will fulfill any of your particular purposes
+   or needs.  This library is provided with all faults, and the entire
+   risk of satisfactory quality, performance, accuracy, and effort is with
+   the user.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-0.96,
+with the following individuals added to the list of Contributing Authors:
+
+   Tom Lane
+   Glenn Randers-Pehrson
+   Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996, 1997 Andreas Dilger
+Distributed according to the same disclaimer and license as libpng-0.88,
+with the following individuals added to the list of Contributing Authors:
+
+   John Bowler
+   Kevin Bracey
+   Sam Bushell
+   Magnus Holmgren
+   Greg Roelofs
+   Tom Tanner
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+   Andreas Dilger
+   Dave Martindale
+   Guy Eric Schalnat
+   Paul Schmidt
+   Tim Wegner
+
+The PNG Reference Library is supplied "AS IS".  The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose.  The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+
+2. Altered versions must be plainly marked as such and must not
+   be misrepresented as being the original source.
+
+3. This Copyright notice may not be removed or altered from any
+   source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products.  If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+
+A "png_get_copyright" function is available, for convenient use in "about"
+boxes and the like:
+
+   printf("%s",png_get_copyright(NULL));
+
+Also, the PNG logo (in PNG format, of course) is supplied in the
+files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+
+Libpng is OSI Certified Open Source Software.  OSI Certified Open Source is a
+certification mark of the Open Source Initiative.
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+November 20, 2014
+
+
+
+ +
+libsecret +show license +homepage +
+
                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+ +
+libsrtp +show license +homepage +
+
/*
+ *	
+ * Copyright (c) 2001-2006 Cisco Systems, Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ *   Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ *   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.
+ * 
+ *   Neither the name of the Cisco Systems, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived
+ *   from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+
+ +
+libudev +show license +homepage +
+
                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+ +
+libusbx +show license +homepage +
+
		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+
+ +
+libva +show license +homepage +
+
    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, sub license, 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 (including the
+    next paragraph) 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 NON-INFRINGEMENT.
+    IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+
+
+
+ +
+libvpx +show license +homepage +
+
Copyright (c) 2010, The WebM Project authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * 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.
+
+  * Neither the name of Google, nor the WebM Project, nor the names
+    of its contributors may be used to endorse or promote products
+    derived from this software without specific prior written
+    permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+
+ +
+libxml +show license +homepage +
+
Except where otherwise noted in the source code (e.g. the files hash.c,
+list.c and the trio files, which are covered by a similar licence but
+with different Copyright notices) all the files are:
+
+ Copyright (C) 1998-2012 Daniel Veillard.  All Rights Reserved.
+
+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 fur-
+nished 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, FIT-
+NESS 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.
+
+
+
+ +
+libxslt +show license +homepage +
+
Licence for libxslt except libexslt
+----------------------------------------------------------------------
+ Copyright (C) 2001-2002 Daniel Veillard.  All Rights Reserved.
+
+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 fur-
+nished 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, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
+NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Daniel Veillard shall not
+be used in advertising or otherwise to promote the sale, use or other deal-
+ings in this Software without prior written authorization from him.
+
+----------------------------------------------------------------------
+
+Licence for libexslt
+----------------------------------------------------------------------
+ Copyright (C) 2001-2002 Thomas Broyer, Charlie Bozeman and Daniel Veillard.
+ All Rights Reserved.
+
+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 fur-
+nished 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, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
+NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the authors shall not
+be used in advertising or otherwise to promote the sale, use or other deal-
+ings in this Software without prior written authorization from him.
+----------------------------------------------------------------------
+
+
+
+ +
+libyuv +show license +homepage +
+
Copyright 2011 The LibYuv Project Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * 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.
+
+  * Neither the name of Google nor the names of its contributors may
+    be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+linux-syscall-support +show license +homepage +
+
// Copyright 2015 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+mach_override +show license +homepage +
+
Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
+Some rights reserved: http://opensource.org/licenses/mit
+
+mach_override includes a copy of libudis86, licensed as follows:
+
+Copyright (c) 2002-2009 Vivek Thampi
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, 
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+    * 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.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+markdown, a text-to-HTML conversion tool for web writers +show license +homepage +
+
Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)  
+Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)  
+Copyright 2004 Manfred Stienstra (the original version)  
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    
+*   Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+*   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.
+*   Neither the name of the <organization> nor the
+    names of its contributors may be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PYTHON MARKDOWN PROJECT ''AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL ANY CONTRIBUTORS TO THE PYTHON MARKDOWN PROJECT
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+
+
+ +
+mesa +show license +homepage +
+
The default Mesa license is as follows:
+
+Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
+
+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
+BRIAN PAUL 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.
+
+
+
+Some parts of Mesa are copyrighted under the GNU LGPL.  See the
+Mesa/docs/COPYRIGHT file for details.
+
+The following is the standard GNU copyright file.
+----------------------------------------------------------------------
+
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+                    675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+     Appendix: How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+ +
+minigbm +show license +homepage +
+
// Copyright 2014 The Chromium OS Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+mock +show license +homepage +
+
Copyright (c) 2003-2012, Michael Foord
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * 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.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+mock +show license +homepage +
+
Copyright (c) 2003-2012, Michael Foord
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * 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.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+mock4js +show license +homepage +
+
Copyright (C) 2009 by Tung Mac.
+
+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.
+
+
+
+ +
+modp base64 decoder +show license +homepage +
+
 * MODP_B64 - High performance base64 encoder/decoder
+ * Version 1.3 -- 17-Mar-2006
+ * http://modp.com/release/base64
+ *
+ * Copyright (c) 2005, 2006  Nick Galbreath -- nickg [at] modp [dot] com
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *   Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ *   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.
+ *
+ *   Neither the name of the modp.com nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+modulegraph +show license +homepage +
+
License
+=======
+
+Copyright (c) Bob Ippolito
+
+Parts are copyright (c) 2010-2014 Ronald Oussoren
+
+MIT 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.
+
+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.
+
+
+
+
+ +
+mox3 +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+mt19937ar +show license +homepage +
+
   A C-program for MT19937, with initialization improved 2002/1/26.
+   Coded by Takuji Nishimura and Makoto Matsumoto.
+
+   Before using, initialize the state by using init_genrand(seed)  
+   or init_by_array(init_key, key_length).
+
+   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+   All rights reserved.                          
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+     1. Redistributions of source code must retain the above copyright
+        notice, this list of conditions and the following disclaimer.
+
+     2. 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.
+
+     3. The names of its contributors may not be used to endorse or promote 
+        products derived from this software without specific prior written 
+        permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+native client +show license +homepage +
+
Copyright 2008, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+newlib-extras +show license +homepage +
+
                        README for newlib-2.0.0 release
+           (mostly cribbed from the README in the gdb-4.13 release)
+
+This is `newlib', a simple ANSI C library, math library, and collection
+of board support packages.
+
+The newlib and libgloss subdirectories are a collection of software from
+several sources, each wi6h their own copyright and license.  See the file
+COPYING.NEWLIB for details.  The rest of the release tree is under either
+the GNU GPL or LGPL licenses.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+
+Unpacking and Installation -- quick overview
+==========================
+
+When you unpack the newlib-2.0.0.tar.gz file, you'll find a directory
+called `newlib-2.0.0', which contains:
+
+COPYING          config/          install-sh*      mpw-configure
+COPYING.LIB      config-ml.in     libgloss/        mpw-install
+COPYING.NEWLIB   config.guess*    mkinstalldirs*   newlib/
+CYGNUS           config.sub*      move-if-change*  symlink-tree*
+ChangeLog        configure*       mpw-README       texinfo/
+Makefile.in      configure.in     mpw-build.in
+README           etc/             mpw-config.in
+
+To build NEWLIB, you must follow the instructions in the section entitled
+"Compiling NEWLIB".
+
+This will configure and build all the libraries and crt0 (if one exists).
+If `configure' can't determine your host system type, specify one as its
+argument, e.g., sun4 or sun4sol2.  NEWLIB is most often used in cross
+environments.
+
+NOTE THAT YOU MUST HAVE ALREADY BUILT AND INSTALLED GCC and BINUTILS.
+
+
+More Documentation
+==================
+
+   Newlib documentation is available on the net via:
+   http://sourceware.org/newlib/docs.html
+
+   All the documentation for NEWLIB comes as part of the machine-readable
+distribution.  The documentation is written in Texinfo format, which is
+a documentation system that uses a single source file to produce both
+on-line information and a printed manual.  You can use one of the Info
+formatting commands to create the on-line version of the documentation
+and TeX (or `texi2roff') to typeset the printed version.
+
+   If you want to format these Info files yourself, you need one of the
+Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'.
+
+   If you want to typeset and print copies of this manual, you need TeX,
+a program to print its DVI output files, and `texinfo.tex', the Texinfo
+definitions file.
+
+   TeX is a typesetting program; it does not print files directly, but
+produces output files called DVI files.  To print a typeset document,
+you need a program to print DVI files.  If your system has TeX
+installed, chances are it has such a program.  The precise command to
+use depends on your system; `lpr -d' is common; another (for PostScript
+devices) is `dvips'.  The DVI print command may require a file name
+without any extension or a `.dvi' extension.
+
+   TeX also requires a macro definitions file called `texinfo.tex'. 
+This file tells TeX how to typeset a document written in Texinfo
+format.  On its own, TeX cannot read, much less typeset a Texinfo file.
+`texinfo.tex' is distributed with NEWLIB and is located in the
+`newlib-VERSION-NUMBER/texinfo' directory.
+
+
+
+Compiling NEWLIB
+================
+
+   To compile NEWLIB, you must build it in a directory separate from
+the source directory.  If you want to run NEWLIB versions for several host 
+or target machines, you need a different `newlib' compiled for each combination
+of host and target.  `configure' is designed to make this easy by allowing 
+you to generate each configuration in a separate subdirectory.
+If your `make' program handles the `VPATH' feature correctly (like GNU `make')
+running `make' in each of these directories builds the `newlib' libraries
+specified there.
+
+   To build `newlib' in a specific directory, run `configure' with the
+`--srcdir' option to specify where to find the source. (You also need
+to specify a path to find `configure' itself from your working
+directory.  If the path to `configure' would be the same as the
+argument to `--srcdir', you can leave out the `--srcdir' option; it
+will be assumed.)
+
+   For example, with version 2.0.0, you can build NEWLIB in a separate
+directory for a Sun 4 cross m68k-aout environment like this:
+
+     cd newlib-2.0.0
+     mkdir ../newlib-m68k-aout
+     cd ../newlib-m68k-aout
+     ../newlib-2.0.0/configure --host=sun4 --target=m68k-aout
+     make
+
+   When `configure' builds a configuration using a remote source
+directory, it creates a tree for the binaries with the same structure
+(and using the same names) as the tree under the source directory.  In
+the example, you'd find the Sun 4 library `libiberty.a' in the
+directory `newlib-m68k-aout/libiberty', and NEWLIB itself in
+`newlib-m68k-aout/newlib'.
+
+   When you run `make' to build a program or library, you must run it
+in a configured directory--whatever directory you were in when you
+called `configure' (or one of its subdirectories).
+
+   The `Makefile' that `configure' generates in each source directory
+also runs recursively.  If you type `make' in a source directory such
+as `newlib-2.0.0' (or in a separate configured directory configured with
+`--srcdir=PATH/newlib-2.0.0'), you will build all the required libraries.
+
+   When you have multiple hosts or targets configured in separate
+directories, you can run `make' on them in parallel (for example, if
+they are NFS-mounted on each of the hosts); they will not interfere
+with each other.
+
+
+Specifying names for hosts and targets
+======================================
+
+   The specifications used for hosts and targets in the `configure'
+script are based on a three-part naming scheme, but some short
+predefined aliases are also supported.  The full naming scheme encodes
+three pieces of information in the following pattern:
+
+     ARCHITECTURE-VENDOR-OS
+
+   For example, you can use the alias `sun4' as a HOST argument or in a
+`--target=TARGET' option.  The equivalent full name is
+`sparc-sun-sunos4'.
+
+   The `configure' script accompanying NEWLIB does not provide any query
+facility to list all supported host and target names or aliases. 
+`configure' calls the Bourne shell script `config.sub' to map
+abbreviations to full names; you can read the script, if you wish, or
+you can use it to test your guesses on abbreviations--for example:
+
+     % sh config.sub sun4
+     sparc-sun-sunos4.1.1
+     % sh config.sub sun3
+     m68k-sun-sunos4.1.1
+     % sh config.sub decstation
+     mips-dec-ultrix4.2
+     % sh config.sub hp300bsd
+     m68k-hp-bsd
+     % sh config.sub i386v
+     i386-pc-sysv
+     % sh config.sub i786v
+     Invalid configuration `i786v': machine `i786v' not recognized
+
+The Build, Host and Target Concepts in newlib
+=============================================
+
+The build, host and target concepts are defined for gcc as follows:
+
+build: the platform on which gcc is built.
+host: the platform on which gcc is run.
+target: the platform for which gcc generates code.
+
+Since newlib is a library, the target concept does not apply to it, and the
+build, host, and target options given to the top-level configure script must
+be changed for newlib's use.
+
+The options are shifted according to these correspondences:
+
+gcc's build platform has no equivalent in newlib.
+gcc's host platform is newlib's build platform.
+gcc's target platform is newlib's host platform.
+and as mentioned before, newlib has no concept of target.
+
+`configure' options
+===================
+
+   Here is a summary of the `configure' options and arguments that are
+most often useful for building NEWLIB.  `configure' also has several other
+options not listed here.
+
+     configure [--help]
+               [--prefix=DIR]
+               [--srcdir=PATH]
+               [--target=TARGET] HOST
+
+You may introduce options with a single `-' rather than `--' if you
+prefer; but you may abbreviate option names if you use `--'.
+
+`--help'
+     Display a quick summary of how to invoke `configure'.
+
+`--prefix=DIR'
+     Configure the source to install programs and files in directory
+     `DIR'.
+
+`--exec-prefix=DIR'
+     Configure the source to install host-dependent files in directory
+     `DIR'.
+
+`--srcdir=PATH'
+     *Warning: using this option requires GNU `make', or another `make'
+     that compatibly implements the `VPATH' feature.
+     Use this option to make configurations in directories separate
+     from the NEWLIB source directories.  Among other things, you can use
+     this to build (or maintain) several configurations simultaneously,
+     in separate directories.  `configure' writes configuration
+     specific files in the current directory, but arranges for them to
+     use the source in the directory PATH.  `configure' will create
+     directories under the working directory in parallel to the source
+     directories below PATH.
+
+`--norecursion'
+     Configure only the directory level where `configure' is executed;
+     do not propagate configuration to subdirectories.
+
+`--target=TARGET'
+     Configure NEWLIB for running on the specified TARGET.
+
+     There is no convenient way to generate a list of all available
+     targets.
+
+`HOST ...'
+     Configure NEWLIB to be built using a cross compiler running on
+     the specified HOST.
+
+     There is no convenient way to generate a list of all available
+     hosts.
+
+To fit diverse usage models, NEWLIB supports a group of configuration
+options so that library features can be turned on/off according to
+target system's requirements.
+
+One feature can be enabled by specifying `--enable-FEATURE=yes' or
+`--enable-FEATURE'.  Or it can be disable by `--enable-FEATURE=no' or
+`--disable-FEATURE'.
+
+`--enable-newlib-io-pos-args'
+     Enable printf-family positional arg support.
+     Disabled by default, but some hosts enable it in configure.host.
+
+`--enable-newlib-io-c99-formats'
+     Enable C99 support in IO functions like printf/scanf.
+     Disabled by default, but some hosts enable it in configure.host.
+
+`--enable-newlib-register-fini'
+     Enable finalization function registration using atexit.
+     Disabled by default.
+
+`--enable-newlib-io-long-long'
+     Enable long long type support in IO functions like printf/scanf.
+     Disabled by default, but many hosts enable it in configure.host.
+
+`--enable-newlib-io-long-double'
+     Enable long double type support in IO functions printf/scanf.
+     Disabled by default, but some hosts enable it in configure.host.
+
+`--enable-newlib-mb'
+     Enable multibyte support.
+     Disabled by default.
+
+`--enable-newlib-iconv-encodings'
+     Enable specific comma-separated list of bidirectional iconv
+     encodings to be built-in.
+     Disabled by default.
+
+`--enable-newlib-iconv-from-encodings'
+     Enable specific comma-separated list of \"from\" iconv encodings
+     to be built-in.
+     Disabled by default.
+
+`--enable-newlib-iconv-to-encodings'
+     Enable specific comma-separated list of \"to\" iconv encodings
+     to be built-in.
+     Disabled by default.
+
+`--enable-newlib-iconv-external-ccs'
+     Enable capabilities to load external CCS files for iconv.
+     Disabled by default.
+
+`--disable-newlib-atexit-dynamic-alloc'
+     Disable dynamic allocation of atexit entries.
+     Most hosts and targets have it enabled in configure.host.
+
+`--enable-newlib-reent-small'
+     Enable small reentrant struct support.
+     Disabled by default.
+
+`--disable-newlib-fvwrite-in-streamio'
+     NEWLIB implements the vector buffer mechanism to support stream IO
+     buffering required by C standard.  This feature is possibly
+     unnecessary for embedded systems which won't change file buffering
+     with functions like `setbuf' or `setvbuf'.  The buffering mechanism
+     still acts as default for STDIN/STDOUT/STDERR even if this option
+     is specified.
+     Enabled by default.
+
+`--disable-newlib-fseek-optimization'
+     Disable fseek optimization.  It can decrease code size of application
+     calling `fseek`.
+     Enabled by default.
+
+`--disable-newlib-wide-orient'
+     C99 states that each stream has an orientation, wide or byte.  This
+     feature is possibly unnecessary for embedded systems which only do
+     byte input/output operations on stream.  It can decrease code size
+     by disable the feature.
+     Enabled by default.
+
+`--enable-newlib-nano-malloc'
+     NEWLIB has two implementations of malloc family's functions, one in
+     `mallocr.c' and the other one in `nano-mallocr.c'.  This options
+     enables the nano-malloc implementation, which is for small systems
+     with very limited memory.  Note that this implementation does not
+     support `--enable-malloc-debugging' any more.
+     Disabled by default.
+
+`--disable-newlib-unbuf-stream-opt'
+     NEWLIB does optimization when `fprintf to write only unbuffered unix
+     file'.  It creates a temorary buffer to do the optimization that
+     increases stack consumption by about `BUFSIZ' bytes.  This option
+     disables the optimization and saves size of text and stack.
+     Enabled by default.
+
+`--enable-multilib'
+     Build many library versions.
+     Enabled by default.
+
+`--enable-target-optspace'
+     Optimize for space.
+     Disabled by default.
+
+`--enable-malloc-debugging'
+     Indicate malloc debugging requested.
+     Disabled by default.
+
+`--enable-newlib-multithread'
+     Enable support for multiple threads.
+     Enabled by default.
+
+`--enable-newlib-iconv'
+     Enable iconv library support.
+     Disabled by default.
+
+`--enable-newlib-elix-level'
+     Supply desired elix library level (1-4).  Please refer to HOWTO for
+     more information about this option.
+     Set to level 0 by default.
+
+`--disable-newlib-io-float'
+     Disable printf/scanf family float support.
+     Enabled by default.
+
+`--disable-newlib-supplied-syscalls'
+     Disable newlib from supplying syscalls.
+     Enabled by default.
+
+`--enable-lite-exit'
+     Enable lite exit, a size-reduced implementation of exit that doesn't
+     invoke clean-up functions such as _fini or global destructors.
+     Disabled by default.
+
+Running the Testsuite
+=====================
+
+To run newlib's testsuite, you'll need a site.exp in your home
+directory which points dejagnu to the proper baseboards directory and
+the proper exp file for your target.
+
+Before running make check-target-newlib, set the DEJAGNU environment
+variable to point to ~/site.exp.
+
+Here is a sample site.exp:
+
+# Make sure we look in the right place for the board description files.
+if ![info exists boards_dir] {
+    set boards_dir {}
+}
+lappend boards_dir "your dejagnu/baseboards here"
+
+verbose "Global Config File: target_triplet is $target_triplet" 2
+
+global target_list
+case "$target_triplet" in {
+
+    { "mips-*elf*" } {
+	set target_list "mips-sim"
+    }
+
+    default {
+	set target_list { "unix" }
+    }
+}
+
+mips-sim refers to an exp file in the baseboards directory.  You'll
+need to add the other targets you're testing to the case statement.
+
+Now type make check-target-newlib in the top-level build directory to
+run the testsuite.
+
+Shared newlib
+=============
+
+newlib uses libtool when it is being compiled natively (with
+--target=i[34567]86-pc-linux-gnu) on an i[34567]86-pc-linux-gnu
+host. This allows newlib to be compiled as a shared library.
+
+To configure newlib, do the following from your build directory:
+
+$(source_dir)/src/configure --with-newlib --prefix=$(install_dir)
+
+configure will recognize that host == target ==
+i[34567]86-pc-linux-gnu, so it will tell newlib to compile itself using
+libtool. By default, libtool will build shared and static versions of
+newlib.
+
+To compile a program against shared newlib, do the following (where
+target_install_dir = $(install_dir)/i[34567]86-pc-linux-gnu):
+
+gcc -nostdlib $(target_install_dir)/lib/crt0.o progname.c -I $(target_install_dir)/include -L $(target_install_dir)/lib -lc -lm -lgcc
+
+To run the program, make sure that $(target_install_dir)/lib is listed
+in the LD_LIBRARY_PATH environment variable.
+
+To create a static binary linked against newlib, do the following:
+
+gcc -nostdlib -static $(target_install_dir)/lib/crt0.o progname.c -I $(target_install_dir)/include -L $(target_install_dir)/lib -lc -lm
+
+libtool can be instructed to produce only static libraries. To build
+newlib as a static library only, do the following from your build
+directory:
+
+$(source_dir)/src/configure --with-newlib --prefix=$(install_dir) --disable-shared
+
+Regenerating Configuration Files
+================================
+
+At times you will need to make changes to configure.in and Makefile.am files.
+This will mean that configure and Makefile.in files will need to be
+regenerated.
+
+At the top level of newlib is the file: acinclude.m4.  This file contains
+the definition of the NEWLIB_CONFIGURE macro which is used by all configure.in
+files in newlib.  You will notice that each directory in newlib containing
+a configure.in file also contains an aclocal.m4 file.  This file is
+generated by issuing: aclocal -I${relative_path_to_toplevel_newlib_dir}
+-I${relative_path_to_toplevel_src_dir}
+The first relative directory is to access acinclude.m4.  The second relative
+directory is to access libtool information in the top-level src directory.
+
+For example, to regenerate aclocal.m4 in newlib/libc/machine/arm:
+
+  aclocal -I ../../.. -I ../../../..
+
+Note that if the top level acinclude.m4 is altered, every aclocal.m4 file 
+in newlib should be regenerated.
+
+If the aclocal.m4 file is regenerated due to a change in acinclude.m4 or
+if a configure.in file is modified, the corresponding configure file in the 
+directory must be regenerated using autoconf.  No parameters are necessary.
+In the previous example, we would issue:
+
+  autoconf
+
+from the newlib/libc/machine/arm directory.
+
+If you have regenerated a configure file or if you have modified a Makefile.am
+file, you will need to regenerate the appropriate Makefile.in file(s).
+For newlib, automake is a bit trickier.  First of all, all Makefile.in
+files in newlib (and libgloss) are generated using the --cygnus option
+of automake.  
+
+Makefile.in files are generated from the nearest directory up the chain
+which contains a configure.in file.  In most cases, this is the same
+directory containing configure.in, but there are exceptions.
+For example, the newlib/libc directory has a number of
+subdirectories that do not contain their own configure.in files (e.g. stdio).
+For these directories, you must issue the automake command from newlib/libc
+which is the nearest parent directory that contains a configure.in.
+When you issue the automake command, you specify the subdirectory for
+the Makefile.in you are regenerating.  For example:
+
+   automake --cygnus stdio/Makefile stdlib/Makefile
+
+Note how multiple Makefile.in files can be created in the same step.  You
+would not specify machine/Makefile or sys/Makefile in the previous example
+because both of these subdirectories contain their own configure.in files.
+One would change to each of these subdirectories and in turn issue:
+
+   automake --cygnus Makefile
+
+Let's say you create a new machine directory XXXX off of newlib/libc/machine.
+After creating a new configure.in and Makefile.am file, you would issue:
+
+   aclocal -I ../../..
+   autoconf
+   automake --cygnus Makefile
+
+from newlib/libc/machine/XXXX
+
+It is strongly advised that you use an adequate version of autotools.
+For this latest release, the following were used: autoconf 2.68, aclocal 1.11.6, and 
+automake 1.11.6.
+
+Reporting Bugs
+==============
+
+The correct address for reporting bugs found in NEWLIB is
+"newlib@sourceware.org".  Please email all bug reports to that
+address.  Please include the NEWLIB version number (e.g., newlib-2.0.0),
+and how you configured it (e.g., "sun4 host and m68k-aout target").
+Since NEWLIB supports many different configurations, it is important
+that you be precise about this.
+
+Archives of the newlib mailing list are on-line, see
+	http://sourceware.org/ml/newlib/
+
+
+
+ +
+ocmock +show license +homepage +
+
  
+  Copyright (c) 2004-2012 by Mulle Kybernetik. All rights reserved.
+
+  Permission to use, copy, modify and distribute this software and its documentation
+  is hereby granted, provided that both the copyright notice and this permission
+  notice appear in all copies of the software, derivative works or modified versions,
+  and any portions thereof, and that both notices appear in supporting documentation,
+  and that credit is given to Mulle Kybernetik in all documents and publicity
+  pertaining to direct or indirect use of this code or its derivatives.
+
+  THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE
+  SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS
+  "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY
+  DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE
+  OR OF ANY DERIVATIVE WORK.
+
+
+ +
+open-vcdiff +show license +homepage +
+
+                                 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 2008 The open-vcdiff Authors. All Rights Reserved.
+
+   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.
+
+
+
+ +
+opus +show license +homepage +
+
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
+                    Jean-Marc Valin, Timothy B. Terriberry,
+                    CSIRO, Gregory Maxwell, Mark Borgerding,
+                    Erik de Castro Lopo
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+- 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.
+
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
+names of specific contributors, may be used to endorse or promote
+products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Opus is subject to the royalty-free patent licenses which are
+specified at:
+
+Xiph.Org Foundation:
+https://datatracker.ietf.org/ipr/1524/
+
+Microsoft Corporation:
+https://datatracker.ietf.org/ipr/1914/
+
+Broadcom Corporation:
+https://datatracker.ietf.org/ipr/1526/
+
+
+
+ +
+pdfsqueeze +show license +homepage +
+
+                                 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 2007 Google Inc.
+
+   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.
+
+
+ +
+powergadget_lib +show license +homepage +
+
Copyright (c) 2014, Intel Corporation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of Intel Corporation nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ +
+pthreads-win32 +show license +homepage +
+
	pthreads-win32 - a POSIX threads library for Microsoft Windows
+
+
+This file is Copyrighted
+------------------------
+
+    This file is covered under the following Copyright:
+
+	Copyright (C) 2001,2006 Ross P. Johnson
+	All rights reserved.
+
+	Everyone is permitted to copy and distribute verbatim copies
+	of this license document, but changing it is not allowed.
+
+Pthreads-win32 is covered by the GNU Lesser General Public License
+------------------------------------------------------------------
+
+    Pthreads-win32 is open software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public License
+    as published by the Free Software Foundation version 2.1 of the
+    License.
+
+    Pthreads-win32 is several binary link libraries, several modules,
+    associated interface definition files and scripts used to control
+    its compilation and installation.
+
+    Pthreads-win32 is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    A copy of the GNU Lesser General Public License is distributed with
+    pthreads-win32 under the filename:
+
+	    COPYING.LIB
+
+    You should have received a copy of the version 2.1 GNU Lesser General
+    Public License with pthreads-win32; if not, write to:
+
+	    Free Software Foundation, Inc.
+	    59 Temple Place
+	    Suite 330
+	    Boston, MA	02111-1307
+	    USA
+
+    The contact addresses for pthreads-win32 is as follows:
+
+        Web:	http://sources.redhat.com/pthreads-win32
+        Email:  Ross Johnson
+                Please use: Firstname.Lastname@homemail.com.au
+
+
+
+Pthreads-win32 copyrights and exception files
+---------------------------------------------
+
+    With the exception of the files listed below, Pthreads-win32
+    is covered under the following GNU Lesser General Public License
+    Copyrights:
+
+	Pthreads-win32 - POSIX Threads Library for Win32
+	Copyright(C) 1998 John E. Bossom
+	Copyright(C) 1999,2006 Pthreads-win32 contributors
+
+	The current list of contributors is contained
+        in the file CONTRIBUTORS included with the source
+	code distribution. The current list of CONTRIBUTORS
+	can also be seen at the following WWW location:
+        http://sources.redhat.com/pthreads-win32/contributors.html
+
+    Contact Email: Ross Johnson
+                   Please use: Firstname.Lastname@homemail.com.au
+
+    These files are not covered under one of the Copyrights listed above:
+
+            COPYING
+	    COPYING.LIB
+            tests/rwlock7.c
+
+    This file, COPYING, is distributed under the Copyright found at the
+    top of this file.  It is important to note that you may distribute
+    verbatim copies of this file but you may not modify this file.
+
+    The file COPYING.LIB, which contains a copy of the version 2.1
+    GNU Lesser General Public License, is itself copyrighted by the
+    Free Software Foundation, Inc.  Please note that the Free Software
+    Foundation, Inc. does NOT have a copyright over Pthreads-win32,
+    only the COPYING.LIB that is supplied with pthreads-win32.
+
+    The file tests/rwlock7.c is derived from code written by
+    Dave Butenhof for his book 'Programming With POSIX(R) Threads'.
+    The original code was obtained by free download from his website
+    http://home.earthlink.net/~anneart/family/Threads/source.html
+    and did not contain a copyright or author notice. It is assumed to
+    be freely distributable.
+
+    In all cases one may use and distribute these exception files freely.
+    And because one may freely distribute the LGPL covered files, the
+    entire pthreads-win32 source may be freely used and distributed.
+
+
+
+General Copyleft and License info
+---------------------------------
+
+    For general information on Copylefts, see:
+
+	http://www.gnu.org/copyleft/
+
+    For information on GNU Lesser General Public Licenses, see:
+
+	http://www.gnu.org/copyleft/lesser.html
+	http://www.gnu.org/copyleft/lesser.txt
+
+
+Why pthreads-win32 did not use the GNU General Public License
+-------------------------------------------------------------
+
+    The goal of the pthreads-win32 project has been to
+    provide a quality and complete implementation of the POSIX
+    threads API for Microsoft Windows within the limits imposed
+    by virtue of it being a stand-alone library and not
+    linked directly to other POSIX compliant libraries. For
+    example, some functions and features, such as those based
+    on POSIX signals, are missing.
+
+    Pthreads-win32 is a library, available in several different
+    versions depending on supported compilers, and may be used
+    as a dynamically linked module or a statically linked set of
+    binary modules. It is not an application on it's own.
+
+    It was fully intended that pthreads-win32 be usable with
+    commercial software not covered by either the GPL or the LGPL
+    licenses. Pthreads-win32 has many contributors to it's
+    code base, many of whom have done so because they have
+    used the library in commercial or proprietry software
+    projects.
+
+    Releasing pthreads-win32 under the LGPL ensures that the
+    library can be used widely, while at the same time ensures
+    that bug fixes and improvements to the pthreads-win32 code
+    itself is returned to benefit all current and future users
+    of the library.
+
+    Although pthreads-win32 makes it possible for applications
+    that use POSIX threads to be ported to Win32 platforms, the
+    broader goal of the project is to encourage the use of open
+    standards, and in particular, to make it just a little easier
+    for developers writing Win32 applications to consider
+    widening the potential market for their products.
+
+
+
+ +
+pySerial +show license +homepage +
+
Copyright (c) 2001-2013 Chris Liechti <cliechti@gmx.net>;
+All Rights Reserved.
+
+This is the Python license. In short, you can use this product in
+commercial and non-commercial applications, modify it, redistribute it.
+A notification to the author when you use and/or modify it is welcome.
+
+
+TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING THIS SOFTWARE
+===================================================================
+
+LICENSE AGREEMENT
+-----------------
+
+1. This LICENSE AGREEMENT is between the copyright holder of this
+product, and the Individual or Organization ("Licensee") accessing
+and otherwise using this product in source or binary form and its
+associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement,
+the copyright holder hereby grants Licensee a nonexclusive,
+royalty-free, world-wide license to reproduce, analyze, test,
+perform and/or display publicly, prepare derivative works, distribute,
+and otherwise use this product alone or in any derivative version,
+provided, however, that copyright holders License Agreement and
+copyright holders notice of copyright are retained in this product
+alone or in any derivative version prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates this product or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to this product.
+
+4. The copyright holder is making this product available to Licensee on
+an "AS IS" basis. THE COPYRIGHT HOLDER MAKES NO REPRESENTATIONS OR
+WARRANTIES, EXPRESS OR IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION,
+THE COPYRIGHT HOLDER MAKES NO AND DISCLAIMS ANY REPRESENTATION OR
+WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR
+THAT THE USE OF THIS PRODUCT WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. THE COPYRIGHT HOLDER SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER
+USERS OF THIS PRODUCT FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL
+DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE
+USING THIS PRODUCT, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE
+POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between the
+copyright holder and Licensee. This License Agreement does not grant
+permission to use trademarks or trade names from the copyright holder
+in a trademark sense to endorse or promote products or services of
+Licensee, or any third party.
+
+8. By copying, installing or otherwise using this product, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+
+
+
+ +
+py_trace_event +show license +homepage +
+
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ +
+pyelftools +show license +homepage +
+
pyelftools is in the public domain (see below if you need more details).
+
+pyelftools uses the construct library for structured parsing of a binary
+stream. construct is packaged in pyelftools/construct - see its LICENSE
+file for the license.
+
+-------------------------------------------------------------------------------
+
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+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 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.
+
+For more information, please refer to <http://unlicense.org/>
+
+
+
+
+ +
+pyfakefs +show license +homepage +
+
+                                 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.
+
+
+
+ +
+re2 - an efficient, principled regular expression library +show license +homepage +
+
// Copyright (c) 2009 The RE2 Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * 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.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+readability +show license +homepage +
+
Copyright 2010 Arc90 Inc
+
+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.
+
+
+
+ +
+sfntly +show license +homepage +
+
+                                 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 2011 Google Inc. All Rights Reserved.
+
+   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.
+
+
+
+
+ +
+simplejson +show license +homepage +
+
Copyright (c) 2006 Bob Ippolito
+
+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.
+
+
+
+ +
+sqlite +show license +homepage +
+
The author disclaims copyright to this source code.  In place of
+a legal notice, here is a blessing:
+
+   May you do good and not evil.
+   May you find forgiveness for yourself and forgive others.
+   May you share freely, never taking more than you give.
+
+
+
+ +
+talloc +show license +homepage +
+
   Unix SMB/CIFS implementation.
+   Samba temporary memory allocation functions
+
+   Copyright (C) Andrew Tridgell 2004-2005
+   Copyright (C) Stefan Metzmacher 2006
+   
+     ** NOTE! The following LGPL license applies to the talloc
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+
+
+ +
+tcmalloc +show license +homepage +
+
// Copyright (c) 2005, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * 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.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+tlslite +show license +homepage +
+
+TLS Lite includes code from different sources. All code is either dedicated to
+the public domain by its authors, or available under a BSD-style license. In
+particular:
+
+- 
+
+Code written by Trevor Perrin, Kees Bos, Sam Rushing, Dimitris Moraitis,
+Marcelo Fernandez, Martin von Loewis, Dave Baggett, and Yngve Pettersen is 
+available under the following terms:
+
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute
+this software, either in source code form or as a compiled binary, for any
+purpose, commercial or non-commercial, and by any means.
+
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
+this software under copyright law.
+
+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 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.
+
+-
+
+Code written by Bram Cohen (rijndael.py) was dedicated to the public domain by
+its author. See rijndael.py for details.
+
+-
+
+Code written by Google is available under the following terms:
+
+Copyright (c) 2008, The Chromium Authors 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+ * 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.
+
+ * Neither the name of the Google Inc. nor the names of its contributors may
+   be used to endorse or promote products derived from this software without
+   specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+url_parse +show license +homepage +
+
Copyright 2007, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-------------------------------------------------------------------------------
+
+The file url_parse.cc is based on nsURLParsers.cc from Mozilla. This file is
+licensed separately as follows:
+
+The contents of this file are subject to the Mozilla Public License Version
+1.1 (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.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is mozilla.org code.
+
+The Initial Developer of the Original Code is
+Netscape Communications Corporation.
+Portions created by the Initial Developer are Copyright (C) 1998
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+  Darin Fisher (original author)
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+
+
+ +
+usrsctp +show license +homepage +
+
(Copied from the COPYRIGHT file of
+https://code.google.com/p/sctp-refimpl/source/browse/trunk/COPYRIGHT)
+--------------------------------------------------------------------------------
+
+Copyright (c) 2001, 2002 Cisco Systems, Inc.
+Copyright (c) 2002-12 Randall R. Stewart
+Copyright (c) 2002-12 Michael Tuexen
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. 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.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+
+
+ +
+v4l-utils +show license +homepage +
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+^L
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard.  To achieve this, non-free programs must
+be allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+^L
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+compilation and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+^L
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+^L
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at least
+    three years, to give the same user the materials specified in
+    Subsection 6a, above, for a charge no more than the cost of
+    performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+^L
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+^L
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License
+may add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+^L
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+^L
+	   How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms
+of the ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.
+It is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should
+have at least the "copyright" line and a pointer to where the full
+notice is found.
+
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the library,
+if necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James
+  Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+
+ +
+valgrind +show license +homepage +
+
   Notice that the following BSD-style license applies to the Valgrind header
+   files used by Chromium (valgrind.h and memcheck.h). However, the rest of
+   Valgrind is licensed under the terms of the GNU General Public License,
+   version 2, unless otherwise indicated.
+
+   ----------------------------------------------------------------
+
+   Copyright (C) 2000-2008 Julian Seward.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. The origin of this software must not be misrepresented; you must 
+      not claim that you wrote the original software.  If you use this 
+      software in a product, an acknowledgment in the product 
+      documentation would be appreciated but is not required.
+
+   3. Altered source versions must be plainly marked as such, and must
+      not be misrepresented as being the original software.
+
+   4. The name of the author may not be used to endorse or promote 
+      products derived from this software without specific prior written 
+      permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ +
+webtreemap +show license +homepage +
+
+                                 Apache License
+                           Version 2.0, January 2010
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+woff2 +show license +homepage +
+
+                                 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 [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+ +
+x86inc +show license +homepage +
+
;*****************************************************************************
+;* x86inc.asm
+;*****************************************************************************
+;* Copyright (C) 2005-2011 x264 project
+;*
+;* Authors: Loren Merritt <lorenm@u.washington.edu>
+;*          Anton Mitrofanov <BugMaster@narod.ru>
+;*          Jason Garrett-Glaser <darkshikari@gmail.com>
+;*
+;* Permission to use, copy, modify, and/or distribute this software for any
+;* purpose with or without fee is hereby granted, provided that the above
+;* copyright notice and this permission notice appear in all copies.
+;*
+;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+;*****************************************************************************
+
+; This is a header file for the x264ASM assembly language, which uses
+; NASM/YASM syntax combined with a large number of macros to provide easy
+; abstraction between different calling conventions (x86_32, win64, linux64).
+; It also has various other useful features to simplify writing the kind of
+; DSP functions that are most often used in x264.
+
+; Unlike the rest of x264, this file is available under an ISC license, as it
+; has significant usefulness outside of x264 and we want it to be available
+; to the largest audience possible.  Of course, if you modify it for your own
+; purposes to add a new feature, we strongly encourage contributing a patch
+; as this feature might be useful for others as well.  Send patches or ideas
+; to x264-devel@videolan.org .
+
+
+
+ +
+xdg-mime +show license +homepage +
+
Licensed under the Academic Free License version 2.0 (below)
+Or under the following terms:
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+
+--------------------------------------------------------------------------------
+Academic Free License v. 2.0
+--------------------------------------------------------------------------------
+
+This Academic Free License (the "License") applies to any original work of
+authorship (the "Original Work") whose owner (the "Licensor") has placed the
+following notice immediately following the copyright notice for the Original
+Work:
+
+Licensed under the Academic Free License version 2.0
+1) Grant of Copyright License. Licensor hereby grants You a world-wide,
+royalty-free, non-exclusive, perpetual, sublicenseable license to do the
+following:
+
+a) to reproduce the Original Work in copies;
+b) to prepare derivative works ("Derivative Works") based upon the Original
+   Work;
+c) to distribute copies of the Original Work and Derivative Works to the
+   public;
+d) to perform the Original Work publicly; and
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide,
+royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
+claims owned or controlled by the Licensor that are embodied in the Original
+Work as furnished by the Licensor, to make, use, sell and offer for sale the
+Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred
+form of the Original Work for making modifications to it and all available
+documentation describing how to modify the Original Work. Licensor hereby
+agrees to provide a machine-readable copy of the Source Code of the Original
+Work along with each copy of the Original Work that Licensor distributes.
+Licensor reserves the right to satisfy this obligation by placing a
+machine-readable copy of the Source Code in an information repository
+reasonably calculated to permit inexpensive and convenient access by You for as
+long as Licensor continues to distribute the Original Work, and by publishing
+the address of that information repository in a notice immediately following
+the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names
+of any contributors to the Original Work, nor any of their trademarks or
+service marks, may be used to endorse or promote products derived from this
+Original Work without express prior written permission of the Licensor. Nothing
+in this License shall be deemed to grant any rights to trademarks, copyrights,
+patents, trade secrets or any other intellectual property of Licensor except as
+expressly stated herein. No patent license is granted to make, use, sell or
+offer to sell embodiments of any patent claims other than the licensed claims
+defined in Section 2. No right is granted to the trademarks of Licensor even if
+such marks are included in the Original Work. Nothing in this License shall be
+interpreted to prohibit Licensor from licensing under different terms from this
+License any Original Work that Licensor otherwise would have a right to
+license.
+
+5) This section intentionally omitted.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative
+Works that You create, all copyright, patent or trademark notices from the
+Source Code of the Original Work, as well as any notices of licensing and any
+descriptive text identified therein as an "Attribution Notice." You must cause
+the Source Code for any Derivative Works that You create to carry a prominent
+Attribution Notice reasonably calculated to inform recipients that You have
+modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
+the copyright in and to the Original Work and the patent rights granted herein
+by Licensor are owned by the Licensor or are sublicensed to You under the terms
+of this License with the permission of the contributor(s) of those copyrights
+and patent rights. Except as expressly stated in the immediately proceeding
+sentence, the Original Work is provided under this License on an "AS IS" BASIS
+and WITHOUT WARRANTY, either express or implied, including, without limitation,
+the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
+This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
+license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, shall the
+Licensor be liable to any person for any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License
+or the use of the Original Work including, without limitation, damages for loss
+of goodwill, work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses. This limitation of liability shall not
+apply to liability for death or personal injury resulting from Licensor's
+negligence to the extent applicable law prohibits such limitation. Some
+jurisdictions do not allow the exclusion or limitation of incidental or
+consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or
+a Derivative Work, You must make a reasonable effort under the circumstances to
+obtain the express assent of recipients to the terms of this License. Nothing
+else but this License (or another written agreement between Licensor and You)
+grants You permission to create Derivative Works based upon the Original Work
+or to exercise any of the rights granted in Section 1 herein, and any attempt
+to do so except under the terms of this License (or another written agreement
+between Licensor and You) is expressly prohibited by U.S. copyright law, the
+equivalent laws of other countries, and by international treaty. Therefore, by
+exercising any of the rights granted to You in Section 1 herein, You indicate
+Your acceptance of this License and all of its terms and conditions.
+
+10) Termination for Patent Action. This License shall terminate automatically
+and You may no longer exercise any of the rights granted to You by this License
+as of the date You commence an action, including a cross-claim or counterclaim,
+for patent infringement (i) against Licensor with respect to a patent
+applicable to software or (ii) against any entity with respect to a patent
+applicable to the Original Work (but excluding combinations of the Original
+Work with other software or hardware).
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
+License may be brought only in the courts of a jurisdiction wherein the
+Licensor resides or in which Licensor conducts its primary business, and under
+the laws of that jurisdiction excluding its conflict-of-law provisions. The
+application of the United Nations Convention on Contracts for the International
+Sale of Goods is expressly excluded. Any use of the Original Work outside the
+scope of this License or after its termination shall be subject to the
+requirements and penalties of the U.S. Copyright Act, 17 U.S.C. 101 et seq.,
+the equivalent laws of other countries, and international treaty. This section
+shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or
+seeking damages relating thereto, the prevailing party shall be entitled to
+recover its costs and expenses, including, without limitation, reasonable
+attorneys' fees and costs incurred in connection with such action, including
+any appeal of such action. This section shall survive the termination of this
+License.
+
+13) Miscellaneous. This License represents the complete agreement concerning
+the subject matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent necessary to
+make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether
+in upper or lower case, means an individual or a legal entity exercising rights
+under, and complying with all of the terms of, this License. For legal
+entities, "You" includes any entity that controls, is controlled by, or is
+under common control with you. For 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.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise
+restricted or conditioned by this License or by law, and Licensor promises not
+to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003 Lawrence E. Rosen. All rights reserved.
+Permission is hereby granted to copy and distribute this license without
+modification. This license may not be modified without the express written
+permission of its copyright owner.
+
+
+
+ +
+xdg-user-dirs +show license +homepage +
+
  Copyright (c) 2007 Red Hat, inc
+
+  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.
+
+
+
+ +
+xdg-utils +show license +homepage +
+
#
+#   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.
+
+
+
+ +
+yasm +show license +homepage +
+
Yasm is Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.
+
+Yasm developers and/or contributors include:
+  Peter Johnson
+  Michael Urman
+  Brian Gladman (Visual Studio build files, other fixes)
+  Stanislav Karchebny (options parser)
+  Mathieu Monnier (SSE4 instruction patches, NASM preprocessor additions)
+  Anonymous "NASM64" developer (NASM preprocessor fixes)
+  Stephen Polkowski (x86 instruction patches)
+  Henryk Richter (Mach-O object format)
+  Ben Skeggs (patches, bug reports)
+  Alexei Svitkine (GAS preprocessor)
+  Samuel Thibault (TASM parser and frontend)
+
+-----------------------------------
+Yasm licensing overview and summary
+-----------------------------------
+
+Note: This document does not provide legal advice nor is it the actual
+license of any part of Yasm.  See the individual licenses for complete
+details.  Consult a lawyer for legal advice.
+
+The primary license of Yasm is the 2-clause BSD license.  Please use this
+license if you plan on submitting code to the project.
+
+Yasm has absolutely no warranty; not even for merchantibility or fitness
+for a particular purpose.
+
+-------
+Libyasm
+-------
+Libyasm is 2-clause or 3-clause BSD licensed, with the exception of
+bitvect, which is triple-licensed under the Artistic license, GPL, and
+LGPL.  Libyasm is thus GPL and LGPL compatible.  In addition, this also
+means that libyasm is free for binary-only distribution as long as the
+terms of the 3-clause BSD license and Artistic license (as it applies to
+bitvect) are fulfilled.
+
+-------
+Modules
+-------
+The modules are 2-clause or 3-clause BSD licensed.
+
+---------
+Frontends
+---------
+The frontends are 2-clause BSD licensed.
+
+-------------
+License Texts
+-------------
+The full text of all licenses are provided in separate files in the source
+distribution.  Each source file may include the entire license (in the case
+of the BSD and Artistic licenses), or may reference the GPL or LGPL license
+file.
+
+BSD.txt - 2-clause and 3-clause BSD licenses
+Artistic.txt - Artistic license
+GNU_GPL-2.0 - GNU General Public License
+GNU_LGPL-2.0 - GNU Library General Public License
+
+
+
+ +
+zlib +show license +homepage +
+
/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.4, March 14th, 2010
+
+  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly
+  Mark Adler
+
+*/
+
+mozzconf.h is distributed under the MPL 1.1/GPL 2.0/LGPL 2.1 tri-license.
+
+
+
+ +
+ + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Electron Framework b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Electron Framework new file mode 120000 index 0000000..b0f7c45 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Electron Framework @@ -0,0 +1 @@ +Versions/Current/Electron Framework \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Libraries b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Libraries new file mode 120000 index 0000000..bc941ee --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Libraries @@ -0,0 +1 @@ +Versions/Current/Libraries \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Resources b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework new file mode 100755 index 0000000..a6b97d2 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib new file mode 100755 index 0000000..4c37081 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..1869803 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,26 @@ + + + + + BuildMachineOSBuild + 14B25 + CFBundleExecutable + Electron Framework + CFBundleIdentifier + com.github.electron.framework + CFBundleName + Electron Framework + CFBundlePackageType + FMWK + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0640 + DTXcodeBuild + 6E35b + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/MainMenu.nib b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/MainMenu.nib new file mode 100644 index 0000000..31f3a56 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/MainMenu.nib differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/locale.pak new file mode 100644 index 0000000..7cc36ab Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ar.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ar.lproj/locale.pak new file mode 100644 index 0000000..da05d69 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ar.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bg.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bg.lproj/locale.pak new file mode 100644 index 0000000..ef1a0f8 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bg.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bn.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bn.lproj/locale.pak new file mode 100644 index 0000000..6eb0a2e Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bn.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ca.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ca.lproj/locale.pak new file mode 100644 index 0000000..040b6c2 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ca.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/content_shell.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/content_shell.pak new file mode 100644 index 0000000..38edfba Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/content_shell.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/crashpad_handler b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/crashpad_handler new file mode 100755 index 0000000..94ffa2d Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/crashpad_handler differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/cs.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/cs.lproj/locale.pak new file mode 100644 index 0000000..cbe9e1b Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/cs.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/da.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/da.lproj/locale.pak new file mode 100644 index 0000000..81bba9c Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/da.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/de.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/de.lproj/locale.pak new file mode 100644 index 0000000..bd0639c Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/de.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/el.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/el.lproj/locale.pak new file mode 100644 index 0000000..50489d0 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/el.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/locale.pak new file mode 100644 index 0000000..a3cc746 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en_GB.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en_GB.lproj/locale.pak new file mode 100644 index 0000000..f49c4b6 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en_GB.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es.lproj/locale.pak new file mode 100644 index 0000000..06b3759 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es_419.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es_419.lproj/locale.pak new file mode 100644 index 0000000..8af412f Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es_419.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/et.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/et.lproj/locale.pak new file mode 100644 index 0000000..68b7579 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/et.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fa.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fa.lproj/locale.pak new file mode 100644 index 0000000..864a0d4 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fa.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fi.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fi.lproj/locale.pak new file mode 100644 index 0000000..8da6d34 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fi.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fil.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fil.lproj/locale.pak new file mode 100644 index 0000000..29dcf5b Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fil.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fr.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fr.lproj/locale.pak new file mode 100644 index 0000000..332471c Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fr.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/gu.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/gu.lproj/locale.pak new file mode 100644 index 0000000..0091f23 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/gu.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/he.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/he.lproj/locale.pak new file mode 100644 index 0000000..67b8d6f Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/he.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hi.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hi.lproj/locale.pak new file mode 100644 index 0000000..e358bc3 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hi.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hr.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hr.lproj/locale.pak new file mode 100644 index 0000000..5c808bb Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hr.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hu.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hu.lproj/locale.pak new file mode 100644 index 0000000..ed05dd1 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hu.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat new file mode 100644 index 0000000..558690e Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/id.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/id.lproj/locale.pak new file mode 100644 index 0000000..1a81310 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/id.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/it.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/it.lproj/locale.pak new file mode 100644 index 0000000..5fdc2ab Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/it.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ja.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ja.lproj/locale.pak new file mode 100644 index 0000000..974178f Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ja.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/kn.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/kn.lproj/locale.pak new file mode 100644 index 0000000..f8a7466 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/kn.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ko.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ko.lproj/locale.pak new file mode 100644 index 0000000..1596e2b Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ko.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lt.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lt.lproj/locale.pak new file mode 100644 index 0000000..419ce41 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lt.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lv.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lv.lproj/locale.pak new file mode 100644 index 0000000..ed0db36 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lv.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ml.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ml.lproj/locale.pak new file mode 100644 index 0000000..318d0de Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ml.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/mr.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/mr.lproj/locale.pak new file mode 100644 index 0000000..c3e3911 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/mr.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ms.lproj/locale.pak b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ms.lproj/locale.pak new file mode 100644 index 0000000..0c33e8b Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ms.lproj/locale.pak differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin new file mode 100644 index 0000000..14b99b3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin @@ -0,0 +1,20201 @@ + mirrors… +(function(a,b){ +"use strict"; +var c; +var d=a.Array; +var e=a.isNaN; +var f=a.JSON.stringify; +var g=a.Math.min; +var h=b.ImportNow("promise_status_symbol"); +var i=b.ImportNow("promise_value_symbol"); +var j; +var k; +var l; +b.Import(function(m){ +c=m.FunctionSourceString; +j=m.SymbolToString; +k=m.ToBoolean; +l=m.ToString; +}); +var n={ +UNDEFINED_TYPE:'undefined', +NULL_TYPE:'null', +BOOLEAN_TYPE:'boolean', +NUMBER_TYPE:'number', +STRING_TYPE:'string', +SYMBOL_TYPE:'symbol', +OBJECT_TYPE:'object', +FUNCTION_TYPE:'function', +REGEXP_TYPE:'regexp', +ERROR_TYPE:'error', +PROPERTY_TYPE:'property', +INTERNAL_PROPERTY_TYPE:'internalProperty', +FRAME_TYPE:'frame', +SCRIPT_TYPE:'script', +CONTEXT_TYPE:'context', +SCOPE_TYPE:'scope', +PROMISE_TYPE:'promise', +MAP_TYPE:'map', +SET_TYPE:'set', +ITERATOR_TYPE:'iterator', +GENERATOR_TYPE:'generator', +} +var o=0; +var p=-1; +var q=[]; +var r=true; +function MirrorCacheIsEmpty(){ +return o==0&&q.length==0; +} +function ToggleMirrorCache(s){ +r=s; +ClearMirrorCache(); +} +function ClearMirrorCache(s){ +o=0; +q=[]; +} +function ObjectIsPromise(s){ +return(%_IsSpecObject(s))&& +!(%DebugGetProperty(s,h)===(void 0)); +} +function MakeMirror(s,t){ +var u; +if(!t&&r){ +for(var v in q){ +u=q[v]; +if(u.value()===s){ +return u; +} +if(u.isNumber()&&e(u.value())&& +typeof s=='number'&&e(s)){ +return u; +} +} +} +if((s===(void 0))){ +u=new UndefinedMirror(); +}else if((s===null)){ +u=new NullMirror(); +}else if((typeof(s)==='boolean')){ +u=new BooleanMirror(s); +}else if((typeof(s)==='number')){ +u=new NumberMirror(s); +}else if((typeof(s)==='string')){ +u=new StringMirror(s); +}else if((typeof(s)==='symbol')){ +u=new SymbolMirror(s); +}else if((%_IsArray(s))){ +u=new ArrayMirror(s); +}else if((%_IsDate(s))){ +u=new DateMirror(s); +}else if((%_IsFunction(s))){ +u=new FunctionMirror(s); +}else if((%_IsRegExp(s))){ +u=new RegExpMirror(s); +}else if((%_ClassOf(s)==='Error')){ +u=new ErrorMirror(s); +}else if((%_ClassOf(s)==='Script')){ +u=new ScriptMirror(s); +}else if((%_ClassOf(s)==='Map')||(%_ClassOf(s)==='WeakMap')){ +u=new MapMirror(s); +}else if((%_ClassOf(s)==='Set')||(%_ClassOf(s)==='WeakSet')){ +u=new SetMirror(s); +}else if((%_ClassOf(s)==='Map Iterator')||(%_ClassOf(s)==='Set Iterator')){ +u=new IteratorMirror(s); +}else if(ObjectIsPromise(s)){ +u=new PromiseMirror(s); +}else if((%_ClassOf(s)==='Generator')){ +u=new GeneratorMirror(s); +}else{ +u=new ObjectMirror(s,n.OBJECT_TYPE,t); +} +if(r)q[u.handle()]=u; +return u; +} +function LookupMirror(w){ +if(!r){ +throw MakeError(2,"Mirror cache is disabled"); +} +return q[w]; +} +function GetUndefinedMirror(){ +return MakeMirror((void 0)); +} +function inherits(x,y){ +var z=function(){}; +z.prototype=y.prototype; +x.super_=y.prototype; +x.prototype=new z(); +x.prototype.constructor=x; +} +var A=80; +var B={}; +B.Named=1; +B.Indexed=2; +var C={}; +C.Data=0; +C.DataConstant=2; +C.AccessorConstant=3; +var D={}; +D.None=0; +D.ReadOnly=1; +D.DontEnum=2; +D.DontDelete=4; +var E={Global:0, +Local:1, +With:2, +Closure:3, +Catch:4, +Block:5, +Script:6}; +function Mirror(F){ +this.type_=F; +} +Mirror.prototype.type=function(){ +return this.type_; +}; +Mirror.prototype.isValue=function(){ +return this instanceof ValueMirror; +}; +Mirror.prototype.isUndefined=function(){ +return this instanceof UndefinedMirror; +}; +Mirror.prototype.isNull=function(){ +return this instanceof NullMirror; +}; +Mirror.prototype.isBoolean=function(){ +return this instanceof BooleanMirror; +}; +Mirror.prototype.isNumber=function(){ +return this instanceof NumberMirror; +}; +Mirror.prototype.isString=function(){ +return this instanceof StringMirror; +}; +Mirror.prototype.isSymbol=function(){ +return this instanceof SymbolMirror; +}; +Mirror.prototype.isObject=function(){ +return this instanceof ObjectMirror; +}; +Mirror.prototype.isFunction=function(){ +return this instanceof FunctionMirror; +}; +Mirror.prototype.isUnresolvedFunction=function(){ +return this instanceof UnresolvedFunctionMirror; +}; +Mirror.prototype.isArray=function(){ +return this instanceof ArrayMirror; +}; +Mirror.prototype.isDate=function(){ +return this instanceof DateMirror; +}; +Mirror.prototype.isRegExp=function(){ +return this instanceof RegExpMirror; +}; +Mirror.prototype.isError=function(){ +return this instanceof ErrorMirror; +}; +Mirror.prototype.isPromise=function(){ +return this instanceof PromiseMirror; +}; +Mirror.prototype.isGenerator=function(){ +return this instanceof GeneratorMirror; +}; +Mirror.prototype.isProperty=function(){ +return this instanceof PropertyMirror; +}; +Mirror.prototype.isInternalProperty=function(){ +return this instanceof InternalPropertyMirror; +}; +Mirror.prototype.isFrame=function(){ +return this instanceof FrameMirror; +}; +Mirror.prototype.isScript=function(){ +return this instanceof ScriptMirror; +}; +Mirror.prototype.isContext=function(){ +return this instanceof ContextMirror; +}; +Mirror.prototype.isScope=function(){ +return this instanceof ScopeMirror; +}; +Mirror.prototype.isMap=function(){ +return this instanceof MapMirror; +}; +Mirror.prototype.isSet=function(){ +return this instanceof SetMirror; +}; +Mirror.prototype.isIterator=function(){ +return this instanceof IteratorMirror; +}; +Mirror.prototype.allocateHandle_=function(){ +if(r)this.handle_=o++; +}; +Mirror.prototype.allocateTransientHandle_=function(){ +this.handle_=p--; +}; +Mirror.prototype.toText=function(){ +return"#<"+this.constructor.name+">"; +}; +function ValueMirror(F,s,G){ +%_CallFunction(this,F,Mirror); +this.value_=s; +if(!G){ +this.allocateHandle_(); +}else{ +this.allocateTransientHandle_(); +} +} +inherits(ValueMirror,Mirror); +Mirror.prototype.handle=function(){ +return this.handle_; +}; +ValueMirror.prototype.isPrimitive=function(){ +var F=this.type(); +return F==='undefined'|| +F==='null'|| +F==='boolean'|| +F==='number'|| +F==='string'|| +F==='symbol'; +}; +ValueMirror.prototype.value=function(){ +return this.value_; +}; +function UndefinedMirror(){ +%_CallFunction(this,n.UNDEFINED_TYPE,(void 0),ValueMirror); +} +inherits(UndefinedMirror,ValueMirror); +UndefinedMirror.prototype.toText=function(){ +return'undefined'; +}; +function NullMirror(){ +%_CallFunction(this,n.NULL_TYPE,null,ValueMirror); +} +inherits(NullMirror,ValueMirror); +NullMirror.prototype.toText=function(){ +return'null'; +}; +function BooleanMirror(s){ +%_CallFunction(this,n.BOOLEAN_TYPE,s,ValueMirror); +} +inherits(BooleanMirror,ValueMirror); +BooleanMirror.prototype.toText=function(){ +return this.value_?'true':'false'; +}; +function NumberMirror(s){ +%_CallFunction(this,n.NUMBER_TYPE,s,ValueMirror); +} +inherits(NumberMirror,ValueMirror); +NumberMirror.prototype.toText=function(){ +return %_NumberToString(this.value_); +}; +function StringMirror(s){ +%_CallFunction(this,n.STRING_TYPE,s,ValueMirror); +} +inherits(StringMirror,ValueMirror); +StringMirror.prototype.length=function(){ +return this.value_.length; +}; +StringMirror.prototype.getTruncatedValue=function(H){ +if(H!=-1&&this.length()>H){ +return this.value_.substring(0,H)+ +'... (length: '+this.length()+')'; +} +return this.value_; +}; +StringMirror.prototype.toText=function(){ +return this.getTruncatedValue(A); +}; +function SymbolMirror(s){ +%_CallFunction(this,n.SYMBOL_TYPE,s,ValueMirror); +} +inherits(SymbolMirror,ValueMirror); +SymbolMirror.prototype.description=function(){ +return %SymbolDescription(%_ValueOf(this.value_)); +} +SymbolMirror.prototype.toText=function(){ +return %_CallFunction(this.value_,j); +} +function ObjectMirror(s,F,G){ +F=F||n.OBJECT_TYPE; +%_CallFunction(this,F,s,G,ValueMirror); +} +inherits(ObjectMirror,ValueMirror); +ObjectMirror.prototype.className=function(){ +return %_ClassOf(this.value_); +}; +ObjectMirror.prototype.constructorFunction=function(){ +return MakeMirror(%DebugGetProperty(this.value_,'constructor')); +}; +ObjectMirror.prototype.prototypeObject=function(){ +return MakeMirror(%DebugGetProperty(this.value_,'prototype')); +}; +ObjectMirror.prototype.protoObject=function(){ +return MakeMirror(%DebugGetPrototype(this.value_)); +}; +ObjectMirror.prototype.hasNamedInterceptor=function(){ +var I=%GetInterceptorInfo(this.value_); +return(I&2)!=0; +}; +ObjectMirror.prototype.hasIndexedInterceptor=function(){ +var I=%GetInterceptorInfo(this.value_); +return(I&1)!=0; +}; +function TryGetPropertyNames(J){ +try{ +return %GetOwnPropertyNames(J,32); +}catch(e){ +return[]; +} +} +ObjectMirror.prototype.propertyNames=function(K,L){ +K=K||B.Named|B.Indexed; +var M; +var N; +var O=0; +if(K&B.Named){ +M=TryGetPropertyNames(this.value_); +O+=M.length; +if(this.hasNamedInterceptor()&&(K&B.Named)){ +var P= +%GetNamedInterceptorPropertyNames(this.value_); +if(P){ +M=M.concat(P); +O+=P.length; +} +} +} +if(K&B.Indexed){ +N=%GetOwnElementNames(this.value_); +O+=N.length; +if(this.hasIndexedInterceptor()&&(K&B.Indexed)){ +var Q= +%GetIndexedInterceptorElementNames(this.value_); +if(Q){ +N=N.concat(Q); +O+=Q.length; +} +} +} +L=g(L||O,O); +var R=new d(L); +var S=0; +if(K&B.Named){ +for(var T=0;S'; +}; +ObjectMirror.GetInternalProperties=function(s){ +var U=%DebugGetInternalProperties(s); +var Z=[]; +for(var T=0;Tad)return new d(); +var ae=new d(ad-ac+1); +for(var T=ac;T<=ad;T++){ +var W=%DebugGetPropertyDetails(this.value_,l(T)); +var s; +if(W){ +s=new PropertyMirror(this,T,W); +}else{ +s=GetUndefinedMirror(); +} +ae[T-ac]=s; +} +return ae; +}; +function DateMirror(s){ +%_CallFunction(this,s,ObjectMirror); +} +inherits(DateMirror,ObjectMirror); +DateMirror.prototype.toText=function(){ +var af=f(this.value_); +return af.substring(1,af.length-1); +}; +function RegExpMirror(s){ +%_CallFunction(this,s,n.REGEXP_TYPE,ObjectMirror); +} +inherits(RegExpMirror,ObjectMirror); +RegExpMirror.prototype.source=function(){ +return this.value_.source; +}; +RegExpMirror.prototype.global=function(){ +return this.value_.global; +}; +RegExpMirror.prototype.ignoreCase=function(){ +return this.value_.ignoreCase; +}; +RegExpMirror.prototype.multiline=function(){ +return this.value_.multiline; +}; +RegExpMirror.prototype.sticky=function(){ +return this.value_.sticky; +}; +RegExpMirror.prototype.unicode=function(){ +return this.value_.unicode; +}; +RegExpMirror.prototype.toText=function(){ +return"/"+this.source()+"/"; +}; +function ErrorMirror(s){ +%_CallFunction(this,s,n.ERROR_TYPE,ObjectMirror); +} +inherits(ErrorMirror,ObjectMirror); +ErrorMirror.prototype.message=function(){ +return this.value_.message; +}; +ErrorMirror.prototype.toText=function(){ +var ag; +try{ +ag=%_CallFunction(this.value_,builtins.$errorToString); +}catch(e){ +ag='#'; +} +return ag; +}; +function PromiseMirror(s){ +%_CallFunction(this,s,n.PROMISE_TYPE,ObjectMirror); +} +inherits(PromiseMirror,ObjectMirror); +function PromiseGetStatus_(s){ +var ah=%DebugGetProperty(s,h); +if(ah==0)return"pending"; +if(ah==1)return"resolved"; +return"rejected"; +} +function PromiseGetValue_(s){ +return %DebugGetProperty(s,i); +} +PromiseMirror.prototype.status=function(){ +return PromiseGetStatus_(this.value_); +}; +PromiseMirror.prototype.promiseValue=function(){ +return MakeMirror(PromiseGetValue_(this.value_)); +}; +function MapMirror(s){ +%_CallFunction(this,s,n.MAP_TYPE,ObjectMirror); +} +inherits(MapMirror,ObjectMirror); +MapMirror.prototype.entries=function(ai){ +var Z=[]; +if((%_ClassOf(this.value_)==='WeakMap')){ +var aj=%GetWeakMapEntries(this.value_,ai||0); +for(var T=0;T3){ +this.exception_=W[3]; +this.getter_=W[4]; +this.setter_=W[5]; +} +} +inherits(PropertyMirror,Mirror); +PropertyMirror.prototype.isReadOnly=function(){ +return(this.attributes()&D.ReadOnly)!=0; +}; +PropertyMirror.prototype.isEnum=function(){ +return(this.attributes()&D.DontEnum)==0; +}; +PropertyMirror.prototype.canDelete=function(){ +return(this.attributes()&D.DontDelete)==0; +}; +PropertyMirror.prototype.name=function(){ +return this.name_; +}; +PropertyMirror.prototype.isIndexed=function(){ +for(var T=0;T0; +}; +FrameDetails.prototype.inlinedFrameIndex=function(){ +%CheckExecutionState(this.break_id_); +var aG=aE; +return(this.details_[ax]&aG)>>2; +}; +FrameDetails.prototype.argumentCount=function(){ +%CheckExecutionState(this.break_id_); +return this.details_[as]; +}; +FrameDetails.prototype.argumentName=function(S){ +%CheckExecutionState(this.break_id_); +if(S>=0&&S=0&&S=0&&S=0&&S0){ +for(var T=0;T0){ +Z+=this.lineOffset(); +Z+='-'; +Z+=this.lineOffset()+this.lineCount()-1; +}else{ +Z+=this.lineCount(); +} +Z+=')'; +return Z; +}; +function ContextMirror(bj){ +%_CallFunction(this,n.CONTEXT_TYPE,Mirror); +this.data_=bj; +this.allocateHandle_(); +} +inherits(ContextMirror,Mirror); +ContextMirror.prototype.data=function(){ +return this.data_; +}; +function MakeMirrorSerializer(W,bk){ +return new JSONProtocolSerializer(W,bk); +} +function JSONProtocolSerializer(W,bk){ +this.details_=W; +this.options_=bk; +this.mirrors_=[]; +} +JSONProtocolSerializer.prototype.serializeReference=function(u){ +return this.serialize_(u,true,true); +}; +JSONProtocolSerializer.prototype.serializeValue=function(u){ +var bl=this.serialize_(u,false,true); +return bl; +}; +JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){ +var bm=[]; +var bn=this.mirrors_.length; +for(var T=0;Tthis.maxStringLength_()){ +var bp=u.getTruncatedValue(this.maxStringLength_()); +bm.value=bp; +bm.fromIndex=0; +bm.toIndex=this.maxStringLength_(); +}else{ +bm.value=u.value(); +} +bm.length=u.length(); +break; +case n.SYMBOL_TYPE: +bm.description=u.description(); +break; +case n.OBJECT_TYPE: +case n.FUNCTION_TYPE: +case n.ERROR_TYPE: +case n.REGEXP_TYPE: +case n.PROMISE_TYPE: +case n.GENERATOR_TYPE: +this.serializeObject_(u,bm,W); +break; +case n.PROPERTY_TYPE: +case n.INTERNAL_PROPERTY_TYPE: +throw MakeError(2, +'PropertyMirror cannot be serialized independently'); +break; +case n.FRAME_TYPE: +this.serializeFrame_(u,bm); +break; +case n.SCOPE_TYPE: +this.serializeScope_(u,bm); +break; +case n.SCRIPT_TYPE: +if(u.name()){ +bm.name=u.name(); +} +bm.id=u.id(); +bm.lineOffset=u.lineOffset(); +bm.columnOffset=u.columnOffset(); +bm.lineCount=u.lineCount(); +if(u.data()){ +bm.data=u.data(); +} +if(this.includeSource_()){ +bm.source=u.source(); +}else{ +var bq=u.source().substring(0,80); +bm.sourceStart=bq; +} +bm.sourceLength=u.source().length; +bm.scriptType=u.scriptType(); +bm.compilationType=u.compilationType(); +if(u.compilationType()==1&& +u.evalFromScript()){ +bm.evalFromScript= +this.serializeReference(u.evalFromScript()); +var br=u.evalFromLocation(); +if(br){ +bm.evalFromLocation={line:br.line, +column:br.column}; +} +if(u.evalFromFunctionName()){ +bm.evalFromFunctionName=u.evalFromFunctionName(); +} +} +if(u.context()){ +bm.context=this.serializeReference(u.context()); +} +break; +case n.CONTEXT_TYPE: +bm.data=u.data(); +break; +} +bm.text=u.toText(); +return bm; +}; +JSONProtocolSerializer.prototype.serializeObject_=function(u,bm, +W){ +bm.className=u.className(); +bm.constructorFunction= +this.serializeReference(u.constructorFunction()); +bm.protoObject=this.serializeReference(u.protoObject()); +bm.prototypeObject=this.serializeReference(u.prototypeObject()); +if(u.hasNamedInterceptor()){ +bm.namedInterceptor=true; +} +if(u.hasIndexedInterceptor()){ +bm.indexedInterceptor=true; +} +if(u.isFunction()){ +bm.name=u.name(); +if(!(u.inferredName()===(void 0))){ +bm.inferredName=u.inferredName(); +} +bm.resolved=u.resolved(); +if(u.resolved()){ +bm.source=u.source(); +} +if(u.script()){ +bm.script=this.serializeReference(u.script()); +bm.scriptId=u.script().id(); +serializeLocationFields(u.sourceLocation(),bm); +} +bm.scopes=[]; +for(var T=0;T0){ +var bx=[]; +for(var T=0;T0){ +return'Infinity'; +}else{ +return'-Infinity'; +} +} +return s; +} +b.InstallFunctions(a,2,[ +"MakeMirror",MakeMirror, +"MakeMirrorSerializer",MakeMirrorSerializer, +"LookupMirror",LookupMirror, +"ToggleMirrorCache",ToggleMirrorCache, +"MirrorCacheIsEmpty",MirrorCacheIsEmpty, +]); +b.InstallConstants(a,[ +"ScopeType",E, +"PropertyKind",B, +"PropertyType",C, +"PropertyAttribute",D, +"Mirror",Mirror, +"ValueMirror",ValueMirror, +"UndefinedMirror",UndefinedMirror, +"NullMirror",NullMirror, +"BooleanMirror",BooleanMirror, +"NumberMirror",NumberMirror, +"StringMirror",StringMirror, +"SymbolMirror",SymbolMirror, +"ObjectMirror",ObjectMirror, +"FunctionMirror",FunctionMirror, +"UnresolvedFunctionMirror",UnresolvedFunctionMirror, +"ArrayMirror",ArrayMirror, +"DateMirror",DateMirror, +"RegExpMirror",RegExpMirror, +"ErrorMirror",ErrorMirror, +"PromiseMirror",PromiseMirror, +"MapMirror",MapMirror, +"SetMirror",SetMirror, +"IteratorMirror",IteratorMirror, +"GeneratorMirror",GeneratorMirror, +"PropertyMirror",PropertyMirror, +"InternalPropertyMirror",InternalPropertyMirror, +"FrameMirror",FrameMirror, +"ScriptMirror",ScriptMirror, +"ScopeMirror",ScopeMirror, +"FrameDetails",FrameDetails, +]); +b.InstallFunctions(b,2,[ +"ClearMirrorCache",ClearMirrorCache +]); +b.Export(function(bF){ +bF.MirrorType=n; +}); +}) + +debugfˆ +(function(a,b){ +"use strict"; +var c=a.FrameMirror; +var d=a.Array; +var e=a.RegExp; +var f=a.isNaN; +var g=a.JSON.parse; +var h=a.JSON.stringify; +var i=a.LookupMirror; +var j=a.MakeMirror; +var k=a.MakeMirrorSerializer; +var l=a.Math.min; +var m=a.Mirror; +var n; +var o=a.parseInt; +var p; +var q; +var r; +var s=a.ValueMirror; +b.Import(function(t){ +n=t.MirrorType; +p=t.ToBoolean; +q=t.ToNumber; +r=t.ToString; +}); +var u=10; +var v={}; +var w=/^(?:\s*(?:\/\*.*?\*\/)*)*/; +v.DebugEvent={Break:1, +Exception:2, +NewFunction:3, +BeforeCompile:4, +AfterCompile:5, +CompileError:6, +PromiseEvent:7, +AsyncTaskEvent:8}; +v.ExceptionBreak={Caught:0, +Uncaught:1}; +v.StepAction={StepOut:0, +StepNext:1, +StepIn:2, +StepMin:3, +StepInMin:4, +StepFrame:5}; +v.ScriptType={Native:0, +Extension:1, +Normal:2}; +v.ScriptCompilationType={Host:0, +Eval:1, +JSON:2}; +v.ScriptBreakPointType={ScriptId:0, +ScriptName:1, +ScriptRegExp:2}; +v.BreakPositionAlignment={ +Statement:0, +BreakPosition:1 +}; +function ScriptTypeFlag(x){ +return(1<0){ +this.ignoreCount_--; +return false; +} +return true; +}; +function IsBreakPointTriggered(L,G){ +return G.isTriggered(MakeExecutionState(L)); +} +function ScriptBreakPoint(x,script_id_or_name,opt_line,opt_column, +opt_groupId,opt_position_alignment){ +this.type_=x; +if(x==v.ScriptBreakPointType.ScriptId){ +this.script_id_=script_id_or_name; +}else if(x==v.ScriptBreakPointType.ScriptName){ +this.script_name_=script_id_or_name; +}else if(x==v.ScriptBreakPointType.ScriptRegExp){ +this.script_regexp_object_=new e(script_id_or_name); +}else{ +throw MakeError(2,"Unexpected breakpoint type "+x); +} +this.line_=opt_line||0; +this.column_=opt_column; +this.groupId_=opt_groupId; +this.position_alignment_=(opt_position_alignment===(void 0)) +?v.BreakPositionAlignment.Statement:opt_position_alignment; +this.hit_count_=0; +this.active_=true; +this.condition_=null; +this.ignoreCount_=0; +this.break_points_=[]; +} +ScriptBreakPoint.prototype.cloneForOtherScript=function(M){ +var N=new ScriptBreakPoint(v.ScriptBreakPointType.ScriptId, +M.id,this.line_,this.column_,this.groupId_, +this.position_alignment_); +N.number_=z++; +B.push(N); +N.hit_count_=this.hit_count_; +N.active_=this.active_; +N.condition_=this.condition_; +N.ignoreCount_=this.ignoreCount_; +return N; +}; +ScriptBreakPoint.prototype.number=function(){ +return this.number_; +}; +ScriptBreakPoint.prototype.groupId=function(){ +return this.groupId_; +}; +ScriptBreakPoint.prototype.type=function(){ +return this.type_; +}; +ScriptBreakPoint.prototype.script_id=function(){ +return this.script_id_; +}; +ScriptBreakPoint.prototype.script_name=function(){ +return this.script_name_; +}; +ScriptBreakPoint.prototype.script_regexp_object=function(){ +return this.script_regexp_object_; +}; +ScriptBreakPoint.prototype.line=function(){ +return this.line_; +}; +ScriptBreakPoint.prototype.column=function(){ +return this.column_; +}; +ScriptBreakPoint.prototype.actual_locations=function(){ +var O=[]; +for(var P=0;P=this.frameCount()){ +throw MakeTypeError(25); +} +return new c(this.break_id,aE); +}; +ExecutionState.prototype.setSelectedFrame=function(aF){ +var P=q(aF); +if(P<0||P>=this.frameCount()){ +throw MakeTypeError(25); +} +this.selected_frame=P; +}; +ExecutionState.prototype.selectedFrame=function(){ +return this.selected_frame; +}; +ExecutionState.prototype.debugCommandProcessor=function(aG){ +return new DebugCommandProcessor(this,aG); +}; +function MakeBreakEvent(L,aH){ +return new BreakEvent(L,aH); +} +function BreakEvent(L,aH){ +this.frame_=new c(L,0); +this.break_points_hit_=aH; +} +BreakEvent.prototype.eventType=function(){ +return v.DebugEvent.Break; +}; +BreakEvent.prototype.func=function(){ +return this.frame_.func(); +}; +BreakEvent.prototype.sourceLine=function(){ +return this.frame_.sourceLine(); +}; +BreakEvent.prototype.sourceColumn=function(){ +return this.frame_.sourceColumn(); +}; +BreakEvent.prototype.sourceLineText=function(){ +return this.frame_.sourceLineText(); +}; +BreakEvent.prototype.breakPointsHit=function(){ +return this.break_points_hit_; +}; +BreakEvent.prototype.toJSONProtocol=function(){ +var aI={seq:y++, +type:"event", +event:"break", +body:{invocationText:this.frame_.invocationText()} +}; +var S=this.func().script(); +if(S){ +aI.body.sourceLine=this.sourceLine(), +aI.body.sourceColumn=this.sourceColumn(), +aI.body.sourceLineText=this.sourceLineText(), +aI.body.script=MakeScriptObject_(S,false); +} +if(this.breakPointsHit()){ +aI.body.breakpoints=[]; +for(var P=0;P0){ +aI.body.sourceLine=this.sourceLine(); +aI.body.sourceColumn=this.sourceColumn(); +aI.body.sourceLineText=this.sourceLineText(); +var S=this.func().script(); +if(S){ +aI.body.script=MakeScriptObject_(S,false); +} +}else{ +aI.body.sourceLine=-1; +} +return aI.toJSONProtocol(); +}; +function MakeCompileEvent(S,x){ +return new CompileEvent(S,x); +} +function CompileEvent(S,x){ +this.script_=j(S); +this.type_=x; +} +CompileEvent.prototype.eventType=function(){ +return this.type_; +}; +CompileEvent.prototype.script=function(){ +return this.script_; +}; +CompileEvent.prototype.toJSONProtocol=function(){ +var aI=new ProtocolMessage(); +aI.running=true; +switch(this.type_){ +case v.DebugEvent.BeforeCompile: +aI.event="beforeCompile"; +break; +case v.DebugEvent.AfterCompile: +aI.event="afterCompile"; +break; +case v.DebugEvent.CompileError: +aI.event="compileError"; +break; +} +aI.body={}; +aI.body.script=this.script_; +return aI.toJSONProtocol(); +}; +function MakeScriptObject_(S,aO){ +var aI={id:S.id(), +name:S.name(), +lineOffset:S.lineOffset(), +columnOffset:S.columnOffset(), +lineCount:S.lineCount(), +}; +if(!(S.data()===(void 0))){ +aI.data=S.data(); +} +if(aO){ +aI.source=S.source(); +} +return aI; +} +function MakePromiseEvent(aP){ +return new PromiseEvent(aP); +} +function PromiseEvent(aP){ +this.promise_=aP.promise; +this.parentPromise_=aP.parentPromise; +this.status_=aP.status; +this.value_=aP.value; +} +PromiseEvent.prototype.promise=function(){ +return j(this.promise_); +} +PromiseEvent.prototype.parentPromise=function(){ +return j(this.parentPromise_); +} +PromiseEvent.prototype.status=function(){ +return this.status_; +} +PromiseEvent.prototype.value=function(){ +return j(this.value_); +} +function MakeAsyncTaskEvent(aP){ +return new AsyncTaskEvent(aP); +} +function AsyncTaskEvent(aP){ +this.type_=aP.type; +this.name_=aP.name; +this.id_=aP.id; +} +AsyncTaskEvent.prototype.type=function(){ +return this.type_; +} +AsyncTaskEvent.prototype.name=function(){ +return this.name_; +} +AsyncTaskEvent.prototype.id=function(){ +return this.id_; +} +function DebugCommandProcessor(J,aG){ +this.exec_state_=J; +this.running_=aG||false; +} +DebugCommandProcessor.prototype.processDebugRequest=function(aQ){ +return this.processDebugJSONRequest(aQ); +}; +function ProtocolMessage(aQ){ +this.seq=y++; +if(aQ){ +this.type='response'; +this.request_seq=aQ.seq; +this.command=aQ.command; +}else{ +this.type='event'; +} +this.success=true; +this.running=(void 0); +} +ProtocolMessage.prototype.setOption=function(aR,D){ +if(!this.options_){ +this.options_={}; +} +this.options_[aR]=D; +}; +ProtocolMessage.prototype.failed=function(aS,aT){ +this.success=false; +this.message=aS; +if((typeof(aT)==='object')){ +this.error_details=aT; +} +}; +ProtocolMessage.prototype.toJSONProtocol=function(){ +var aU={}; +aU.seq=this.seq; +if(this.request_seq){ +aU.request_seq=this.request_seq; +} +aU.type=this.type; +if(this.event){ +aU.event=this.event; +} +if(this.command){ +aU.command=this.command; +} +if(this.success){ +aU.success=this.success; +}else{ +aU.success=false; +} +if(this.body){ +var aV; +var aW=k(true,this.options_); +if(this.body instanceof m){ +aV=aW.serializeValue(this.body); +}else if(this.body instanceof d){ +aV=[]; +for(var P=0;P=this.exec_state_.frameCount()){ +return aX.failed('Invalid frame "'+bw+'"'); +} +aX.body=this.exec_state_.frame(bN).evaluate( +bH,p(bI),bK); +return; +}else{ +aX.body=this.exec_state_.frame().evaluate( +bH,p(bI),bK); +return; +} +}; +DebugCommandProcessor.prototype.lookupRequest_=function(aQ,aX){ +if(!aQ.arguments){ +return aX.failed('Missing arguments'); +} +var bO=aQ.arguments.handles; +if((bO===(void 0))){ +return aX.failed('Argument "handles" missing'); +} +if(!(aQ.arguments.includeSource===(void 0))){ +var bP=p(aQ.arguments.includeSource); +aX.setOption('includeSource',bP); +} +var bQ={}; +for(var P=0;P=this.exec_state_.frameCount()){ +return aX.failed('Invalid frame "'+bw+'"'); +} +bw=this.exec_state_.frame(bN); +} +} +var S=bw.func().script(); +if(!S){ +return aX.failed('No source'); +} +var bT=S.sourceSlice(bR,bS); +if(!bT){ +return aX.failed('Invalid line interval'); +} +aX.body={}; +aX.body.source=bT.sourceText(); +aX.body.fromLine=bT.from_line; +aX.body.toLine=bT.to_line; +aX.body.fromPosition=bT.from_position; +aX.body.toPosition=bT.to_position; +aX.body.totalLines=S.lineCount(); +}; +DebugCommandProcessor.prototype.scriptsRequest_=function(aQ,aX){ +var bU=ScriptTypeFlag(v.ScriptType.Normal); +var bP=false; +var bV=null; +if(aQ.arguments){ +if(!(aQ.arguments.types===(void 0))){ +bU=q(aQ.arguments.types); +if(f(bU)||bU<0){ +return aX.failed('Invalid types "'+ +aQ.arguments.types+'"'); +} +} +if(!(aQ.arguments.includeSource===(void 0))){ +bP=p(aQ.arguments.includeSource); +aX.setOption('includeSource',bP); +} +if((%_IsArray(aQ.arguments.ids))){ +bV={}; +var bW=aQ.arguments.ids; +for(var P=0;P=0){ +ca=true; +} +} +if(!ca)continue; +} +if(bU&ScriptTypeFlag(af[P].type)){ +aX.body.push(j(af[P])); +} +} +}; +DebugCommandProcessor.prototype.threadsRequest_=function(aQ,aX){ +var cb=this.exec_state_.threadCount(); +var cc=[]; +for(var P=0;P=this.exec_state_.frameCount()){ +return aX.failed('Invalid frame "'+bw+'"'); +} +cl=this.exec_state_.frame(bN); +}else{ +cl=this.exec_state_.frame(); +} +var ck=v.LiveEdit.RestartFrame(cl); +aX.body={result:ck}; +}; +DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(aQ, +aX){ +if(!aQ.arguments){ +aX.failed('Missing arguments'); +return; +} +var cm=aQ.arguments.flags; +aX.body={flags:[]}; +if(!(cm===(void 0))){ +for(var P=0;PN[C].start_position){ +P=C; +} +} +if(P!=x){ +var Q=N[P]; +var R=O[P]; +N[P]=N[x]; +O[P]=O[x]; +N[x]=Q; +O[x]=R; +} +} +var S=0; +function ResetIndexes(T,U){ +var V=-1; +while(S=aJ.pos1+aJ.len1){ +return aD+aJ.pos2+aJ.len2-aJ.pos1-aJ.len1; +} +if(!aE){ +aE=PosTranslator.DefaultInsideChunkHandler; +} +return aE(aD,aJ); +}; +PosTranslator.DefaultInsideChunkHandler=function(aD,aK){ +Assert(false,"Cannot translate position in changed area"); +}; +PosTranslator.ShiftWithTopInsideChunkHandler= +function(aD,aK){ +return aD-aK.pos1+aK.pos2; +}; +var i={ +UNCHANGED:"unchanged", +SOURCE_CHANGED:"source changed", +CHANGED:"changed", +DAMAGED:"damaged" +}; +function CodeInfoTreeNode(aL,aM,aN){ +this.info=aL; +this.children=aM; +this.array_index=aN; +this.parent=(void 0); +this.status=i.UNCHANGED; +this.status_explanation=(void 0); +this.new_start_pos=(void 0); +this.new_end_pos=(void 0); +this.corresponding_node=(void 0); +this.unmatched_new_nodes=(void 0); +this.textual_corresponding_node=(void 0); +this.textually_unmatched_new_nodes=(void 0); +this.live_shared_function_infos=(void 0); +} +function BuildCodeInfoTree(aO){ +var aP=0; +function BuildNode(){ +var aQ=aP; +aP++; +var aR=new e(); +while(aP=ax.length;}; +this.TranslatePos=function(aD){return aD+aW;}; +}; +function ProcessInternals(aX){ +aX.new_start_pos=aU.TranslatePos( +aX.info.start_position); +var aY=0; +var aZ=false; +var ba=false; +while(!aU.done()&& +aU.current().pos1= +aU.current().pos1+aU.current().len1){ +aZ=true; +aU.next(); +continue; +}else if(bb.info.start_position<=aU.current().pos1&& +bb.info.end_position>=aU.current().pos1+ +aU.current().len1){ +ProcessInternals(bb); +ba=ba|| +(bb.status!=i.UNCHANGED); +aZ=aZ|| +(bb.status==i.DAMAGED); +aY++; +continue; +}else{ +aZ=true; +bb.status=i.DAMAGED; +bb.status_explanation= +"Text diff overlaps with function boundary"; +aY++; +continue; +} +}else{ +if(aU.current().pos1+aU.current().len1<= +aX.info.end_position){ +aX.status=i.CHANGED; +aU.next(); +continue; +}else{ +aX.status=i.DAMAGED; +aX.status_explanation= +"Text diff overlaps with function boundary"; +return; +} +} +Assert("Unreachable",false); +} +while(aY0){ +return bo; +} +} +function TraverseTree(w){ +w.live_shared_function_infos=FindFunctionInfos(w.info); +for(var x=0;x ["+bw+"]"; +} +return; +} +var bx; +function CheckStackActivations(by,X){ +var bz=new e(); +for(var x=0;x0){ +X.push({dropped_from_stack:bC}); +} +if(bB.length>0){ +X.push({functions_on_stack:bB}); +throw new Failure("Blocked by functions on stack"); +} +return bC.length; +} +var bx={ +AVAILABLE_FOR_PATCH:1, +BLOCKED_ON_ACTIVE_STACK:2, +BLOCKED_ON_OTHER_STACK:3, +BLOCKED_UNDER_NATIVE_CODE:4, +REPLACED_ON_ACTIVE_STACK:5, +BLOCKED_UNDER_GENERATOR:6, +BLOCKED_ACTIVE_GENERATOR:7 +}; +bx.SymbolName=function(bF){ +var bG=bx; +for(var bH in bG){ +if(bG[bH]==bF){ +return bH; +} +} +}; +function Failure(ar){ +this.message=ar; +} +Failure.prototype.toString=function(){ +return"LiveEdit Failure: "+this.message; +}; +function CopyErrorPositionToDetails(bI,p){ +function createPositionStruct(L,bJ){ +if(bJ==-1)return; +var bK=L.locationFromPosition(bJ,true); +if(bK==null)return; +return{ +line:bK.line+1, +column:bK.column+1, +position:bJ +}; +} +if(!("scriptObject"in bI)||!("startPosition"in bI)){ +return; +} +var L=bI.scriptObject; +var bL={ +start:createPositionStruct(L,bI.startPosition), +end:createPositionStruct(L,bI.endPosition) +}; +p.position=bL; +} +function GetPcFromSourcePos(bM,bN){ +return %GetFunctionCodePositionFromSource(bM,bN); +} +function SetScriptSource(L,bO,bP,X){ +var j=L.source; +var bQ=CompareStrings(j,bO); +return ApplyPatchMultiChunk(L,bQ,bO,bP, +X); +} +function CompareStrings(bR,bS){ +return %LiveEditCompareStrings(bR,bS); +} +function ApplySingleChunkPatch(L,change_pos,change_len,new_str, +X){ +var j=L.source; +var bO=j.substring(0,change_pos)+ +new_str+j.substring(change_pos+change_len); +return ApplyPatchMultiChunk(L, +[change_pos,change_pos+change_len,change_pos+new_str.length], +bO,false,X); +} +function DescribeChangeTree(bc){ +function ProcessOldNode(w){ +var bT=[]; +for(var x=0;x>1); +var l=2|4|1; +for(var m=0;m>1); +for(var m=0;m>1)+(fields?fields.length:0); +if(t>=4){ +%OptimizeObjectForAddingMultipleProperties(s,t); +} +if(fields){ +for(var m=0;m=0&&h<0x800000){ +return h; +} +} +h=(g==null)?0:(g.length>>>0); +if(h>0x800000)throw %make_range_error(151); +if(g!=null&&!(%_IsSpecObject(g))){ +throw %make_type_error(122,"Function.prototype.apply"); +} +return h; +} +function REFLECT_APPLY_PREPARE(g){ +var h; +if(!(typeof(this)==='function')){ +throw %make_type_error(9,(%_ToString(this)),typeof this); +} +if((%_IsArray(g))){ +h=g.length; +if(%_IsSmi(h)&&h>=0&&h<0x800000){ +return h; +} +} +if(!(%_IsSpecObject(g))){ +throw %make_type_error(122,"Reflect.apply"); +} +h=(%ToLength(g.length)); +if(h>0x800000)throw %make_range_error(151); +return h; +} +function REFLECT_CONSTRUCT_PREPARE( +g,newTarget){ +var h; +var i=(typeof(this)==='function')&&%IsConstructor(this); +var j=(typeof(newTarget)==='function')&&%IsConstructor(newTarget); +if((%_IsArray(g))){ +h=g.length; +if(%_IsSmi(h)&&h>=0&&h<0x800000&& +i&&j){ +return h; +} +} +if(!i){ +if(!(typeof(this)==='function')){ +throw %make_type_error(13,(%_ToString(this))); +}else{ +throw %make_type_error(55,(%_ToString(this))); +} +} +if(!j){ +if(!(typeof(newTarget)==='function')){ +throw %make_type_error(13,(%_ToString(newTarget))); +}else{ +throw %make_type_error(55,(%_ToString(newTarget))); +} +} +if(!(%_IsSpecObject(g))){ +throw %make_type_error(122,"Reflect.construct"); +} +h=(%ToLength(g.length)); +if(h>0x800000)throw %make_range_error(151); +return h; +} +function CONCAT_ITERABLE_TO_ARRAY(k){ +return %concat_iterable_to_array(this,k); +}; +function ToBoolean(l){ +if((typeof(l)==='boolean'))return l; +if((typeof(l)==='string'))return l.length!=0; +if(l==null)return false; +if((typeof(l)==='number'))return!((l==0)||(!%_IsSmi(%IS_VAR(l))&&!(l==l))); +return true; +} +function ToNumber(l){ +if((typeof(l)==='number'))return l; +if((typeof(l)==='string')){ +return %_HasCachedArrayIndex(l)?%_GetCachedArrayIndex(l) +:%StringToNumber(l); +} +if((typeof(l)==='boolean'))return l?1:0; +if((l===(void 0)))return $NaN; +return((l===null))?0:ToNumber(DefaultNumber(l)); +} +function NonNumberToNumber(l){ +if((typeof(l)==='string')){ +return %_HasCachedArrayIndex(l)?%_GetCachedArrayIndex(l) +:%StringToNumber(l); +} +if((typeof(l)==='boolean'))return l?1:0; +if((l===(void 0)))return $NaN; +return((l===null))?0:ToNumber(DefaultNumber(l)); +} +function ToString(l){ +if((typeof(l)==='string'))return l; +if((typeof(l)==='number'))return %_NumberToString(l); +if((typeof(l)==='boolean'))return l?'true':'false'; +if((l===(void 0)))return'undefined'; +return((l===null))?'null':ToString(DefaultString(l)); +} +function SameValue(l,m){ +if(typeof l!=typeof m)return false; +if((typeof(l)==='number')){ +if((!%_IsSmi(%IS_VAR(l))&&!(l==l))&&(!%_IsSmi(%IS_VAR(m))&&!(m==m)))return true; +if(l===0&&m===0&&%_IsMinusZero(l)!=%_IsMinusZero(m)){ +return false; +} +} +if((%_IsSimdValue(l)))return %SimdSameValue(l,m); +return l===m; +} +function SameValueZero(l,m){ +if(typeof l!=typeof m)return false; +if((typeof(l)==='number')){ +if((!%_IsSmi(%IS_VAR(l))&&!(l==l))&&(!%_IsSmi(%IS_VAR(m))&&!(m==m)))return true; +} +if((%_IsSimdValue(l)))return %SimdSameValueZero(l,m); +return l===m; +} +function ConcatIterableToArray(n,k){ +var o=n.length; +for(var p of k){ +%AddElement(n,o++,p); +} +return n; +} +function IsPrimitive(l){ +return!(%_IsSpecObject(l)); +} +function IsConcatSpreadable(q){ +if(!(%_IsSpecObject(q)))return false; +var r=q[f]; +if((r===(void 0)))return(%_IsArray(q)); +return ToBoolean(r); +} +function DefaultNumber(l){ +var s=l.valueOf; +if((typeof(s)==='function')){ +var t=%_Call(s,l); +if((typeof(t)==='symbol'))throw MakeTypeError(115); +if((%_IsSimdValue(l)))throw MakeTypeError(117); +if(IsPrimitive(t))return t; +} +var u=l.toString; +if((typeof(u)==='function')){ +var v=%_Call(u,l); +if(IsPrimitive(v))return v; +} +throw MakeTypeError(16); +} +function DefaultString(l){ +if(!(%_ClassOf(l)==='Symbol')){ +if((typeof(l)==='symbol'))throw MakeTypeError(116); +var u=l.toString; +if((typeof(u)==='function')){ +var v=%_Call(u,l); +if(IsPrimitive(v))return v; +} +var s=l.valueOf; +if((typeof(s)==='function')){ +var t=%_Call(s,l); +if(IsPrimitive(t))return t; +} +} +throw MakeTypeError(16); +} +function ToPositiveInteger(l,w){ +var x=(%_IsSmi(%IS_VAR(l))?l:%NumberToIntegerMapMinusZero(ToNumber(l))); +if(x<0)throw MakeRangeError(w); +return x; +} +%FunctionSetPrototype(c,new c(0)); +$NaN=%GetRootNaN(); +$nonNumberToNumber=NonNumberToNumber; +$sameValue=SameValue; +$sameValueZero=SameValueZero; +$toNumber=ToNumber; +$toPositiveInteger=ToPositiveInteger; +%InstallToContext([ +"apply_prepare_builtin",APPLY_PREPARE, +"concat_iterable_to_array_builtin",CONCAT_ITERABLE_TO_ARRAY, +"reflect_apply_prepare_builtin",REFLECT_APPLY_PREPARE, +"reflect_construct_prepare_builtin",REFLECT_CONSTRUCT_PREPARE, +]); +%InstallToContext([ +"concat_iterable_to_array",ConcatIterableToArray, +"non_number_to_number",NonNumberToNumber, +"to_number_fun",ToNumber, +]); +b.Export(function(y){ +y.ToBoolean=ToBoolean; +y.ToNumber=ToNumber; +y.ToString=ToString; +}); +}) + +$v8natives†Ë +(function(a,b){ +%CheckIsBootstrapping(); +var c; +var d=a.Array; +var e=a.Boolean; +var f=a.Function; +var g=a.Number; +var h=a.Object; +var i=b.InternalArray; +var j=b.ImportNow("iterator_symbol"); +var k; +var l; +var m; +var n; +var o; +var p=b.ImportNow("ToBoolean"); +var q=b.ImportNow("ToNumber"); +var r=b.ImportNow("to_string_tag_symbol"); +b.Import(function(s){ +k=s.MathAbs; +o=s.StringIndexOf; +}); +b.ImportFromExperimental(function(s){ +c=s.FLAG_harmony_tostring; +l=s.ProxyDelegateCallAndConstruct; +m=s.ProxyDerivedHasOwnTrap; +n=s.ProxyDerivedKeysTrap; +}); +function GlobalIsNaN(t){ +t=((typeof(%IS_VAR(t))==='number')?t:$nonNumberToNumber(t)); +return(!%_IsSmi(%IS_VAR(t))&&!(t==t)); +} +function GlobalIsFinite(t){ +t=((typeof(%IS_VAR(t))==='number')?t:$nonNumberToNumber(t)); +return(%_IsSmi(%IS_VAR(t))||((t==t)&&(t!=1/0)&&(t!=-1/0))); +} +function GlobalParseInt(u,v){ +if((v===(void 0))||v===10||v===0){ +if(%_IsSmi(u))return u; +if((typeof(u)==='number')&& +((0.01>>0); +var am=false; +if((%_ToString(al))==Y&&al!=4294967295){ +var an=M.length; +if(al>=an&&%IsObserved(M)){ +am=true; +$observeBeginPerformSplice(M); +} +var ao=GetOwnPropertyJS(M,"length"); +if((al>=an&&!ao.isWritable())|| +!DefineObjectProperty(M,Y,J,true)){ +if(am) +$observeEndPerformSplice(M); +if(ab){ +throw MakeTypeError(27,Y); +}else{ +return false; +} +} +if(al>=an){ +M.length=al+1; +} +if(am){ +$observeEndPerformSplice(M); +$observeEnqueueSpliceRecord(M,an,[],al+1-an); +} +return true; +} +} +return DefineObjectProperty(M,Y,J,ab); +} +function DefineOwnProperty(M,Y,J,ab){ +if(%_IsJSProxy(M)){ +if((typeof(Y)==='symbol'))return false; +var z=FromGenericPropertyDescriptor(J); +return DefineProxyProperty(M,Y,z,ab); +}else if((%_IsArray(M))){ +return DefineArrayProperty(M,Y,J,ab); +}else{ +return DefineObjectProperty(M,Y,J,ab); +} +} +function DefineOwnPropertyFromAPI(M,Y,D,J){ +return DefineOwnProperty(M,Y,ToPropertyDescriptor({ +value:D, +writable:J[0], +enumerable:J[1], +configurable:J[2] +}), +false); +} +function ObjectGetPrototypeOf(M){ +return %_GetPrototype((%_ToObject(M))); +} +function ObjectSetPrototypeOf(M,ap){ +if((%IS_VAR(M)===null)||(M===(void 0)))throw MakeTypeError(15,"Object.setPrototypeOf"); +if(ap!==null&&!(%_IsSpecObject(ap))){ +throw MakeTypeError(83,ap); +} +if((%_IsSpecObject(M))){ +%SetPrototype(M,ap); +} +return M; +} +function ObjectGetOwnPropertyDescriptor(M,Y){ +var J=GetOwnPropertyJS((%_ToObject(M)),Y); +return FromPropertyDescriptor(J); +} +function ToNameArray(M,V,aq){ +if(!(%_IsSpecObject(M))){ +throw MakeTypeError(90,V,M); +} +var ar=(M.length>>>0); +var as=new d(ar); +var at=0; +var N={__proto__:null}; +for(var al=0;al36)throw MakeRangeError(153); +return %NumberToRadixString(t,v); +} +function NumberToLocaleString(){ +return %_CallFunction(this,NumberToStringJS); +} +function NumberValueOf(){ +if(!(typeof(this)==='number')&&!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(58,'Number.prototype.valueOf'); +} +return %_ValueOf(this); +} +function NumberToFixedJS(bc){ +var w=this; +if(!(typeof(this)==='number')){ +if(!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(36, +"Number.prototype.toFixed",this); +} +w=%_ValueOf(this); +} +var y=(%_ToInteger(bc)); +if(y<0||y>20){ +throw MakeRangeError(149,"toFixed() digits"); +} +if((!%_IsSmi(%IS_VAR(w))&&!(w==w)))return"NaN"; +if(w==(1/0))return"Infinity"; +if(w==-(1/0))return"-Infinity"; +return %NumberToFixed(w,y); +} +function NumberToExponentialJS(bc){ +var w=this; +if(!(typeof(this)==='number')){ +if(!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(36, +"Number.prototype.toExponential",this); +} +w=%_ValueOf(this); +} +var y=(bc===(void 0))?(void 0):(%_ToInteger(bc)); +if((!%_IsSmi(%IS_VAR(w))&&!(w==w)))return"NaN"; +if(w==(1/0))return"Infinity"; +if(w==-(1/0))return"-Infinity"; +if((y===(void 0))){ +y=-1; +}else if(y<0||y>20){ +throw MakeRangeError(149,"toExponential()"); +} +return %NumberToExponential(w,y); +} +function NumberToPrecisionJS(bd){ +var w=this; +if(!(typeof(this)==='number')){ +if(!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(36, +"Number.prototype.toPrecision",this); +} +w=%_ValueOf(this); +} +if((bd===(void 0)))return(%_ToString(w)); +var Y=(%_ToInteger(bd)); +if((!%_IsSmi(%IS_VAR(w))&&!(w==w)))return"NaN"; +if(w==(1/0))return"Infinity"; +if(w==-(1/0))return"-Infinity"; +if(Y<1||Y>21){ +throw MakeRangeError(152); +} +return %NumberToPrecision(w,Y); +} +function NumberIsFinite(t){ +return(typeof(t)==='number')&&(%_IsSmi(%IS_VAR(t))||((t==t)&&(t!=1/0)&&(t!=-1/0))); +} +function NumberIsInteger(t){ +return NumberIsFinite(t)&&(%_ToInteger(t))==t; +} +function NumberIsNaN(t){ +return(typeof(t)==='number')&&(!%_IsSmi(%IS_VAR(t))&&!(t==t)); +} +function NumberIsSafeInteger(t){ +if(NumberIsFinite(t)){ +var be=(%_ToInteger(t)); +if(be==t){ +return k(be)<=9007199254740991; +} +} +return false; +} +%SetCode(g,NumberConstructor); +%FunctionSetPrototype(g,new g(0)); +%OptimizeObjectForAddingMultipleProperties(g.prototype,8); +%AddNamedProperty(g.prototype,"constructor",g, +2); +b.InstallConstants(g,[ +"MAX_VALUE",1.7976931348623157e+308, +"MIN_VALUE",5e-324, +"NaN",$NaN, +"NEGATIVE_INFINITY",-(1/0), +"POSITIVE_INFINITY",(1/0), +"MAX_SAFE_INTEGER",%_MathPow(2,53)-1, +"MIN_SAFE_INTEGER",-%_MathPow(2,53)+1, +"EPSILON",%_MathPow(2,-52) +]); +b.InstallFunctions(g.prototype,2,[ +"toString",NumberToStringJS, +"toLocaleString",NumberToLocaleString, +"valueOf",NumberValueOf, +"toFixed",NumberToFixedJS, +"toExponential",NumberToExponentialJS, +"toPrecision",NumberToPrecisionJS +]); +b.InstallFunctions(g,2,[ +"isFinite",NumberIsFinite, +"isInteger",NumberIsInteger, +"isNaN",NumberIsNaN, +"isSafeInteger",NumberIsSafeInteger, +"parseInt",GlobalParseInt, +"parseFloat",GlobalParseFloat +]); +%SetForceInlineFlag(NumberIsNaN); +function NativeCodeFunctionSourceString(ac){ +var E=%FunctionGetName(ac); +if(E){ +return'function '+E+'() { [native code] }'; +} +return'function () { [native code] }'; +} +function FunctionSourceString(ac){ +while(%IsJSFunctionProxy(ac)){ +ac=%GetCallTrap(ac); +} +if(!(%_IsFunction(ac))){ +throw MakeTypeError(58,'Function.prototype.toString'); +} +if(%FunctionHidesSource(ac)){ +return NativeCodeFunctionSourceString(ac); +} +var bf=%ClassGetSourceCode(ac); +if((typeof(bf)==='string')){ +return bf; +} +var bg=%FunctionGetSourceCode(ac); +if(!(typeof(bg)==='string')){ +return NativeCodeFunctionSourceString(ac); +} +if(%FunctionIsArrow(ac)){ +return bg; +} +var E=%FunctionNameShouldPrintAsAnonymous(ac) +?'anonymous' +:%FunctionGetName(ac); +var bh=%FunctionIsGenerator(ac); +var bi=%FunctionIsConciseMethod(ac) +?(bh?'*':'') +:(bh?'function* ':'function '); +return bi+E+bg; +} +function FunctionToString(){ +return FunctionSourceString(this); +} +function FunctionBind(bj){ +if(!(typeof(this)==='function'))throw MakeTypeError(33); +var bk=function(){ +"use strict"; +if(%_IsConstructCall()){ +return %NewObjectFromBound(bk); +} +var bl=%BoundFunctionGetBindings(bk); +var bm=%_ArgumentsLength(); +if(bm==0){ +return %Apply(bl[0],bl[1],bl,2,bl.length-2); +} +if(bl.length===2){ +return %Apply(bl[0],bl[1],arguments,0,bm); +} +var bn=bl.length-2; +var bo=new i(bn+bm); +for(var az=0;az>>0)===bq)){ +var bm=%_ArgumentsLength(); +if(bm>0)bm--; +bp=bq-bm; +if(bp<0)bp=0; +} +var ad=%FunctionBindArguments(bk,this, +bj,bp); +var E=this.name; +var br=(typeof(E)==='string')?E:""; +%DefineDataPropertyUnchecked(ad,"name","bound "+br, +2|1); +return ad; +} +function NewFunctionString(bs,bt){ +var ar=bs.length; +var Y=''; +if(ar>1){ +Y=(%_ToString(bs[0])); +for(var az=1;az0)?(%_ToString(bs[ar-1])):''; +return'('+bt+'('+Y+') {\n'+bu+'\n})'; +} +function FunctionConstructor(bv){ +var bg=NewFunctionString(arguments,'function'); +var x=%GlobalProxy(FunctionConstructor); +var y=%_CallFunction(x,%CompileString(bg,true)); +%FunctionMarkNameShouldPrintAsAnonymous(y); +return y; +} +%SetCode(f,FunctionConstructor); +%AddNamedProperty(f.prototype,"constructor",f, +2); +b.InstallFunctions(f.prototype,2,[ +"bind",FunctionBind, +"toString",FunctionToString +]); +function GetIterator(M,bw){ +if((bw===(void 0))){ +bw=M[j]; +} +if(!(typeof(bw)==='function')){ +throw MakeTypeError(59,M); +} +var bx=%_CallFunction(M,bw); +if(!(%_IsSpecObject(bx))){ +throw MakeTypeError(53,bx); +} +return bx; +} +b.Export(function(aV){ +aV.Delete=Delete; +aV.FunctionSourceString=FunctionSourceString; +aV.GetIterator=GetIterator; +aV.GetMethod=GetMethod; +aV.IsFinite=GlobalIsFinite; +aV.IsNaN=GlobalIsNaN; +aV.NewFunctionString=NewFunctionString; +aV.NumberIsNaN=NumberIsNaN; +aV.ObjectDefineProperties=ObjectDefineProperties; +aV.ObjectDefineProperty=ObjectDefineProperty; +aV.ObjectFreeze=ObjectFreezeJS; +aV.ObjectGetOwnPropertyKeys=ObjectGetOwnPropertyKeys; +aV.ObjectHasOwnProperty=ObjectHasOwnProperty; +aV.ObjectIsFrozen=ObjectIsFrozen; +aV.ObjectIsSealed=ObjectIsSealed; +aV.ObjectToString=ObjectToString; +aV.ToNameArray=ToNameArray; +}); +%InstallToContext([ +"global_eval_fun",GlobalEval, +"object_value_of",ObjectValueOf, +"object_to_string",ObjectToString, +"object_define_own_property",DefineOwnPropertyFromAPI, +"object_get_own_property_descriptor",ObjectGetOwnPropertyDescriptor, +"to_complete_property_descriptor",ToCompletePropertyDescriptor, +]); +}) + +symboly +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Object; +var d=a.Symbol; +var e=b.ImportNow("has_instance_symbol"); +var f= +b.ImportNow("is_concat_spreadable_symbol"); +var g=b.ImportNow("is_regexp_symbol"); +var h=b.ImportNow("iterator_symbol"); +var i; +var j=b.ImportNow("to_primitive_symbol"); +var k=b.ImportNow("to_string_tag_symbol"); +var l=b.ImportNow("unscopables_symbol"); +b.Import(function(m){ +i=m.ObjectGetOwnPropertyKeys; +}); +function SymbolToPrimitive(n){ +if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ +throw MakeTypeError(36, +"Symbol.prototype [ @@toPrimitive ]",this); +} +return %_ValueOf(this); +} +function SymbolToString(){ +if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ +throw MakeTypeError(36, +"Symbol.prototype.toString",this); +} +return %SymbolDescriptiveString(%_ValueOf(this)); +} +function SymbolValueOf(){ +if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ +throw MakeTypeError(36, +"Symbol.prototype.valueOf",this); +} +return %_ValueOf(this); +} +function SymbolFor(o){ +o=(%_ToString(o)); +var p=%SymbolRegistry(); +if((p.for[o]===(void 0))){ +var q=%CreateSymbol(o); +p.for[o]=q; +p.keyFor[q]=o; +} +return p.for[o]; +} +function SymbolKeyFor(q){ +if(!(typeof(q)==='symbol'))throw MakeTypeError(114,q); +return %SymbolRegistry().keyFor[q]; +} +function ObjectGetOwnPropertySymbols(r){ +r=(%_ToObject(r)); +return i(r,8); +} +%FunctionSetPrototype(d,new c()); +b.InstallConstants(d,[ +"iterator",h, +"toPrimitive",j, +"unscopables",l, +]); +b.InstallFunctions(d,2,[ +"for",SymbolFor, +"keyFor",SymbolKeyFor +]); +%AddNamedProperty( +d.prototype,"constructor",d,2); +%AddNamedProperty( +d.prototype,k,"Symbol",2|1); +b.InstallFunctions(d.prototype,2|1,[ +j,SymbolToPrimitive +]); +b.InstallFunctions(d.prototype,2,[ +"toString",SymbolToString, +"valueOf",SymbolValueOf +]); +b.InstallFunctions(c,2,[ +"getOwnPropertySymbols",ObjectGetOwnPropertySymbols +]); +b.Export(function(s){ +s.SymbolToString=SymbolToString; +}) +}) + +array’~ +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c; +var d=a.Array; +var e=b.InternalArray; +var f=b.InternalPackedArray; +var g; +var h; +var i; +var j; +var k; +var l; +var m; +var n=b.ImportNow("unscopables_symbol"); +b.Import(function(o){ +c=o.Delete; +g=o.MathMin; +h=o.ObjectHasOwnProperty; +i=o.ObjectIsFrozen; +j=o.ObjectIsSealed; +k=o.ObjectToString; +l=o.ToNumber; +m=o.ToString; +}); +var p=new e(); +function GetSortedArrayKeys(q,r){ +var s=new e(); +if((typeof(r)==='number')){ +var t=r; +for(var u=0;u>2; +var N=%EstimateNumberOfElements(q); +return(NN*4); +} +function Join(q,w,D,C){ +if(w==0)return''; +var K=(%_IsArray(q)); +if(K){ +if(!%PushIfAbsent(p,q))return''; +} +try{ +if(UseSparseVariant(q,w,K,w)){ +%NormalizeElements(q); +if(D.length==0){ +return SparseJoin(q,w,C); +}else{ +return SparseJoinWithSeparatorJS(q,w,C,D); +} +} +if(w==1){ +var v=q[0]; +if((typeof(v)==='string'))return v; +return C(v); +} +var F=new e(w); +if(D.length==0){ +var J=0; +for(var u=0;u=R){ +var U=q[y]; +if(!(U===(void 0))||y in q){ +%AddElement(T,y-R,U); +} +} +} +} +} +} +function SparseMove(q,R,S,B,V){ +if(V===S)return; +var W=new e( +g(B-S+V,0xffffffff)); +var X; +var r=%GetArrayKeys(q,B); +if((typeof(r)==='number')){ +var t=r; +for(var u=0;u=R+S){ +var U=q[y]; +if(!(U===(void 0))||y in q){ +var Y=y-S+V; +W[Y]=U; +if(Y>0xfffffffe){ +X=X||new e(); +X.push(Y); +} +} +} +} +} +} +%MoveArrayContents(W,q); +if(!(X===(void 0))){ +var w=X.length; +for(var u=0;uS){ +for(var u=B-S;u>R;u--){ +var aa=u+S-1; +var ab=u+V-1; +if(((K&&%_HasFastPackedElements(%IS_VAR(q)))?(aaB-S+V;u--){ +delete q[u-1]; +} +} +} +} +function ArrayToString(){ +var q; +var ac; +if((%_IsArray(this))){ +ac=this.join; +if(ac===ArrayJoin){ +return Join(this,this.length,',',ConvertToString); +} +q=this; +}else{ +q=(%_ToObject(this)); +ac=q.join; +} +if(!(typeof(ac)==='function')){ +return %_CallFunction(q,k); +} +return %_Call(ac,q); +} +function InnerArrayToLocaleString(q,w){ +var B=(harmony_tolength?(%ToLength(w)):(w>>>0)); +if(B===0)return""; +return Join(q,B,',',ConvertToLocaleString); +} +function ArrayToLocaleString(){ +var q=(%_ToObject(this)); +var ad=q.length; +return InnerArrayToLocaleString(q,ad); +} +function InnerArrayJoin(D,q,w){ +if((D===(void 0))){ +D=','; +}else{ +D=(%_ToString(D)); +} +var O=%_FastOneByteArrayJoin(q,D); +if(!(O===(void 0)))return O; +if(w===1){ +var v=q[0]; +if((v==null))return''; +return(%_ToString(v)); +} +return Join(q,w,D,ConvertToString); +} +function ArrayJoin(D){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.join"); +var q=(%_ToObject(this)); +var w=(harmony_tolength?(%ToLength(q.length)):(q.length>>>0)); +return InnerArrayJoin(D,q,w); +} +function ObservedArrayPop(ae){ +ae--; +var af=this[ae]; +try{ +$observeBeginPerformSplice(this); +delete this[ae]; +this.length=ae; +}finally{ +$observeEndPerformSplice(this); +$observeEnqueueSpliceRecord(this,ae,[af],0); +} +return af; +} +function ArrayPop(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.pop"); +var q=(%_ToObject(this)); +var ae=(harmony_tolength?(%ToLength(q.length)):(q.length>>>0)); +if(ae==0){ +q.length=ae; +return; +} +if(%IsObserved(q)) +return ObservedArrayPop.call(q,ae); +ae--; +var af=q[ae]; +c(q,ae,true); +q.length=ae; +return af; +} +function ObservedArrayPush(){ +var ae=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); +var ag=%_ArgumentsLength(); +try{ +$observeBeginPerformSplice(this); +for(var u=0;u>>0)); +var ag=%_ArgumentsLength(); +for(var u=0;u=u){ +am=u; +while(s[++aj]==u){} +an=B-u-1; +} +var ao=q[am]; +if(!(ao===(void 0))||am in q){ +var ap=q[an]; +if(!(ap===(void 0))||an in q){ +q[am]=ap; +q[an]=ao; +}else{ +q[an]=ao; +delete q[am]; +} +}else{ +var ap=q[an]; +if(!(ap===(void 0))||an in q){ +q[am]=ap; +delete q[an]; +} +} +} +} +function PackedArrayReverse(q,B){ +var ak=B-1; +for(var u=0;u>>0)); +var aq=(%_IsArray(q)); +if(UseSparseVariant(q,B,aq,B)){ +%NormalizeElements(q); +SparseReverse(q,B); +return q; +}else if(aq&&%_HasFastPackedElements(q)){ +return PackedArrayReverse(q,B); +}else{ +return GenericArrayReverse(q,B); +} +} +function ObservedArrayShift(B){ +var ar=this[0]; +try{ +$observeBeginPerformSplice(this); +SimpleMove(this,0,1,B,0); +this.length=B-1; +}finally{ +$observeEndPerformSplice(this); +$observeEnqueueSpliceRecord(this,0,[ar],0); +} +return ar; +} +function ArrayShift(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.shift"); +var q=(%_ToObject(this)); +var B=(harmony_tolength?(%ToLength(q.length)):(q.length>>>0)); +if(B===0){ +q.length=0; +return; +} +if(j(q))throw MakeTypeError(11); +if(%IsObserved(q)) +return ObservedArrayShift.call(q,B); +var ar=q[0]; +if(UseSparseVariant(q,B,(%_IsArray(q)),B)){ +SparseMove(q,0,1,B,0); +}else{ +SimpleMove(q,0,1,B,0); +} +q.length=B-1; +return ar; +} +function ObservedArrayUnshift(){ +var B=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); +var as=%_ArgumentsLength(); +try{ +$observeBeginPerformSplice(this); +SimpleMove(this,0,0,B,as); +for(var u=0;u>>0)); +var as=%_ArgumentsLength(); +if(B>0&&UseSparseVariant(q,B,(%_IsArray(q)),B)&& +!j(q)){ +SparseMove(q,0,0,B,as); +}else{ +SimpleMove(q,0,0,B,as); +} +for(var u=0;u>>0)); +var R=(%_ToInteger(au)); +var aw=B; +if(!(av===(void 0)))aw=(%_ToInteger(av)); +if(R<0){ +R+=B; +if(R<0)R=0; +}else{ +if(R>B)R=B; +} +if(aw<0){ +aw+=B; +if(aw<0)aw=0; +}else{ +if(aw>B)aw=B; +} +var O=[]; +if(awB?B:R; +} +function ComputeSpliceDeleteCount(ax,as,B,R){ +var S=0; +if(as==1) +return B-R; +S=(%_ToInteger(ax)); +if(S<0) +return 0; +if(S>B-R) +return B-R; +return S; +} +function ObservedArraySplice(au,ax){ +var as=%_ArgumentsLength(); +var B=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); +var R=ComputeSpliceStartIndex((%_ToInteger(au)),B); +var S=ComputeSpliceDeleteCount(ax,as,B, +R); +var T=[]; +T.length=S; +var ay=as>2?as-2:0; +try{ +$observeBeginPerformSplice(this); +SimpleSlice(this,R,S,B,T); +SimpleMove(this,R,S,B,ay); +var u=R; +var az=2; +var aA=%_ArgumentsLength(); +while(az>>0)); +var R=ComputeSpliceStartIndex((%_ToInteger(au)),B); +var S=ComputeSpliceDeleteCount(ax,as,B, +R); +var T=[]; +T.length=S; +var ay=as>2?as-2:0; +if(S!=ay&&j(q)){ +throw MakeTypeError(11); +}else if(S>0&&i(q)){ +throw MakeTypeError(10); +} +var aB=S; +if(ay!=S){ +aB+=B-R-S; +} +if(UseSparseVariant(q,B,(%_IsArray(q)),aB)){ +%NormalizeElements(q); +%NormalizeElements(T); +SparseSlice(q,R,S,B,T); +SparseMove(q,R,S,B,ay); +}else{ +SimpleSlice(q,R,S,B,T); +SimpleMove(q,R,S,B,ay); +} +var u=R; +var az=2; +var aA=%_ArgumentsLength(); +while(az=o;ak--){ +var aH=z[ak]; +var aI=aC(aH,aG); +if(aI>0){ +z[ak+1]=aH; +}else{ +break; +} +} +z[ak+1]=aG; +} +}; +var aJ=function(z,o,aF){ +var aK=new e(); +var aL=200+((aF-o)&15); +var ak=0; +o+=1; +aF-=1; +for(var u=o;u>1][0]; +return aM; +} +var aN=function QuickSort(z,o,aF){ +var aM=0; +while(true){ +if(aF-o<=10){ +aE(z,o,aF); +return; +} +if(aF-o>1000){ +aM=aJ(z,o,aF); +}else{ +aM=o+((aF-o)>>1); +} +var aO=z[o]; +var aP=z[aF-1]; +var aQ=z[aM]; +var aR=aC(aO,aP); +if(aR>0){ +var aH=aO; +aO=aP; +aP=aH; +} +var aS=aC(aO,aQ); +if(aS>=0){ +var aH=aO; +aO=aQ; +aQ=aP; +aP=aH; +}else{ +var aT=aC(aP,aQ); +if(aT>0){ +var aH=aP; +aP=aQ; +aQ=aH; +} +} +z[o]=aO; +z[aF-1]=aQ; +var aU=aP; +var aV=o+1; +var aW=aF-1; +z[aM]=z[aV]; +z[aV]=aU; +partition:for(var u=aV+1;u0){ +do{ +aW--; +if(aW==u)break partition; +var aX=z[aW]; +aI=aC(aX,aU); +}while(aI>0); +z[u]=z[aW]; +z[aW]=aG; +if(aI<0){ +aG=z[u]; +z[u]=z[aV]; +z[aV]=aG; +aV++; +} +} +} +if(aF-aW=ba){ba=u+1;} +} +} +}else{ +for(var u=0;u=ba){ba=Z+1;} +} +} +} +} +return ba; +}; +var bd=function(aZ,o,aF){ +for(var bb=%_GetPrototype(aZ);bb;bb=%_GetPrototype(bb)){ +var r=%GetArrayKeys(bb,aF); +if((typeof(r)==='number')){ +var bc=r; +for(var u=o;u>>0)); +return InnerArraySort(q,w,aC); +} +function InnerArrayFilter(bk,bl,q,w){ +if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); +var bm=new e(); +var bn=0; +var K=(%_IsArray(q)); +var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); +for(var u=0;u>>0)); +return InnerArrayFilter(bk,bl,q,w); +} +function InnerArrayForEach(bk,bl,q,w){ +if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); +var K=(%_IsArray(q)); +var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); +for(var u=0;u>>0)); +InnerArrayForEach(bk,bl,q,w); +} +function InnerArraySome(bk,bl,q,w){ +if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); +var K=(%_IsArray(q)); +var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); +for(var u=0;u>>0)); +return InnerArraySome(bk,bl,q,w); +} +function InnerArrayEvery(bk,bl,q,w){ +if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); +var K=(%_IsArray(q)); +var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); +for(var u=0;u>>0)); +return InnerArrayEvery(bk,bl,q,w); +} +function InnerArrayMap(bk,bl,q,w){ +if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); +var bm=new e(w); +var K=(%_IsArray(q)); +var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); +for(var u=0;u>>0)); +return InnerArrayMap(bk,bl,q,w); +} +function InnerArrayIndexOf(q,aG,Z,w){ +if(w==0)return-1; +if((Z===(void 0))){ +Z=0; +}else{ +Z=(%_ToInteger(Z)); +if(Z<0){ +Z=w+Z; +if(Z<0)Z=0; +} +} +var bp=Z; +var ba=w; +if(UseSparseVariant(q,w,(%_IsArray(q)),ba-bp)){ +%NormalizeElements(q); +var r=%GetArrayKeys(q,w); +if((typeof(r)==='number')){ +ba=r; +}else{ +if(r.length==0)return-1; +var bq=GetSortedArrayKeys(q,r); +var ae=bq.length; +var u=0; +while(u>>0)); +return InnerArrayIndexOf(this,aG,Z,w); +} +function InnerArrayLastIndexOf(q,aG,Z,w,br){ +if(w==0)return-1; +if(br<2){ +Z=w-1; +}else{ +Z=(%_ToInteger(Z)); +if(Z<0)Z+=w; +if(Z<0)return-1; +else if(Z>=w)Z=w-1; +} +var bp=0; +var ba=Z; +if(UseSparseVariant(q,w,(%_IsArray(q)),Z)){ +%NormalizeElements(q); +var r=%GetArrayKeys(q,Z+1); +if((typeof(r)==='number')){ +ba=r; +}else{ +if(r.length==0)return-1; +var bq=GetSortedArrayKeys(q,r); +var u=bq.length-1; +while(u>=0){ +var y=bq[u]; +if(!(y===(void 0))&&q[y]===aG)return y; +u--; +} +return-1; +} +} +if(!(aG===(void 0))){ +for(var u=ba;u>=bp;u--){ +if(q[u]===aG)return u; +} +return-1; +} +for(var u=ba;u>=bp;u--){ +if((q[u]===(void 0))&&u in q){ +return u; +} +} +return-1; +} +function ArrayLastIndexOf(aG,Z){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.lastIndexOf"); +var w=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); +return InnerArrayLastIndexOf(this,aG,Z,w, +%_ArgumentsLength()); +} +function InnerArrayReduce(bs,U,q,w,br){ +if(!(typeof(bs)==='function')){ +throw MakeTypeError(13,bs); +} +var K=(%_IsArray(q)); +var u=0; +find_initial:if(br<2){ +for(;u>>0)); +return InnerArrayReduce(bs,U,q,w, +%_ArgumentsLength()); +} +function InnerArrayReduceRight(bs,U,q,w, +br){ +if(!(typeof(bs)==='function')){ +throw MakeTypeError(13,bs); +} +var K=(%_IsArray(q)); +var u=w-1; +find_initial:if(br<2){ +for(;u>=0;u--){ +if(((K&&%_HasFastPackedElements(%IS_VAR(q)))?(u=0;u--){ +if(((K&&%_HasFastPackedElements(%IS_VAR(q)))?(u>>0)); +return InnerArrayReduceRight(bs,U,q,w, +%_ArgumentsLength()); +} +function ArrayIsArray(aZ){ +return(%_IsArray(aZ)); +} +%AddNamedProperty(d.prototype,"constructor",d, +2); +var bt={ +__proto__:null, +copyWithin:true, +entries:true, +fill:true, +find:true, +findIndex:true, +keys:true, +}; +%AddNamedProperty(d.prototype,n,bt, +2|1); +b.InstallFunctions(d,2,[ +"isArray",ArrayIsArray +]); +var bu=%SpecialArrayFunctions(); +var bv=function(bw,bx,B){ +var bk=bx; +if(bu.hasOwnProperty(bw)){ +bk=bu[bw]; +} +if(!(B===(void 0))){ +%FunctionSetLength(bk,B); +} +return bk; +}; +b.InstallFunctions(d.prototype,2,[ +"toString",bv("toString",ArrayToString), +"toLocaleString",bv("toLocaleString",ArrayToLocaleString), +"join",bv("join",ArrayJoin), +"pop",bv("pop",ArrayPop), +"push",bv("push",ArrayPush,1), +"reverse",bv("reverse",ArrayReverse), +"shift",bv("shift",ArrayShift), +"unshift",bv("unshift",ArrayUnshift,1), +"slice",bv("slice",ArraySlice,2), +"splice",bv("splice",ArraySplice,2), +"sort",bv("sort",ArraySort), +"filter",bv("filter",ArrayFilter,1), +"forEach",bv("forEach",ArrayForEach,1), +"some",bv("some",ArraySome,1), +"every",bv("every",ArrayEvery,1), +"map",bv("map",ArrayMap,1), +"indexOf",bv("indexOf",ArrayIndexOf,1), +"lastIndexOf",bv("lastIndexOf",ArrayLastIndexOf,1), +"reduce",bv("reduce",ArrayReduce,1), +"reduceRight",bv("reduceRight",ArrayReduceRight,1) +]); +%FinishArrayPrototypeSetup(d.prototype); +b.SetUpLockedPrototype(e,d(),[ +"indexOf",bv("indexOf",ArrayIndexOf), +"join",bv("join",ArrayJoin), +"pop",bv("pop",ArrayPop), +"push",bv("push",ArrayPush), +"shift",bv("shift",ArrayShift), +"sort",bv("sort",ArraySort), +"splice",bv("splice",ArraySplice) +]); +b.SetUpLockedPrototype(f,d(),[ +"join",bv("join",ArrayJoin), +"pop",bv("pop",ArrayPop), +"push",bv("push",ArrayPush), +"shift",bv("shift",ArrayShift) +]); +b.Export(function(aF){ +aF.ArrayIndexOf=ArrayIndexOf; +aF.ArrayJoin=ArrayJoin; +aF.ArrayPush=ArrayPush; +aF.ArrayToString=ArrayToString; +aF.InnerArrayEvery=InnerArrayEvery; +aF.InnerArrayFilter=InnerArrayFilter; +aF.InnerArrayForEach=InnerArrayForEach; +aF.InnerArrayIndexOf=InnerArrayIndexOf; +aF.InnerArrayJoin=InnerArrayJoin; +aF.InnerArrayLastIndexOf=InnerArrayLastIndexOf; +aF.InnerArrayMap=InnerArrayMap; +aF.InnerArrayReduce=InnerArrayReduce; +aF.InnerArrayReduceRight=InnerArrayReduceRight; +aF.InnerArraySome=InnerArraySome; +aF.InnerArraySort=InnerArraySort; +aF.InnerArrayToLocaleString=InnerArrayToLocaleString; +aF.PackedArrayReverse=PackedArrayReverse; +}); +%InstallToContext([ +"array_pop",ArrayPop, +"array_push",ArrayPush, +"array_shift",ArrayShift, +"array_splice",ArraySplice, +"array_slice",ArraySlice, +"array_unshift",ArrayUnshift, +]); +}); + +string¶ +(function(a,b){ +%CheckIsBootstrapping(); +var c; +var d; +var e=a.RegExp; +var f=a.String; +var g=b.InternalArray; +var h=b.InternalPackedArray; +var i; +var j; +var k; +var l; +b.Import(function(m){ +c=m.ArrayIndexOf; +d=m.ArrayJoin; +i=m.RegExpExec; +j=m.RegExpExecNoTests; +k=m.RegExpLastMatchInfo; +l=m.ToNumber; +}); +function StringToString(){ +if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){ +throw MakeTypeError(58,'String.prototype.toString'); +} +return %_ValueOf(this); +} +function StringValueOf(){ +if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){ +throw MakeTypeError(58,'String.prototype.valueOf'); +} +return %_ValueOf(this); +} +function StringCharAtJS(n){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.charAt"); +var o=%_StringCharAt(this,n); +if(%_IsSmi(o)){ +o=%_StringCharAt((%_ToString(this)),(%_ToInteger(n))); +} +return o; +} +function StringCharCodeAtJS(n){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.charCodeAt"); +var o=%_StringCharCodeAt(this,n); +if(!%_IsSmi(o)){ +o=%_StringCharCodeAt((%_ToString(this)),(%_ToInteger(n))); +} +return o; +} +function StringConcat(p){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.concat"); +var q=%_ArgumentsLength(); +var r=(%_ToString(this)); +if(q===1){ +return r+(%_ToString(p)); +} +var s=new g(q+1); +s[0]=r; +for(var t=0;t1){ +x=%_Arguments(1); +x=(%_ToInteger(x)); +if(x<0)x=0; +if(x>w.length)x=w.length; +} +return %StringIndexOf(w,v,x); +} +function StringLastIndexOfJS(y){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.lastIndexOf"); +var z=(%_ToString(this)); +var A=z.length; +var y=(%_ToString(y)); +var B=y.length; +var x=A-B; +if(%_ArgumentsLength()>1){ +var C=l(%_Arguments(1)); +if(!(!%_IsSmi(%IS_VAR(C))&&!(C==C))){ +C=(%_ToInteger(C)); +if(C<0){ +C=0; +} +if(C+B0xFF&& +(typeof(M)==='string')&& +%StringIndexOf(M,'$',0)<0){ +return %StringReplaceOneCharWithString(w,L,M); +} +var Q=%StringIndexOf(w,L,0); +if(Q<0)return w; +var R=Q+L.length; +var o=%_SubString(w,0,Q); +if((typeof(M)==='function')){ +o+=M(L,Q,w); +}else{ +K[3]=Q; +K[4]=R; +o=ExpandReplacement((%_ToString(M)), +w, +K, +o); +} +return o+%_SubString(w,R,w.length); +} +function ExpandReplacement(S,w,T,o){ +var U=S.length; +var V=%StringIndexOf(S,'$',0); +if(V<0){ +if(U>0)o+=S; +return o; +} +if(V>0)o+=%_SubString(S,0,V); +while(true){ +var W='$'; +var C=V+1; +if(C=48&&X<=57){ +var Y=(X-48)<<1; +var Z=1; +var aa=((T)[0]); +if(C+1=48&&V<=57){ +var ab=Y*10+((V-48)<<1); +if(ab=0){ +o+= +%_SubString(w,Q,T[(3+(Y+1))]); +} +C+=Z; +}else{ +o+='$'; +} +}else{ +o+='$'; +} +}else{ +o+='$'; +} +V=%StringIndexOf(S,'$',C); +if(V<0){ +if(CC){ +o+=%_SubString(S,C,V); +} +} +return o; +} +function CaptureString(S,ac,x){ +var ad=x<<1; +var Q=ac[(3+(ad))]; +if(Q<0)return; +var R=ac[(3+(ad+1))]; +return %_SubString(S,Q,R); +} +var ae=new g(4); +function StringReplaceGlobalRegExpWithFunction(w,D,M){ +var af=ae; +if(af){ +ae=null; +}else{ +af=new g(16); +} +var ag=%RegExpExecMultiple(D, +w, +k, +af); +D.lastIndex=0; +if((ag===null)){ +ae=af; +return w; +} +var q=ag.length; +if(((k)[0])==2){ +var ah=0; +var ai=new h(null,0,w); +for(var t=0;t0){ +ah=(aj>>11)+(aj&0x7ff); +}else{ +ah=ag[++t]-aj; +} +}else{ +ai[0]=aj; +ai[1]=ah; +$regexpLastMatchInfoOverride=ai; +var ak=M(aj,ah,w); +ag[t]=(%_ToString(ak)); +ah+=aj.length; +} +} +}else{ +for(var t=0;t>1; +var an; +if(am==1){ +var F=%_SubString(w,x,al); +an=M(F,x,w); +}else{ +var ao=new g(am+2); +for(var ap=0;apar){ +return''; +} +} +if(at<0){ +at+=ar; +if(at<0){ +return''; +} +}else{ +if(at>ar){ +at=ar; +} +} +if(at<=as){ +return''; +} +return %_SubString(F,as,at); +} +function StringSplitJS(au,av){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.split"); +var w=(%_ToString(this)); +av=((av===(void 0)))?0xffffffff:(av>>>0); +var U=w.length; +if(!(%_IsRegExp(au))){ +var aw=(%_ToString(au)); +if(av===0)return[]; +if((au===(void 0)))return[w]; +var ax=aw.length; +if(ax===0)return %StringToArray(w,av); +var o=%StringSplit(w,aw,av); +return o; +} +if(av===0)return[]; +return StringSplitOnRegExp(w,au,av,U); +} +function StringSplitOnRegExp(w,au,av,U){ +if(U===0){ +if(i(au,w,0,0)!=null){ +return[]; +} +return[w]; +} +var ay=0; +var az=0; +var aA=0; +var o=new g(); +outer_loop: +while(true){ +if(az===U){ +o[o.length]=%_SubString(w,ay,U); +break; +} +var T=i(au,w,az); +if(T==null||U===(aA=T[3])){ +o[o.length]=%_SubString(w,ay,U); +break; +} +var aB=T[4]; +if(az===aB&&aB===ay){ +az++; +continue; +} +o[o.length]=%_SubString(w,ay,aA); +if(o.length===av)break; +var aC=((T)[0])+3; +for(var t=3+2;tar){ +as=ar; +} +var at=ar; +if(!(R===(void 0))){ +at=(%_ToInteger(R)); +if(at>ar){ +at=ar; +}else{ +if(at<0)at=0; +if(as>at){ +var aE=at; +at=as; +as=aE; +} +} +} +return %_SubString(F,as,at); +} +function StringSubstr(Q,aF){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.substr"); +var F=(%_ToString(this)); +var q; +if((aF===(void 0))){ +q=F.length; +}else{ +q=(%_ToInteger(aF)); +if(q<=0)return''; +} +if((Q===(void 0))){ +Q=0; +}else{ +Q=(%_ToInteger(Q)); +if(Q>=F.length)return''; +if(Q<0){ +Q+=F.length; +if(Q<0)Q=0; +} +} +var R=Q+q; +if(R>F.length)R=F.length; +return %_SubString(F,Q,R); +} +function StringToLowerCaseJS(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toLowerCase"); +return %StringToLowerCase((%_ToString(this))); +} +function StringToLocaleLowerCase(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toLocaleLowerCase"); +return %StringToLowerCase((%_ToString(this))); +} +function StringToUpperCaseJS(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toUpperCase"); +return %StringToUpperCase((%_ToString(this))); +} +function StringToLocaleUpperCase(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toLocaleUpperCase"); +return %StringToUpperCase((%_ToString(this))); +} +function StringTrimJS(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.trim"); +return %StringTrim((%_ToString(this)),true,true); +} +function StringTrimLeft(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.trimLeft"); +return %StringTrim((%_ToString(this)),true,false); +} +function StringTrimRight(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.trimRight"); +return %StringTrim((%_ToString(this)),false,true); +} +function StringFromCharCode(aG){ +var aF=%_ArgumentsLength(); +if(aF==1){ +if(!%_IsSmi(aG))aG=l(aG); +return %_StringCharFromCode(aG&0xffff); +} +var aH=%NewString(aF,true); +var t; +for(t=0;t0xff)break; +%_OneByteSeqStringSetChar(t,aG,aH); +} +if(t==aF)return aH; +aH=%TruncateString(aH,t); +var aI=%NewString(aF-t,false); +for(var ap=0;t"+(%_ToString(this))+ +""; +} +function StringBig(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.big"); +return""+(%_ToString(this))+""; +} +function StringBlink(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.blink"); +return""+(%_ToString(this))+""; +} +function StringBold(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.bold"); +return""+(%_ToString(this))+""; +} +function StringFixed(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.fixed"); +return""+(%_ToString(this))+""; +} +function StringFontcolor(aL){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.fontcolor"); +return""+(%_ToString(this))+ +""; +} +function StringFontsize(aM){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.fontsize"); +return""+(%_ToString(this))+ +""; +} +function StringItalics(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.italics"); +return""+(%_ToString(this))+""; +} +function StringLink(F){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.link"); +return""+(%_ToString(this))+""; +} +function StringSmall(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.small"); +return""+(%_ToString(this))+""; +} +function StringStrike(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.strike"); +return""+(%_ToString(this))+""; +} +function StringSub(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.sub"); +return""+(%_ToString(this))+""; +} +function StringSup(){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.sup"); +return""+(%_ToString(this))+""; +} +function StringRepeat(aN){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.repeat"); +var F=(%_ToString(this)); +var aF=(%_ToInteger(aN)); +if(aF<0||aF>%_MaxSmi())throw MakeRangeError(133); +var aO=""; +while(true){ +if(aF&1)aO+=F; +aF>>=1; +if(aF===0)return aO; +F+=F; +} +} +function StringStartsWith(aP){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.startsWith"); +var F=(%_ToString(this)); +if((%_IsRegExp(aP))){ +throw MakeTypeError(31,"String.prototype.startsWith"); +} +var aQ=(%_ToString(aP)); +var n=0; +if(%_ArgumentsLength()>1){ +var aR=%_Arguments(1); +if(!(aR===(void 0))){ +n=(%_ToInteger(aR)); +} +} +var ar=F.length; +if(n<0)n=0; +if(n>ar)n=ar; +var aS=aQ.length; +if(aS+n>ar){ +return false; +} +for(var t=0;t1){ +var aR=%_Arguments(1); +if(!(aR===(void 0))){ +n=(%_ToInteger(aR)); +} +} +if(n<0)n=0; +if(n>ar)n=ar; +var aS=aQ.length; +n=n-aS; +if(n<0){ +return false; +} +for(var t=0;t1){ +n=%_Arguments(1); +n=(%_ToInteger(n)); +} +var aT=S.length; +if(n<0)n=0; +if(n>aT)n=aT; +var aU=aP.length; +if(aU+n>aT){ +return false; +} +return %StringIndexOf(S,aP,n)!==-1; +} +function StringCodePointAt(n){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.codePointAt"); +var S=(%_ToString(this)); +var aM=S.length; +n=(%_ToInteger(n)); +if(n<0||n>=aM){ +return(void 0); +} +var aV=%_StringCharCodeAt(S,n); +if(aV<0xD800||aV>0xDBFF||n+1==aM){ +return aV; +} +var aW=%_StringCharCodeAt(S,n+1); +if(aW<0xDC00||aW>0xDFFF){ +return aV; +} +return(aV-0xD800)*0x400+aW+0x2400; +} +function StringFromCodePoint(aX){ +var aG; +var U=%_ArgumentsLength(); +var x; +var o=""; +for(x=0;x0x10FFFF||aG!==(%_ToInteger(aG))){ +throw MakeRangeError(132,aG); +} +if(aG<=0xFFFF){ +o+=%_StringCharFromCode(aG); +}else{ +aG-=0x10000; +o+=%_StringCharFromCode((aG>>>10)&0x3FF|0xD800); +o+=%_StringCharFromCode(aG&0x3FF|0xDC00); +} +} +return o; +} +function StringRaw(aY){ +var aZ=%_ArgumentsLength(); +var ba=(%_ToObject(aY)); +var bb=(%_ToObject(ba.raw)); +var bc=(%ToLength(bb.length)); +if(bc<=0)return""; +var o=(%_ToString(bb[0])); +for(var t=1;t=48&&f<=57)return f-48; +if(f>=65&&f<=70)return f-55; +if(f>=97&&f<=102)return f-87; +return-1; +} +function isAlphaNumeric(g){ +if(97<=g&&g<=122)return true; +if(65<=g&&g<=90)return true; +if(48<=g&&g<=57)return true; +return false; +} +var h=0; +function URIAddEncodedOctetToBuffer(i,j,k){ +j[k++]=37; +j[k++]=h[i>>4]; +j[k++]=h[i&0x0F]; +return k; +} +function URIEncodeOctets(l,j,k){ +if(h===0){ +h=[48,49,50,51,52,53,54,55,56,57, +65,66,67,68,69,70]; +} +k=URIAddEncodedOctetToBuffer(l[0],j,k); +if(l[1])k=URIAddEncodedOctetToBuffer(l[1],j,k); +if(l[2])k=URIAddEncodedOctetToBuffer(l[2],j,k); +if(l[3])k=URIAddEncodedOctetToBuffer(l[3],j,k); +return k; +} +function URIEncodeSingle(g,j,k){ +var m=(g>>12)&0xF; +var n=(g>>6)&63; +var o=g&63; +var l=new d(3); +if(g<=0x007F){ +l[0]=g; +}else if(g<=0x07FF){ +l[0]=n+192; +l[1]=o+128; +}else{ +l[0]=m+224; +l[1]=n+128; +l[2]=o+128; +} +return URIEncodeOctets(l,j,k); +} +function URIEncodePair(p,q,j,k){ +var r=((p>>6)&0xF)+1; +var s=(p>>2)&0xF; +var m=p&3; +var n=(q>>6)&0xF; +var o=q&63; +var l=new d(4); +l[0]=(r>>2)+240; +l[1]=(((r&3)<<4)|s)+128; +l[2]=((m<<4)|n)+128; +l[3]=o+128; +return URIEncodeOctets(l,j,k); +} +function URIHexCharsToCharCode(t,u){ +var v=HexValueOf(t); +var w=HexValueOf(u); +if(v==-1||w==-1)throw MakeURIError(); +return(v<<4)|w; +} +function URIDecodeOctets(l,j,k){ +var x; +var y=l[0]; +if(y<0x80){ +x=y; +}else if(y<0xc2){ +throw MakeURIError(); +}else{ +var z=l[1]; +if(y<0xe0){ +var A=y&0x1f; +if((z<0x80)||(z>0xbf))throw MakeURIError(); +var B=z&0x3f; +x=(A<<6)+B; +if(x<0x80||x>0x7ff)throw MakeURIError(); +}else{ +var C=l[2]; +if(y<0xf0){ +var A=y&0x0f; +if((z<0x80)||(z>0xbf))throw MakeURIError(); +var B=z&0x3f; +if((C<0x80)||(C>0xbf))throw MakeURIError(); +var D=C&0x3f; +x=(A<<12)+(B<<6)+D; +if((x<0x800)||(x>0xffff))throw MakeURIError(); +}else{ +var E=l[3]; +if(y<0xf8){ +var A=(y&0x07); +if((z<0x80)||(z>0xbf))throw MakeURIError(); +var B=(z&0x3f); +if((C<0x80)||(C>0xbf)){ +throw MakeURIError(); +} +var D=(C&0x3f); +if((E<0x80)||(E>0xbf))throw MakeURIError(); +var F=(E&0x3f); +x=(A<<18)+(B<<12)+(D<<6)+F; +if((x<0x10000)||(x>0x10ffff))throw MakeURIError(); +}else{ +throw MakeURIError(); +} +} +} +} +if(0xD800<=x&&x<=0xDFFF)throw MakeURIError(); +if(x<0x10000){ +%_TwoByteSeqStringSetChar(k++,x,j); +}else{ +%_TwoByteSeqStringSetChar(k++,(x>>10)+0xd7c0,j); +%_TwoByteSeqStringSetChar(k++,(x&0x3ff)+0xdc00,j); +} +return k; +} +function Encode(G,H){ +G=(%_ToString(G)); +var I=G.length; +var J=new e(I); +var k=0; +for(var K=0;K=0xDC00&&p<=0xDFFF)throw MakeURIError(); +if(p<0xD800||p>0xDBFF){ +k=URIEncodeSingle(p,J,k); +}else{ +K++; +if(K==I)throw MakeURIError(); +var q=%_StringCharCodeAt(G,K); +if(q<0xDC00||q>0xDFFF)throw MakeURIError(); +k=URIEncodePair(p,q,J,k); +} +} +} +var j=%NewString(J.length,true); +for(var L=0;L=I)throw MakeURIError(); +var g=URIHexCharsToCharCode(%_StringCharCodeAt(G,K+1), +%_StringCharCodeAt(G,K+2)); +if(g>>7)break; +if(M(g)){ +%_OneByteSeqStringSetChar(k++,37,N); +%_OneByteSeqStringSetChar(k++,%_StringCharCodeAt(G,K+1), +N); +%_OneByteSeqStringSetChar(k++,%_StringCharCodeAt(G,K+2), +N); +}else{ +%_OneByteSeqStringSetChar(k++,g,N); +} +K+=2; +}else{ +if(f>0x7f)break; +%_OneByteSeqStringSetChar(k++,f,N); +} +} +N=%TruncateString(N,k); +if(K==I)return N; +var O=%NewString(I-K,false); +k=0; +for(;K=I)throw MakeURIError(); +var g=URIHexCharsToCharCode(%_StringCharCodeAt(G,++K), +%_StringCharCodeAt(G,++K)); +if(g>>7){ +var P=0; +while(((g<<++P)&0x80)!=0){} +if(P==1||P>4)throw MakeURIError(); +var l=new d(P); +l[0]=g; +if(K+3*(P-1)>=I)throw MakeURIError(); +for(var L=1;L0)?g:0-g; +} +function MathAcosJS(g){ +return %_MathAcos(+g); +} +function MathAsinJS(g){ +return %_MathAsin(+g); +} +function MathAtanJS(g){ +return %_MathAtan(+g); +} +function MathAtan2JS(h,g){ +h=+h; +g=+g; +return %_MathAtan2(h,g); +} +function MathCeil(g){ +return-%_MathFloor(-g); +} +function MathExp(g){ +return %MathExpRT(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g))); +} +function MathFloorJS(g){ +return %_MathFloor(+g); +} +function MathLog(g){ +return %_MathLogRT(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g))); +} +function MathMax(i,j){ +var k=%_ArgumentsLength(); +if(k==2){ +i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i)); +j=((typeof(%IS_VAR(j))==='number')?j:$nonNumberToNumber(j)); +if(j>i)return j; +if(i>j)return i; +if(i==j){ +return(i===0&&%_IsMinusZero(i))?j:i; +} +return $NaN; +} +var l=-(1/0); +for(var m=0;ml||(l===0&&n===0&&%_IsMinusZero(l))){ +l=n; +} +} +return l; +} +function MathMin(i,j){ +var k=%_ArgumentsLength(); +if(k==2){ +i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i)); +j=((typeof(%IS_VAR(j))==='number')?j:$nonNumberToNumber(j)); +if(j>i)return i; +if(i>j)return j; +if(i==j){ +return(i===0&&%_IsMinusZero(i))?i:j; +} +return $NaN; +} +var l=(1/0); +for(var m=0;m>>16))|0; +rngstate[0]=o; +var p=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0; +rngstate[1]=p; +var g=((o<<16)+(p&0xFFFF))|0; +return(g<0?(g+0x100000000):g)*2.3283064365386962890625e-10; +} +function MathRandomRaw(){ +var o=(MathImul(18030,rngstate[0]&0xFFFF)+(rngstate[0]>>>16))|0; +rngstate[0]=o; +var p=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0; +rngstate[1]=p; +var g=((o<<16)+(p&0xFFFF))|0; +return g&0x3fffffff; +} +function MathRound(g){ +return %RoundNumber(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g))); +} +function MathSqrtJS(g){ +return %_MathSqrt(+g); +} +function MathImul(g,h){ +return %NumberImul(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)),((typeof(%IS_VAR(h))==='number')?h:$nonNumberToNumber(h))); +} +function MathSign(g){ +g=+g; +if(g>0)return 1; +if(g<0)return-1; +return g; +} +function MathTrunc(g){ +g=+g; +if(g>0)return %_MathFloor(g); +if(g<0)return-%_MathFloor(-g); +return g; +} +function MathTanh(g){ +g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); +if(g===0)return g; +if(!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return MathSign(g); +var q=MathExp(g); +var r=MathExp(-g); +return(q-r)/(q+r); +} +function MathAsinh(g){ +g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); +if(g===0||!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return g; +if(g>0)return MathLog(g+%_MathSqrt(g*g+1)); +return-MathLog(-g+%_MathSqrt(g*g+1)); +} +function MathAcosh(g){ +g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); +if(g<1)return $NaN; +if(!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return g; +return MathLog(g+%_MathSqrt(g+1)*%_MathSqrt(g-1)); +} +function MathAtanh(g){ +g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); +if(g===0)return g; +if(!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return $NaN; +return 0.5*MathLog((1+g)/(1-g)); +} +function MathHypot(g,h){ +var k=%_ArgumentsLength(); +var s=new e(k); +var t=0; +for(var m=0;mt)t=n; +s[m]=n; +} +if(t===0)t=1; +var u=0; +var v=0; +for(var m=0;m>>0); +} +function MathCbrt(g){ +g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); +if(g==0||!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return g; +return g>=0?CubeRoot(g):-CubeRoot(-g); +} +function CubeRoot(g){ +var y=MathFloorJS(%_DoubleHi(g)/3)+0x2A9F7893; +var z=%_ConstructDouble(y,0); +z=(1.0/3.0)*(g/(z*z)+2*z); +; +z=(1.0/3.0)*(g/(z*z)+2*z); +; +z=(1.0/3.0)*(g/(z*z)+2*z); +; +return(1.0/3.0)*(g/(z*z)+2*z); +; +} +%AddNamedProperty(c,f,"Math",1|2); +b.InstallConstants(c,[ +"E",2.7182818284590452354, +"LN10",2.302585092994046, +"LN2",0.6931471805599453, +"LOG2E",1.4426950408889634, +"LOG10E",0.4342944819032518, +"PI",3.1415926535897932, +"SQRT1_2",0.7071067811865476, +"SQRT2",1.4142135623730951 +]); +b.InstallFunctions(c,2,[ +"random",MathRandom, +"abs",MathAbs, +"acos",MathAcosJS, +"asin",MathAsinJS, +"atan",MathAtanJS, +"ceil",MathCeil, +"exp",MathExp, +"floor",MathFloorJS, +"log",MathLog, +"round",MathRound, +"sqrt",MathSqrtJS, +"atan2",MathAtan2JS, +"pow",MathPowJS, +"max",MathMax, +"min",MathMin, +"imul",MathImul, +"sign",MathSign, +"trunc",MathTrunc, +"tanh",MathTanh, +"asinh",MathAsinh, +"acosh",MathAcosh, +"atanh",MathAtanh, +"hypot",MathHypot, +"fround",MathFroundJS, +"clz32",MathClz32JS, +"cbrt",MathCbrt +]); +%SetForceInlineFlag(MathAbs); +%SetForceInlineFlag(MathAcosJS); +%SetForceInlineFlag(MathAsinJS); +%SetForceInlineFlag(MathAtanJS); +%SetForceInlineFlag(MathAtan2JS); +%SetForceInlineFlag(MathCeil); +%SetForceInlineFlag(MathClz32JS); +%SetForceInlineFlag(MathFloorJS); +%SetForceInlineFlag(MathRandom); +%SetForceInlineFlag(MathSign); +%SetForceInlineFlag(MathSqrtJS); +%SetForceInlineFlag(MathTrunc); +b.Export(function(A){ +A.MathAbs=MathAbs; +A.MathExp=MathExp; +A.MathFloor=MathFloorJS; +A.IntRandom=MathRandomRaw; +A.MathMax=MathMax; +A.MathMin=MathMin; +}); +}) + +fdlibm-¨ +var kMath; +var rempio2result; +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Math; +var d; +var e; +b.Import(function(f){ +d=f.MathAbs; +e=f.MathExp; +}); + + + + + + + + + + + + + + + + + + + + + +function KernelTan(g,h,i){ +var j; +var k; +var l=%_DoubleHi(g); +var m=l&0x7fffffff; +if(m<0x3e300000){ +if(((m|%_DoubleLo(g))|(i+1))==0){ +return 1/d(g); +}else{ +if(i==1){ +return g; +}else{ +var k=g+h; +var j=%_ConstructDouble(%_DoubleHi(k),0); +var n=h-(j-g); +var o=-1/k; +var p=%_ConstructDouble(%_DoubleHi(o),0); +var q=1+p*j; +return p+o*(q+p*n); +} +} +} +if(m>=0x3fe59428){ +if(g<0){ +g=-g; +h=-h; +} +j=kMath[32]-g; +k=kMath[33]-h; +g=j+k; +h=0; +} +j=g*g; +k=j*j; +var r=kMath[19+1] ++k*(kMath[19+3] ++k*(kMath[19+5] ++ +k*(kMath[19+7] ++k*(kMath[19+9] ++k*kMath[19+11] +)))); +var n=j*(kMath[19+2] ++k*(kMath[19+4] ++k*(kMath[19+6] ++ +k*(kMath[19+8] ++k*(kMath[19+10] ++k*kMath[19+12] +))))); +var q=j*g; +r=h+j*(q*(r+n)+h); +r=r+kMath[19+0] +*q; +k=g+r; +if(m>=0x3fe59428){ +return(1-((l>>30)&2))* +(i-2.0*(g-(k*k/(k+i)-r))); +} +if(i==1){ +return k; +}else{ +j=%_ConstructDouble(%_DoubleHi(k),0); +n=r-(j-g); +var o=-1/k; +var p=%_ConstructDouble(%_DoubleHi(o),0); +q=1+p*j; +return p+o*(q+p*n); +} +} +function MathSinSlow(g){ +var s,t,u; +var l=%_DoubleHi(g); +var m=l&0x7fffffff; +if(m<0x4002d97c){ +if(l>0){ +var j=g-kMath[1]; +if(m!=0x3ff921fb){ +t=j-kMath[2]; +u=(j-t)-kMath[2]; +}else{ +j-=kMath[3]; +t=j-kMath[4]; +u=(j-t)-kMath[4]; +} +s=1; +}else{ +var j=g+kMath[1]; +if(m!=0x3ff921fb){ +t=j+kMath[2]; +u=(j-t)+kMath[2]; +}else{ +j+=kMath[3]; +t=j+kMath[4]; +u=(j-t)+kMath[4]; +} +s=-1; +} +}else if(m<=0x413921fb){ +var p=d(g); +s=(p*kMath[0]+0.5)|0; +var r=p-s*kMath[1]; +var k=s*kMath[2]; +t=r-k; +if(m-(%_DoubleHi(t)&0x7ff00000)>0x1000000){ +p=r; +k=s*kMath[3]; +r=p-k; +k=s*kMath[4]-((p-r)-k); +t=r-k; +if(m-(%_DoubleHi(t)&0x7ff00000)>0x3100000){ +p=r; +k=s*kMath[5]; +r=p-k; +k=s*kMath[6]-((p-r)-k); +t=r-k; +} +} +u=(r-t)-k; +if(l<0){ +s=-s; +t=-t; +u=-u; +} +}else{ +s=%RemPiO2(g,rempio2result); +t=rempio2result[0]; +u=rempio2result[1]; +} +; +var v=1-(s&2); +if(s&1){ +var m=%_DoubleHi(t)&0x7fffffff; +var j=t*t; +var r=j*(4.16666666666666019037e-02+j*(-1.38888888888741095749e-03+j*(2.48015872894767294178e-05+j*(-2.75573143513906633035e-07+j*(2.08757232129817482790e-09+j*-1.13596475577881948265e-11))))); +if(m<0x3fd33333){ +return(1-(0.5*j-(j*r-t*u)))*v; +}else{ +var w; +if(m>0x3fe90000){ +w=0.28125; +}else{ +w=%_ConstructDouble(%_DoubleHi(0.25*t),0); +} +var x=0.5*j-w; +return(1-w-(x-(j*r-t*u)))*v; +} +; +}else{ +var j=t*t; +var n=j*t; +var r=8.33333333332248946124e-03+j*(-1.98412698298579493134e-04+j*(2.75573137070700676789e-06+j*(-2.50507602534068634195e-08+j*1.58969099521155010221e-10))); +return(t-((j*(0.5*u-n*r)-u)-n*-1.66666666666666324348e-01))*v; +; +} +} +function MathCosSlow(g){ +var s,t,u; +var l=%_DoubleHi(g); +var m=l&0x7fffffff; +if(m<0x4002d97c){ +if(l>0){ +var j=g-kMath[1]; +if(m!=0x3ff921fb){ +t=j-kMath[2]; +u=(j-t)-kMath[2]; +}else{ +j-=kMath[3]; +t=j-kMath[4]; +u=(j-t)-kMath[4]; +} +s=1; +}else{ +var j=g+kMath[1]; +if(m!=0x3ff921fb){ +t=j+kMath[2]; +u=(j-t)+kMath[2]; +}else{ +j+=kMath[3]; +t=j+kMath[4]; +u=(j-t)+kMath[4]; +} +s=-1; +} +}else if(m<=0x413921fb){ +var p=d(g); +s=(p*kMath[0]+0.5)|0; +var r=p-s*kMath[1]; +var k=s*kMath[2]; +t=r-k; +if(m-(%_DoubleHi(t)&0x7ff00000)>0x1000000){ +p=r; +k=s*kMath[3]; +r=p-k; +k=s*kMath[4]-((p-r)-k); +t=r-k; +if(m-(%_DoubleHi(t)&0x7ff00000)>0x3100000){ +p=r; +k=s*kMath[5]; +r=p-k; +k=s*kMath[6]-((p-r)-k); +t=r-k; +} +} +u=(r-t)-k; +if(l<0){ +s=-s; +t=-t; +u=-u; +} +}else{ +s=%RemPiO2(g,rempio2result); +t=rempio2result[0]; +u=rempio2result[1]; +} +; +if(s&1){ +var v=(s&2)-1; +var j=t*t; +var n=j*t; +var r=8.33333333332248946124e-03+j*(-1.98412698298579493134e-04+j*(2.75573137070700676789e-06+j*(-2.50507602534068634195e-08+j*1.58969099521155010221e-10))); +return(t-((j*(0.5*u-n*r)-u)-n*-1.66666666666666324348e-01))*v; +; +}else{ +var v=1-(s&2); +var m=%_DoubleHi(t)&0x7fffffff; +var j=t*t; +var r=j*(4.16666666666666019037e-02+j*(-1.38888888888741095749e-03+j*(2.48015872894767294178e-05+j*(-2.75573143513906633035e-07+j*(2.08757232129817482790e-09+j*-1.13596475577881948265e-11))))); +if(m<0x3fd33333){ +return(1-(0.5*j-(j*r-t*u)))*v; +}else{ +var w; +if(m>0x3fe90000){ +w=0.28125; +}else{ +w=%_ConstructDouble(%_DoubleHi(0.25*t),0); +} +var x=0.5*j-w; +return(1-w-(x-(j*r-t*u)))*v; +} +; +} +} +function MathSin(g){ +g=+g; +if((%_DoubleHi(g)&0x7fffffff)<=0x3fe921fb){ +var j=g*g; +var n=j*g; +var r=8.33333333332248946124e-03+j*(-1.98412698298579493134e-04+j*(2.75573137070700676789e-06+j*(-2.50507602534068634195e-08+j*1.58969099521155010221e-10))); +return(g-((j*(0.5*0-n*r)-0)-n*-1.66666666666666324348e-01)); +; +} +return+MathSinSlow(g); +} +function MathCos(g){ +g=+g; +if((%_DoubleHi(g)&0x7fffffff)<=0x3fe921fb){ +var m=%_DoubleHi(g)&0x7fffffff; +var j=g*g; +var r=j*(4.16666666666666019037e-02+j*(-1.38888888888741095749e-03+j*(2.48015872894767294178e-05+j*(-2.75573143513906633035e-07+j*(2.08757232129817482790e-09+j*-1.13596475577881948265e-11))))); +if(m<0x3fd33333){ +return(1-(0.5*j-(j*r-g*0))); +}else{ +var w; +if(m>0x3fe90000){ +w=0.28125; +}else{ +w=%_ConstructDouble(%_DoubleHi(0.25*g),0); +} +var x=0.5*j-w; +return(1-w-(x-(j*r-g*0))); +} +; +} +return+MathCosSlow(g); +} +function MathTan(g){ +g=g*1; +if((%_DoubleHi(g)&0x7fffffff)<=0x3fe921fb){ +return KernelTan(g,0,1); +} +var s,t,u; +var l=%_DoubleHi(g); +var m=l&0x7fffffff; +if(m<0x4002d97c){ +if(l>0){ +var j=g-kMath[1]; +if(m!=0x3ff921fb){ +t=j-kMath[2]; +u=(j-t)-kMath[2]; +}else{ +j-=kMath[3]; +t=j-kMath[4]; +u=(j-t)-kMath[4]; +} +s=1; +}else{ +var j=g+kMath[1]; +if(m!=0x3ff921fb){ +t=j+kMath[2]; +u=(j-t)+kMath[2]; +}else{ +j+=kMath[3]; +t=j+kMath[4]; +u=(j-t)+kMath[4]; +} +s=-1; +} +}else if(m<=0x413921fb){ +var p=d(g); +s=(p*kMath[0]+0.5)|0; +var r=p-s*kMath[1]; +var k=s*kMath[2]; +t=r-k; +if(m-(%_DoubleHi(t)&0x7ff00000)>0x1000000){ +p=r; +k=s*kMath[3]; +r=p-k; +k=s*kMath[4]-((p-r)-k); +t=r-k; +if(m-(%_DoubleHi(t)&0x7ff00000)>0x3100000){ +p=r; +k=s*kMath[5]; +r=p-k; +k=s*kMath[6]-((p-r)-k); +t=r-k; +} +} +u=(r-t)-k; +if(l<0){ +s=-s; +t=-t; +u=-u; +} +}else{ +s=%RemPiO2(g,rempio2result); +t=rempio2result[0]; +u=rempio2result[1]; +} +; +return KernelTan(t,u,(s&1)?-1:1); +} + + + + +function MathLog1p(g){ +g=g*1; +var l=%_DoubleHi(g); +var y=l&0x7fffffff; +var z=1; +var A=g; +var B=1; +var C=0; +var D=g; +if(l<0x3fda827a){ +if(y>=0x3ff00000){ +if(g===-1){ +return-(1/0); +}else{ +return $NaN; +} +}else if(y<0x3c900000){ +return g; +}else if(y<0x3e200000){ +return g-g*g*0.5; +} +if((l>0)||(l<=-0x402D413D)){ +z=0; +} +} +if(l>=0x7ff00000)return g; +if(z!==0){ +if(l<0x43400000){ +D=1+g; +B=%_DoubleHi(D); +z=(B>>20)-1023; +C=(z>0)?1-(D-g):g-(D-1); +C=C/D; +}else{ +B=%_DoubleHi(D); +z=(B>>20)-1023; +} +B=B&0xfffff; +if(B<0x6a09e){ +D=%_ConstructDouble(B|0x3ff00000,%_DoubleLo(D)); +}else{ +++z; +D=%_ConstructDouble(B|0x3fe00000,%_DoubleLo(D)); +B=(0x00100000-B)>>2; +} +A=D-1; +} +var E=0.5*A*A; +if(B===0){ +if(A===0){ +if(z===0){ +return 0.0; +}else{ +return z*kMath[34]+(C+z*kMath[35]); +} +} +var F=E*(1-kMath[36]*A); +if(z===0){ +return A-F; +}else{ +return z*kMath[34]-((F-(z*kMath[35]+C))-A); +} +} +var q=A/(2+A); +var j=q*q; +var F=j*((kMath[37+0]) ++j*((kMath[37+1]) ++j* +((kMath[37+2]) ++j*((kMath[37+3]) ++j* +((kMath[37+4]) ++j*((kMath[37+5]) ++j*(kMath[37+6]) +)))))); +if(z===0){ +return A-(E-q*(E+F)); +}else{ +return z*kMath[34]-((E-(q*(E+F)+(z*kMath[35]+C)))-A); +} +} + + +function MathExpm1(g){ +g=g*1; +var h; +var G; +var H; +var z; +var p; +var C; +var l=%_DoubleHi(g); +var I=l&0x80000000; +var h=(I===0)?g:-g; +l&=0x7fffffff; +if(l>=0x4043687a){ +if(l>=0x40862e42){ +if(l>=0x7ff00000){ +return(g===-(1/0))?-1:g; +} +if(g>kMath[44])return(1/0); +} +if(I!=0)return-1; +} +if(l>0x3fd62e42){ +if(l<0x3ff0a2b2){ +if(I===0){ +G=g-kMath[34]; +H=kMath[35]; +z=1; +}else{ +G=g+kMath[34]; +H=-kMath[35]; +z=-1; +} +}else{ +z=(kMath[45]*g+((I===0)?0.5:-0.5))|0; +p=z; +G=g-p*kMath[34]; +H=p*kMath[35]; +} +g=G-H; +C=(G-g)-H; +}else if(l<0x3c900000){ +return g; +}else{ +z=0; +} +var J=0.5*g; +var K=g*J; +var L=1+K*((kMath[46+0]) ++K*((kMath[46+1]) ++K* +((kMath[46+2]) ++K*((kMath[46+3]) ++K*(kMath[46+4]) +)))); +p=3-L*J; +var M=K*((L-p)/(6-g*p)); +if(z===0){ +return g-(g*M-K); +}else{ +M=(g*(M-C)-C); +M-=K; +if(z===-1)return 0.5*(g-M)-0.5; +if(z===1){ +if(g<-0.25)return-2*(M-(g+0.5)); +return 1+2*(g-M); +} +if(z<=-2||z>56){ +h=1-(M-g); +h=%_ConstructDouble(%_DoubleHi(h)+(z<<20),%_DoubleLo(h)); +return h-1; +} +if(z<20){ +p=%_ConstructDouble(0x3ff00000-(0x200000>>z),0); +h=p-(M-g); +h=%_ConstructDouble(%_DoubleHi(h)+(z<<20),%_DoubleLo(h)); +}else{ +p=%_ConstructDouble((0x3ff-z)<<20,0); +h=g-(M+p); +h+=1; +h=%_ConstructDouble(%_DoubleHi(h)+(z<<20),%_DoubleLo(h)); +} +} +return h; +} + + + +function MathSinh(g){ +g=g*1; +var N=(g<0)?-0.5:0.5; +var y=d(g); +if(y<22){ +if(y<3.725290298461914e-9)return g; +var p=MathExpm1(y); +if(y<1)return N*(2*p-p*p/(p+1)); +return N*(p+p/(p+1)); +} +if(y<709.7822265625)return N*e(y); +if(y<=kMath[51]){ +var k=e(0.5*y); +var p=N*k; +return p*k; +} +return g*(1/0); +} + +function MathCosh(g){ +g=g*1; +var m=%_DoubleHi(g)&0x7fffffff; +if(m<0x3fd62e43){ +var p=MathExpm1(d(g)); +var k=1+p; +if(m<0x3c800000)return k; +return 1+(p*p)/(k+k); +} +if(m<0x40360000){ +var p=e(d(g)); +return 0.5*p+0.5/p; +} +if(m<0x40862e42)return 0.5*e(d(g)); +if(d(g)<=kMath[51]){ +var k=e(0.5*d(g)); +var p=0.5*k; +return p*k; +} +if((!%_IsSmi(%IS_VAR(g))&&!(g==g)))return g; +return(1/0); +} + + + +function MathLog10(g){ +g=g*1; +var l=%_DoubleHi(g); +var O=%_DoubleLo(g); +var z=0; +if(l<0x00100000){ +if(((l&0x7fffffff)|O)===0)return-(1/0); +if(l<0)return $NaN; +z-=54; +g*=18014398509481984; +l=%_DoubleHi(g); +O=%_DoubleLo(g); +} +if(l>=0x7ff00000)return g; +z+=(l>>20)-1023; +var P=(z&0x80000000)>>>31; +l=(l&0x000fffff)|((0x3ff-P)<<20); +var h=z+P; +g=%_ConstructDouble(l,O); +var j=h*kMath[54]+kMath[52]*%_MathLogRT(g); +return j+h*kMath[53]; +} + + + + + + +function MathLog2(g){ +g=g*1; +var y=d(g); +var l=%_DoubleHi(g); +var O=%_DoubleLo(g); +var m=l&0x7fffffff; +if((m|O)==0)return-(1/0); +if(l<0)return $NaN; +if(m>=0x7ff00000)return g; +var s=0; +if(m<0x00100000){ +y*=9007199254740992; +s-=53; +m=%_DoubleHi(y); +} +s+=(m>>20)-0x3ff; +var Q=m&0x000fffff; +m=Q|0x3ff00000; +var R=1; +var S=0; +var T=0; +if(Q>0x3988e){ +if(Q<0xbb67a){ +R=1.5; +S=kMath[64]; +T=kMath[65]; +}else{ +s+=1; +m-=0x00100000; +} +} +y=%_ConstructDouble(m,%_DoubleLo(y)); +var D=y-R; +var n=1/(y+R); +var U=D*n; +var V=%_ConstructDouble(%_DoubleHi(U),0); +var W=%_ConstructDouble(%_DoubleHi(y+R),0) +var X=y-(W-R); +var Y=n*((D-V*W)-V*X); +var Z=U*U; +var r=Z*Z*((kMath[55+0]) ++Z*((kMath[55+1]) ++Z*((kMath[55+2]) ++Z*( +(kMath[55+3]) ++Z*((kMath[55+4]) ++Z*(kMath[55+5]) +))))); +r+=Y*(V+U); +Z=V*V; +W=%_ConstructDouble(%_DoubleHi(3.0+Z+r),0); +X=r-((W-3.0)-Z); +D=V*W; +n=Y*W+X*U; +p_h=%_ConstructDouble(%_DoubleHi(D+n),0); +p_l=n-(p_h-D); +z_h=kMath[62]*p_h; +z_l=kMath[63]*p_h+p_l*kMath[61]+T; +var p=s; +var aa=%_ConstructDouble(%_DoubleHi(((z_h+z_l)+S)+p),0); +var ab=z_l-(((aa-p)-S)-z_h); +return aa+ab; +} +b.InstallFunctions(c,2,[ +"cos",MathCos, +"sin",MathSin, +"tan",MathTan, +"sinh",MathSinh, +"cosh",MathCosh, +"log10",MathLog10, +"log2",MathLog2, +"log1p",MathLog1p, +"expm1",MathExpm1 +]); +%SetForceInlineFlag(MathSin); +%SetForceInlineFlag(MathCos); +}) + +dateéö +var $createDate; +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Date; +var d=a.Object; +var e=b.InternalArray; +var f; +var g; +var h; +var i; +b.Import(function(j){ +f=j.IsFinite; +g=j.MathAbs; +h=j.MathFloor; +i=j.ToNumber; +}); +var k=$NaN; +var l; +function LocalTimezone(m){ +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return""; +CheckDateCacheCurrent(); +if(m==k){ +return l; +} +var n=%DateLocalTimezone(m); +k=m; +l=n; +return n; +} +function UTC(o){ +if((!%_IsSmi(%IS_VAR(o))&&!(o==o)))return o; +return %DateToUTC(o); +} +function MakeTime(p,q,r,s){ +if(!f(p))return $NaN; +if(!f(q))return $NaN; +if(!f(r))return $NaN; +if(!f(s))return $NaN; +return(%_ToInteger(p))*3600000 ++(%_ToInteger(q))*60000 ++(%_ToInteger(r))*1000 ++(%_ToInteger(s)); +} +function TimeInYear(t){ +return DaysInYear(t)*86400000; +} +function MakeDay(t,u,v){ +if(!f(t)||!f(u)||!f(v))return $NaN; +t=(%_IsSmi(%IS_VAR(t))?t:%NumberToIntegerMapMinusZero(i(t))); +u=(%_IsSmi(%IS_VAR(u))?u:%NumberToIntegerMapMinusZero(i(u))); +v=(%_IsSmi(%IS_VAR(v))?v:%NumberToIntegerMapMinusZero(i(v))); +if(t<-1000000||t>1000000|| +u<-10000000||u>10000000){ +return $NaN; +} +return %DateMakeDay(t|0,u|0)+v-1; +} +function MakeDate(w,o){ +var o=w*86400000+o; +if(g(o)>8640002592000000)return $NaN; +return o; +} +function TimeClip(o){ +if(!f(o))return $NaN; +if(g(o)>8640000000000000)return $NaN; +return(%_ToInteger(o)); +} +var x={ +time:0, +string:null +}; +function DateConstructor(t,u,v,y,z,A,s){ +if(!%_IsConstructCall()){ +return %_CallFunction(new c(),DateToString); +} +var B=%_ArgumentsLength(); +var C; +if(B==0){ +C=%DateCurrentTime(); +(%DateSetValue(this,C,1)); +}else if(B==1){ +if((typeof(t)==='number')){ +C=t; +}else if((typeof(t)==='string')){ +CheckDateCacheCurrent(); +var D=x; +if(D.string===t){ +C=D.time; +}else{ +C=DateParse(t); +if(!(!%_IsSmi(%IS_VAR(C))&&!(C==C))){ +D.time=C; +D.string=t; +} +} +}else if((%_IsDate(t))){ +C=(%_DateField(t,0)); +}else{ +var o=(%_ToPrimitive(t)); +C=(typeof(o)==='string')?DateParse(o):i(o); +} +(%DateSetValue(this,C,1)); +}else{ +t=i(t); +u=i(u); +v=B>2?i(v):1; +y=B>3?i(y):0; +z=B>4?i(z):0; +A=B>5?i(A):0; +s=B>6?i(s):0; +t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&& +0<=(%_ToInteger(t))&& +(%_ToInteger(t))<=99)?1900+(%_ToInteger(t)):t; +var w=MakeDay(t,u,v); +var o=MakeTime(y,z,A,s); +C=MakeDate(w,o); +(%DateSetValue(this,C,0)); +} +} +var E=['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; +var F=['Jan','Feb','Mar','Apr','May','Jun', +'Jul','Aug','Sep','Oct','Nov','Dec']; +function TwoDigitString(C){ +return C<10?"0"+C:""+C; +} +function DateString(v){ +if(!%_IsDate(v))%_ThrowNotDateError(); +return E[(%_DateField(v,4))]+' ' ++F[(%_DateField(v,2))]+' ' ++TwoDigitString((%_DateField(v,3)))+' ' ++(%_DateField(v,1)); +} +var G=['Sunday','Monday','Tuesday','Wednesday', +'Thursday','Friday','Saturday']; +var H=['January','February','March','April','May','June', +'July','August','September','October','November','December']; +function LongDateString(v){ +if(!%_IsDate(v))%_ThrowNotDateError(); +return G[(%_DateField(v,4))]+', ' ++H[(%_DateField(v,2))]+' ' ++TwoDigitString((%_DateField(v,3)))+', ' ++(%_DateField(v,1)); +} +function TimeString(v){ +if(!%_IsDate(v))%_ThrowNotDateError(); +return TwoDigitString((%_DateField(v,5)))+':' ++TwoDigitString((%_DateField(v,6)))+':' ++TwoDigitString((%_DateField(v,7))); +} +function TimeStringUTC(v){ +if(!%_IsDate(v))%_ThrowNotDateError(); +return TwoDigitString((%_DateField(v,15)))+':' ++TwoDigitString((%_DateField(v,16)))+':' ++TwoDigitString((%_DateField(v,17))); +} +function LocalTimezoneString(v){ +if(!%_IsDate(v))%_ThrowNotDateError(); +var n=LocalTimezone((%_DateField(v,0))); +var I=-(%_DateField(v,21)); +var J=(I>=0)?1:-1; +var y=h((J*I)/60); +var q=h((J*I)%60); +var K=' GMT'+((J==1)?'+':'-')+ +TwoDigitString(y)+TwoDigitString(q); +return K+' ('+n+')'; +} +function DatePrintString(v){ +if(!%_IsDate(v))%_ThrowNotDateError(); +return DateString(v)+' '+TimeString(v); +} +var L=new e(8); +function DateParse(M){ +var N=%DateParseString(M,L); +if((N===null))return $NaN; +var w=MakeDay(N[0],N[1],N[2]); +var o=MakeTime(N[3],N[4],N[5],N[6]); +var v=MakeDate(w,o); +if((N[7]===null)){ +return TimeClip(UTC(v)); +}else{ +return TimeClip(v-N[7]*1000); +} +} +function DateUTC(t,u,v,y,z,A,s){ +t=i(t); +u=i(u); +var B=%_ArgumentsLength(); +v=B>2?i(v):1; +y=B>3?i(y):0; +z=B>4?i(z):0; +A=B>5?i(A):0; +s=B>6?i(s):0; +t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&& +0<=(%_ToInteger(t))&& +(%_ToInteger(t))<=99)?1900+(%_ToInteger(t)):t; +var w=MakeDay(t,u,v); +var o=MakeTime(y,z,A,s); +return TimeClip(MakeDate(w,o)); +} +function DateNow(){ +return %DateCurrentTime(); +} +function DateToString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)) +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; +var O=LocalTimezoneString(this) +return DatePrintString(this)+O; +} +function DateToDateString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; +return DateString(this); +} +function DateToTimeString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; +var O=LocalTimezoneString(this); +return TimeString(this)+O; +} +function DateToLocaleString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return %_CallFunction(this,DateToString); +} +function DateToLocaleDateString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; +return LongDateString(this); +} +function DateToLocaleTimeString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; +return TimeString(this); +} +function DateValueOf(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,0)); +} +function DateGetTime(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,0)); +} +function DateGetFullYear(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,1)); +} +function DateGetUTCFullYear(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,11)); +} +function DateGetMonth(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,2)); +} +function DateGetUTCMonth(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,12)); +} +function DateGetDate(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,3)); +} +function DateGetUTCDate(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,13)); +} +function DateGetDay(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,4)); +} +function DateGetUTCDay(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,14)); +} +function DateGetHours(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,5)); +} +function DateGetUTCHours(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,15)); +} +function DateGetMinutes(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,6)); +} +function DateGetUTCMinutes(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,16)); +} +function DateGetSeconds(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,7)); +} +function DateGetUTCSeconds(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,17)) +} +function DateGetMilliseconds(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,8)); +} +function DateGetUTCMilliseconds(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,18)); +} +function DateGetTimezoneOffset(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,21)); +} +function DateSetTime(s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +(%DateSetValue(this,i(s),1)); +return(%_DateField(this,0)); +} +function DateSetMilliseconds(s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)+%_DateField(this,21)); +s=i(s); +var o=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),(%_DateField(this,7)),s); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); +} +function DateSetUTCMilliseconds(s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +s=i(s); +var o=MakeTime((%_DateField(this,15)), +(%_DateField(this,16)), +(%_DateField(this,17)), +s); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); +} +function DateSetSeconds(r,s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)+%_DateField(this,21)); +r=i(r); +s=%_ArgumentsLength()<2?(%_DateField(this,8)):i(s); +var o=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),r,s); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); +} +function DateSetUTCSeconds(r,s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +r=i(r); +s=%_ArgumentsLength()<2?(%_DateField(this,18)):i(s); +var o=MakeTime((%_DateField(this,15)),(%_DateField(this,16)),r,s); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); +} +function DateSetMinutes(q,r,s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)+%_DateField(this,21)); +q=i(q); +var B=%_ArgumentsLength(); +r=B<2?(%_DateField(this,7)):i(r); +s=B<3?(%_DateField(this,8)):i(s); +var o=MakeTime((%_DateField(this,5)),q,r,s); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); +} +function DateSetUTCMinutes(q,r,s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +q=i(q); +var B=%_ArgumentsLength(); +r=B<2?(%_DateField(this,17)):i(r); +s=B<3?(%_DateField(this,18)):i(s); +var o=MakeTime((%_DateField(this,15)),q,r,s); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); +} +function DateSetHours(p,q,r,s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)+%_DateField(this,21)); +p=i(p); +var B=%_ArgumentsLength(); +q=B<2?(%_DateField(this,6)):i(q); +r=B<3?(%_DateField(this,7)):i(r); +s=B<4?(%_DateField(this,8)):i(s); +var o=MakeTime(p,q,r,s); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); +} +function DateSetUTCHours(p,q,r,s){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +p=i(p); +var B=%_ArgumentsLength(); +q=B<2?(%_DateField(this,16)):i(q); +r=B<3?(%_DateField(this,17)):i(r); +s=B<4?(%_DateField(this,18)):i(s); +var o=MakeTime(p,q,r,s); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); +} +function DateSetDate(v){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)+%_DateField(this,21)); +v=i(v); +var w=MakeDay((%_DateField(this,1)),(%_DateField(this,2)),v); +return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0)); +} +function DateSetUTCDate(v){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +v=i(v); +var w=MakeDay((%_DateField(this,11)),(%_DateField(this,12)),v); +return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1)); +} +function DateSetMonth(u,v){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)+%_DateField(this,21)); +u=i(u); +v=%_ArgumentsLength()<2?(%_DateField(this,3)):i(v); +var w=MakeDay((%_DateField(this,1)),u,v); +return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0)); +} +function DateSetUTCMonth(u,v){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +u=i(u); +v=%_ArgumentsLength()<2?(%_DateField(this,13)):i(v); +var w=MakeDay((%_DateField(this,11)),u,v); +return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1)); +} +function DateSetFullYear(t,u,v){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)+%_DateField(this,21)); +t=i(t); +var B=%_ArgumentsLength(); +var o; +if((!%_IsSmi(%IS_VAR(m))&&!(m==m))){ +u=B<2?0:i(u); +v=B<3?1:i(v); +o=0; +}else{ +u=B<2?(%_DateField(this,2)):i(u); +v=B<3?(%_DateField(this,3)):i(v); +o=(%_DateField(this,10)); +} +var w=MakeDay(t,u,v); +return(%DateSetValue(this,MakeDate(w,o),0)); +} +function DateSetUTCFullYear(t,u,v){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +t=i(t); +var B=%_ArgumentsLength(); +var o; +if((!%_IsSmi(%IS_VAR(m))&&!(m==m))){ +u=B<2?0:i(u); +v=B<3?1:i(v); +o=0; +}else{ +u=B<2?(%_DateField(this,12)):i(u); +v=B<3?(%_DateField(this,13)):i(v); +o=(%_DateField(this,20)); +} +var w=MakeDay(t,u,v); +return(%DateSetValue(this,MakeDate(w,o),1)); +} +function DateToUTCString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; +return E[(%_DateField(this,14))]+', ' ++TwoDigitString((%_DateField(this,13)))+' ' ++F[(%_DateField(this,12))]+' ' ++(%_DateField(this,11))+' ' ++TimeStringUTC(this)+' GMT'; +} +function DateGetYear(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +return(%_DateField(this,1))-1900; +} +function DateSetYear(t){ +if(!%_IsDate(this))%_ThrowNotDateError(); +t=i(t); +if((!%_IsSmi(%IS_VAR(t))&&!(t==t)))return(%DateSetValue(this,$NaN,1)); +t=(0<=(%_ToInteger(t))&&(%_ToInteger(t))<=99) +?1900+(%_ToInteger(t)):t; +var m=(%_DateField(this,0)+%_DateField(this,21)); +var u,v,o; +if((!%_IsSmi(%IS_VAR(m))&&!(m==m))){ +u=0; +v=1; +o=0; +}else{ +u=(%_DateField(this,2)); +v=(%_DateField(this,3)); +o=(%_DateField(this,10)); +} +var w=MakeDay(t,u,v); +return(%DateSetValue(this,MakeDate(w,o),0)); +} +function DateToGMTString(){ +return %_CallFunction(this,DateToUTCString); +} +function PadInt(P,Q){ +if(Q==1)return P; +return P<%_MathPow(10,Q-1)?'0'+PadInt(P,Q-1):P; +} +function DateToISOString(){ +if(!%_IsDate(this))%_ThrowNotDateError(); +var m=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))throw MakeRangeError(143); +var t=(%_DateField(this,11)); +var R; +if(t>=0&&t<=9999){ +R=PadInt(t,4); +}else{ +if(t<0){ +R="-"+PadInt(-t,6); +}else{ +R="+"+PadInt(t,6); +} +} +return R+ +'-'+PadInt((%_DateField(this,12))+1,2)+ +'-'+PadInt((%_DateField(this,13)),2)+ +'T'+PadInt((%_DateField(this,15)),2)+ +':'+PadInt((%_DateField(this,16)),2)+ +':'+PadInt((%_DateField(this,17)),2)+ +'.'+PadInt((%_DateField(this,18)),3)+ +'Z'; +} +function DateToJSON(S){ +var T=(%_ToObject(this)); +var U=(%_ToPrimitive_Number(T)); +if((typeof(U)==='number')&&!(%_IsSmi(%IS_VAR(U))||((U==U)&&(U!=1/0)&&(U!=-1/0)))){ +return null; +} +return T.toISOString(); +} +var V; +var W=$NaN; +function CheckDateCacheCurrent(){ +if(!V){ +V=%DateCacheVersion(); +if(!V)return; +} +if(V[0]==W){ +return; +} +W=V[0]; +k=$NaN; +l=(void 0); +x.time=$NaN; +x.string=null; +} +function CreateDate(o){ +var v=new c(); +v.setTime(o); +return v; +} +%SetCode(c,DateConstructor); +%FunctionSetPrototype(c,new d()); +b.InstallFunctions(c,2,[ +"UTC",DateUTC, +"parse",DateParse, +"now",DateNow +]); +%AddNamedProperty(c.prototype,"constructor",c,2); +b.InstallFunctions(c.prototype,2,[ +"toString",DateToString, +"toDateString",DateToDateString, +"toTimeString",DateToTimeString, +"toLocaleString",DateToLocaleString, +"toLocaleDateString",DateToLocaleDateString, +"toLocaleTimeString",DateToLocaleTimeString, +"valueOf",DateValueOf, +"getTime",DateGetTime, +"getFullYear",DateGetFullYear, +"getUTCFullYear",DateGetUTCFullYear, +"getMonth",DateGetMonth, +"getUTCMonth",DateGetUTCMonth, +"getDate",DateGetDate, +"getUTCDate",DateGetUTCDate, +"getDay",DateGetDay, +"getUTCDay",DateGetUTCDay, +"getHours",DateGetHours, +"getUTCHours",DateGetUTCHours, +"getMinutes",DateGetMinutes, +"getUTCMinutes",DateGetUTCMinutes, +"getSeconds",DateGetSeconds, +"getUTCSeconds",DateGetUTCSeconds, +"getMilliseconds",DateGetMilliseconds, +"getUTCMilliseconds",DateGetUTCMilliseconds, +"getTimezoneOffset",DateGetTimezoneOffset, +"setTime",DateSetTime, +"setMilliseconds",DateSetMilliseconds, +"setUTCMilliseconds",DateSetUTCMilliseconds, +"setSeconds",DateSetSeconds, +"setUTCSeconds",DateSetUTCSeconds, +"setMinutes",DateSetMinutes, +"setUTCMinutes",DateSetUTCMinutes, +"setHours",DateSetHours, +"setUTCHours",DateSetUTCHours, +"setDate",DateSetDate, +"setUTCDate",DateSetUTCDate, +"setMonth",DateSetMonth, +"setUTCMonth",DateSetUTCMonth, +"setFullYear",DateSetFullYear, +"setUTCFullYear",DateSetUTCFullYear, +"toGMTString",DateToGMTString, +"toUTCString",DateToUTCString, +"getYear",DateGetYear, +"setYear",DateSetYear, +"toISOString",DateToISOString, +"toJSON",DateToJSON +]); +%InstallToContext(["create_date_fun",CreateDate]); +}) + +regexp±c +var $regexpLastMatchInfoOverride; +(function(a,b){ +%CheckIsBootstrapping(); +var c; +var d; +var e=a.RegExp; +var f=b.InternalPackedArray; +var g; +b.Import(function(h){ +g=h.ToNumber; +}); +b.ImportFromExperimental(function(h){ +c=h.FLAG_harmony_regexps; +d=h.FLAG_harmony_unicode_regexps; +}); +var i=new f( +2, +"", +(void 0), +0, +0 +); +$regexpLastMatchInfoOverride=null; +function DoConstructRegExp(j,k,l){ +if((%_IsRegExp(k))){ +if(!(l===(void 0)))throw MakeTypeError(98); +l=(k.global?'g':'') ++(k.ignoreCase?'i':'') ++(k.multiline?'m':''); +if(d) +l+=(k.unicode?'u':''); +if(c) +l+=(k.sticky?'y':''); +k=k.source; +} +k=(k===(void 0))?'':(%_ToString(k)); +l=(l===(void 0))?'':(%_ToString(l)); +%RegExpInitializeAndCompile(j,k,l); +} +function RegExpConstructor(k,l){ +if(%_IsConstructCall()){ +DoConstructRegExp(this,k,l); +}else{ +if((%_IsRegExp(k))&&(l===(void 0))){ +return k; +} +return new e(k,l); +} +} +function RegExpCompileJS(k,l){ +if(this==e.prototype){ +throw MakeTypeError(36, +'RegExp.prototype.compile',this); +} +if((k===(void 0))&&%_ArgumentsLength()!=0){ +DoConstructRegExp(this,'undefined',l); +}else{ +DoConstructRegExp(this,k,l); +} +} +function DoRegExpExec(m,n,o){ +var p=%_RegExpExec(m,n,o,i); +if(p!==null)$regexpLastMatchInfoOverride=null; +return p; +} +function RegExpExecNoTests(m,n,q){ +var r=%_RegExpExec(m,n,q,i); +if(r!==null){ +$regexpLastMatchInfoOverride=null; +var s=((r)[0])>>1; +var q=r[3]; +var t=r[4]; +var u=%_SubString(n,q,t); +var p=%_RegExpConstructResult(s,q,n); +p[0]=u; +if(s==1)return p; +var v=3+2; +for(var w=1;wn.length){ +this.lastIndex=0; +return null; +} +}else{ +w=0; +} +var z=%_RegExpExec(this,n,w,i); +if((z===null)){ +this.lastIndex=0; +return null; +} +$regexpLastMatchInfoOverride=null; +if(y){ +this.lastIndex=i[4]; +} +var s=((z)[0])>>1; +var q=z[3]; +var t=z[4]; +var u=%_SubString(n,q,t); +var p=%_RegExpConstructResult(s,q,n); +p[0]=u; +if(s==1)return p; +var v=3+2; +for(var w=1;wn.length){ +this.lastIndex=0; +return false; +} +var z=%_RegExpExec(this,n,w,i); +if((z===null)){ +this.lastIndex=0; +return false; +} +$regexpLastMatchInfoOverride=null; +this.lastIndex=i[4]; +return true; +}else{ +var m=this; +if(m.source.length>=3&& +%_StringCharCodeAt(m.source,0)==46&& +%_StringCharCodeAt(m.source,1)==42&& +%_StringCharCodeAt(m.source,2)!=63){ +m=TrimRegExp(m); +} +var z=%_RegExpExec(m,n,0,i); +if((z===null)){ +this.lastIndex=0; +return false; +} +$regexpLastMatchInfoOverride=null; +return true; +} +} +function TrimRegExp(m){ +if(!%_ObjectEquals(A,m)){ +A=m; +B= +new e(%_SubString(m.source,2,m.source.length), +(m.ignoreCase?m.multiline?"im":"i" +:m.multiline?"m":"")); +} +return B; +} +function RegExpToString(){ +if(!(%_IsRegExp(this))){ +throw MakeTypeError(36, +'RegExp.prototype.toString',this); +} +var p='/'+this.source+'/'; +if(this.global)p+='g'; +if(this.ignoreCase)p+='i'; +if(this.multiline)p+='m'; +if(d&&this.unicode)p+='u'; +if(c&&this.sticky)p+='y'; +return p; +} +function RegExpGetLastMatch(){ +if($regexpLastMatchInfoOverride!==null){ +return(($regexpLastMatchInfoOverride)[0]); +} +var C=((i)[1]); +return %_SubString(C, +i[3], +i[4]); +} +function RegExpGetLastParen(){ +if($regexpLastMatchInfoOverride){ +var D=$regexpLastMatchInfoOverride; +if(D.length<=3)return''; +return D[D.length-3]; +} +var E=((i)[0]); +if(E<=2)return''; +var C=((i)[1]); +var q=i[(3+(E-2))]; +var t=i[(3+(E-1))]; +if(q!=-1&&t!=-1){ +return %_SubString(C,q,t); +} +return""; +} +function RegExpGetLeftContext(){ +var F; +var G; +if(!$regexpLastMatchInfoOverride){ +F=i[3]; +G=((i)[1]); +}else{ +var D=$regexpLastMatchInfoOverride; +F=((D)[(D).length-2]); +G=((D)[(D).length-1]); +} +return %_SubString(G,0,F); +} +function RegExpGetRightContext(){ +var F; +var G; +if(!$regexpLastMatchInfoOverride){ +F=i[4]; +G=((i)[1]); +}else{ +var D=$regexpLastMatchInfoOverride; +G=((D)[(D).length-1]); +var H=((D)[0]); +F=((D)[(D).length-2])+H.length; +} +return %_SubString(G,F,G.length); +} +function RegExpMakeCaptureGetter(I){ +return function foo(){ +if($regexpLastMatchInfoOverride){ +if(I<$regexpLastMatchInfoOverride.length-2){ +return(($regexpLastMatchInfoOverride)[(I)]); +} +return''; +} +var o=I*2; +if(o>=((i)[0]))return''; +var J=i[(3+(o))]; +var K=i[(3+(o+1))]; +if(J==-1||K==-1)return''; +return %_SubString(((i)[1]),J,K); +}; +} +%FunctionSetInstanceClassName(e,'RegExp'); +%AddNamedProperty( +e.prototype,'constructor',e,2); +%SetCode(e,RegExpConstructor); +b.InstallFunctions(e.prototype,2,[ +"exec",RegExpExecJS, +"test",RegExpTest, +"toString",RegExpToString, +"compile",RegExpCompileJS +]); +%FunctionSetLength(e.prototype.compile,1); +var L=function(){ +var M=((i)[2]); +return(M===(void 0))?"":M; +}; +var N=function(n){ +((i)[2])=(%_ToString(n)); +}; +%OptimizeObjectForAddingMultipleProperties(e,22); +%DefineAccessorPropertyUnchecked(e,'input',L, +N,4); +%DefineAccessorPropertyUnchecked(e,'$_',L, +N,2|4); +var O=false; +var P=function(){return O;}; +var Q=function(R){O=R?true:false;}; +%DefineAccessorPropertyUnchecked(e,'multiline',P, +Q,4); +%DefineAccessorPropertyUnchecked(e,'$*',P, +Q, +2|4); +var S=function(T){}; +%DefineAccessorPropertyUnchecked(e,'lastMatch',RegExpGetLastMatch, +S,4); +%DefineAccessorPropertyUnchecked(e,'$&',RegExpGetLastMatch, +S,2|4); +%DefineAccessorPropertyUnchecked(e,'lastParen',RegExpGetLastParen, +S,4); +%DefineAccessorPropertyUnchecked(e,'$+',RegExpGetLastParen, +S,2|4); +%DefineAccessorPropertyUnchecked(e,'leftContext', +RegExpGetLeftContext,S, +4); +%DefineAccessorPropertyUnchecked(e,'$`',RegExpGetLeftContext, +S,2|4); +%DefineAccessorPropertyUnchecked(e,'rightContext', +RegExpGetRightContext,S, +4); +%DefineAccessorPropertyUnchecked(e,"$'",RegExpGetRightContext, +S,2|4); +for(var w=1;w<10;++w){ +%DefineAccessorPropertyUnchecked(e,'$'+w, +RegExpMakeCaptureGetter(w),S, +4); +} +%ToFastProperties(e); +b.Export(function(U){ +U.RegExpExec=DoRegExpExec; +U.RegExpExecNoTests=RegExpExecNoTests; +U.RegExpLastMatchInfo=i; +U.RegExpTest=RegExpTest; +}); +}) + +,arraybufferý +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.ArrayBuffer; +var d=a.Object; +var e; +var f; +var g; +var h=b.ImportNow("to_string_tag_symbol"); +b.Import(function(i){ +e=i.MathMax; +f=i.MathMin; +g=i.ToNumber; +}); +function ArrayBufferConstructor(j){ +if(%_IsConstructCall()){ +var k=$toPositiveInteger(j,130); +%ArrayBufferInitialize(this,k,false); +}else{ +throw MakeTypeError(21,"ArrayBuffer"); +} +} +function ArrayBufferGetByteLen(){ +if(!(%_ClassOf(this)==='ArrayBuffer')){ +throw MakeTypeError(36, +'ArrayBuffer.prototype.byteLength',this); +} +return %_ArrayBufferGetByteLength(this); +} +function ArrayBufferSlice(l,m){ +if(!(%_ClassOf(this)==='ArrayBuffer')){ +throw MakeTypeError(36, +'ArrayBuffer.prototype.slice',this); +} +var n=(%_ToInteger(l)); +if(!(m===(void 0))){ +m=(%_ToInteger(m)); +} +var o; +var p=%_ArrayBufferGetByteLength(this); +if(n<0){ +o=e(p+n,0); +}else{ +o=f(n,p); +} +var q=(m===(void 0))?p:m; +var r; +if(q<0){ +r=e(p+q,0); +}else{ +r=f(q,p); +} +if(ry){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 1!==0){ +throw MakeRangeError(144, +"byte length","Uint8Array",1); +} +A=y-z; +B=A/1; +}else{ +var B=x; +A=B*1; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,1,v,z,A,true); +} +function Uint8ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*1; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,1,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,1,null,0,D,true); +} +} +function Uint8ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*1; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,1,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,1,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 1!==0){ +throw MakeRangeError(144, +"byte length","Int8Array",1); +} +A=y-z; +B=A/1; +}else{ +var B=x; +A=B*1; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,2,v,z,A,true); +} +function Int8ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*1; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,2,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,2,null,0,D,true); +} +} +function Int8ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*1; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,2,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,2,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 2!==0){ +throw MakeRangeError(144, +"byte length","Uint16Array",2); +} +A=y-z; +B=A/2; +}else{ +var B=x; +A=B*2; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,3,v,z,A,true); +} +function Uint16ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*2; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,3,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,3,null,0,D,true); +} +} +function Uint16ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*2; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,3,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,3,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 2!==0){ +throw MakeRangeError(144, +"byte length","Int16Array",2); +} +A=y-z; +B=A/2; +}else{ +var B=x; +A=B*2; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,4,v,z,A,true); +} +function Int16ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*2; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,4,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,4,null,0,D,true); +} +} +function Int16ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*2; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,4,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,4,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 4!==0){ +throw MakeRangeError(144, +"byte length","Uint32Array",4); +} +A=y-z; +B=A/4; +}else{ +var B=x; +A=B*4; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,5,v,z,A,true); +} +function Uint32ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*4; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,5,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,5,null,0,D,true); +} +} +function Uint32ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*4; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,5,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,5,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 4!==0){ +throw MakeRangeError(144, +"byte length","Int32Array",4); +} +A=y-z; +B=A/4; +}else{ +var B=x; +A=B*4; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,6,v,z,A,true); +} +function Int32ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*4; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,6,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,6,null,0,D,true); +} +} +function Int32ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*4; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,6,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,6,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 4!==0){ +throw MakeRangeError(144, +"byte length","Float32Array",4); +} +A=y-z; +B=A/4; +}else{ +var B=x; +A=B*4; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,7,v,z,A,true); +} +function Float32ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*4; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,7,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,7,null,0,D,true); +} +} +function Float32ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*4; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,7,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,7,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 8!==0){ +throw MakeRangeError(144, +"byte length","Float64Array",8); +} +A=y-z; +B=A/8; +}else{ +var B=x; +A=B*8; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,8,v,z,A,true); +} +function Float64ArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*8; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,8,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,8,null,0,D,true); +} +} +function Float64ArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*8; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,8,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,8,E,C); +} +if(!F){ +for(var G=0;Gy){ +throw MakeRangeError(146); +} +} +var A; +var B; +if((x===(void 0))){ +if(y % 1!==0){ +throw MakeRangeError(144, +"byte length","Uint8ClampedArray",1); +} +A=y-z; +B=A/1; +}else{ +var B=x; +A=B*1; +} +if((z+A>y) +||(B>%_MaxSmi())){ +throw MakeRangeError(145); +} +%_TypedArrayInitialize(u,9,v,z,A,true); +} +function Uint8ClampedArrayConstructByLength(u,x){ +var C=(x===(void 0))? +0:$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var D=C*1; +if(D>%_TypedArrayMaxSizeInHeap()){ +var v=new d(D); +%_TypedArrayInitialize(u,9,v,0,D,true); +}else{ +%_TypedArrayInitialize(u,9,null,0,D,true); +} +} +function Uint8ClampedArrayConstructByArrayLike(u,E){ +var x=E.length; +var C=$toPositiveInteger(x,145); +if(C>%_MaxSmi()){ +throw MakeRangeError(145); +} +var F=false; +var D=C*1; +if(D<=%_TypedArrayMaxSizeInHeap()){ +%_TypedArrayInitialize(u,9,null,0,D,false); +}else{ +F= +%TypedArrayInitializeFromArrayLike(u,9,E,C); +} +if(!F){ +for(var G=0;G0){ +for(var G=0;G=ad&&ab>=ac; +ae--){ +W[z+ae]=X[ae]; +ab-=aa; +ac-=Z; +} +return ae; +} +var ae=CopyRightPart(); +var af=new c(ae+1-ad); +for(var G=ad;G<=ae;G++){ +af[G-ad]=X[G]; +} +for(G=ad;G<=ae;G++){ +W[z+G]=af[G-ad]; +} +} +function TypedArraySet(u,z){ +var ag=(z===(void 0))?0:(%_ToInteger(z)); +if(ag<0)throw MakeTypeError(154); +if(ag>%_MaxSmi()){ +throw MakeRangeError(155); +} +switch(%TypedArraySetFastCases(this,u,ag)){ +case 0: +return; +case 1: +TypedArraySetFromOverlappingTypedArray(this,u,ag); +return; +case 2: +TypedArraySetFromArrayLike(this,u,u.length,ag); +return; +case 3: +var C=u.length; +if((C===(void 0))){ +if((typeof(u)==='number')){ +throw MakeTypeError(39); +} +return; +} +C=(%ToLength(C)); +if(ag+C>this.length){ +throw MakeRangeError(155); +} +TypedArraySetFromArrayLike(this,u,C,ag); +return; +} +} +function TypedArrayGetToStringTag(){ +if(!%_IsTypedArray(this))return; +var ah=%_ClassOf(this); +if((ah===(void 0)))return; +return ah; +} +%SetCode(i,Uint8ArrayConstructor); +%FunctionSetPrototype(i,new f()); +%AddNamedProperty(i,"BYTES_PER_ELEMENT",1, +1|2|4); +%AddNamedProperty(i.prototype, +"constructor",a.Uint8Array,2); +%AddNamedProperty(i.prototype, +"BYTES_PER_ELEMENT",1, +1|2|4); +b.InstallGetter(i.prototype,"buffer",Uint8Array_GetBuffer); +b.InstallGetter(i.prototype,"byteOffset",Uint8Array_GetByteOffset, +2|4); +b.InstallGetter(i.prototype,"byteLength",Uint8Array_GetByteLength, +2|4); +b.InstallGetter(i.prototype,"length",Uint8Array_GetLength, +2|4); +b.InstallGetter(i.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(i.prototype,2,[ +"subarray",Uint8ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(j,Int8ArrayConstructor); +%FunctionSetPrototype(j,new f()); +%AddNamedProperty(j,"BYTES_PER_ELEMENT",1, +1|2|4); +%AddNamedProperty(j.prototype, +"constructor",a.Int8Array,2); +%AddNamedProperty(j.prototype, +"BYTES_PER_ELEMENT",1, +1|2|4); +b.InstallGetter(j.prototype,"buffer",Int8Array_GetBuffer); +b.InstallGetter(j.prototype,"byteOffset",Int8Array_GetByteOffset, +2|4); +b.InstallGetter(j.prototype,"byteLength",Int8Array_GetByteLength, +2|4); +b.InstallGetter(j.prototype,"length",Int8Array_GetLength, +2|4); +b.InstallGetter(j.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(j.prototype,2,[ +"subarray",Int8ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(k,Uint16ArrayConstructor); +%FunctionSetPrototype(k,new f()); +%AddNamedProperty(k,"BYTES_PER_ELEMENT",2, +1|2|4); +%AddNamedProperty(k.prototype, +"constructor",a.Uint16Array,2); +%AddNamedProperty(k.prototype, +"BYTES_PER_ELEMENT",2, +1|2|4); +b.InstallGetter(k.prototype,"buffer",Uint16Array_GetBuffer); +b.InstallGetter(k.prototype,"byteOffset",Uint16Array_GetByteOffset, +2|4); +b.InstallGetter(k.prototype,"byteLength",Uint16Array_GetByteLength, +2|4); +b.InstallGetter(k.prototype,"length",Uint16Array_GetLength, +2|4); +b.InstallGetter(k.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(k.prototype,2,[ +"subarray",Uint16ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(l,Int16ArrayConstructor); +%FunctionSetPrototype(l,new f()); +%AddNamedProperty(l,"BYTES_PER_ELEMENT",2, +1|2|4); +%AddNamedProperty(l.prototype, +"constructor",a.Int16Array,2); +%AddNamedProperty(l.prototype, +"BYTES_PER_ELEMENT",2, +1|2|4); +b.InstallGetter(l.prototype,"buffer",Int16Array_GetBuffer); +b.InstallGetter(l.prototype,"byteOffset",Int16Array_GetByteOffset, +2|4); +b.InstallGetter(l.prototype,"byteLength",Int16Array_GetByteLength, +2|4); +b.InstallGetter(l.prototype,"length",Int16Array_GetLength, +2|4); +b.InstallGetter(l.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(l.prototype,2,[ +"subarray",Int16ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(m,Uint32ArrayConstructor); +%FunctionSetPrototype(m,new f()); +%AddNamedProperty(m,"BYTES_PER_ELEMENT",4, +1|2|4); +%AddNamedProperty(m.prototype, +"constructor",a.Uint32Array,2); +%AddNamedProperty(m.prototype, +"BYTES_PER_ELEMENT",4, +1|2|4); +b.InstallGetter(m.prototype,"buffer",Uint32Array_GetBuffer); +b.InstallGetter(m.prototype,"byteOffset",Uint32Array_GetByteOffset, +2|4); +b.InstallGetter(m.prototype,"byteLength",Uint32Array_GetByteLength, +2|4); +b.InstallGetter(m.prototype,"length",Uint32Array_GetLength, +2|4); +b.InstallGetter(m.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(m.prototype,2,[ +"subarray",Uint32ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(n,Int32ArrayConstructor); +%FunctionSetPrototype(n,new f()); +%AddNamedProperty(n,"BYTES_PER_ELEMENT",4, +1|2|4); +%AddNamedProperty(n.prototype, +"constructor",a.Int32Array,2); +%AddNamedProperty(n.prototype, +"BYTES_PER_ELEMENT",4, +1|2|4); +b.InstallGetter(n.prototype,"buffer",Int32Array_GetBuffer); +b.InstallGetter(n.prototype,"byteOffset",Int32Array_GetByteOffset, +2|4); +b.InstallGetter(n.prototype,"byteLength",Int32Array_GetByteLength, +2|4); +b.InstallGetter(n.prototype,"length",Int32Array_GetLength, +2|4); +b.InstallGetter(n.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(n.prototype,2,[ +"subarray",Int32ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(o,Float32ArrayConstructor); +%FunctionSetPrototype(o,new f()); +%AddNamedProperty(o,"BYTES_PER_ELEMENT",4, +1|2|4); +%AddNamedProperty(o.prototype, +"constructor",a.Float32Array,2); +%AddNamedProperty(o.prototype, +"BYTES_PER_ELEMENT",4, +1|2|4); +b.InstallGetter(o.prototype,"buffer",Float32Array_GetBuffer); +b.InstallGetter(o.prototype,"byteOffset",Float32Array_GetByteOffset, +2|4); +b.InstallGetter(o.prototype,"byteLength",Float32Array_GetByteLength, +2|4); +b.InstallGetter(o.prototype,"length",Float32Array_GetLength, +2|4); +b.InstallGetter(o.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(o.prototype,2,[ +"subarray",Float32ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(p,Float64ArrayConstructor); +%FunctionSetPrototype(p,new f()); +%AddNamedProperty(p,"BYTES_PER_ELEMENT",8, +1|2|4); +%AddNamedProperty(p.prototype, +"constructor",a.Float64Array,2); +%AddNamedProperty(p.prototype, +"BYTES_PER_ELEMENT",8, +1|2|4); +b.InstallGetter(p.prototype,"buffer",Float64Array_GetBuffer); +b.InstallGetter(p.prototype,"byteOffset",Float64Array_GetByteOffset, +2|4); +b.InstallGetter(p.prototype,"byteLength",Float64Array_GetByteLength, +2|4); +b.InstallGetter(p.prototype,"length",Float64Array_GetLength, +2|4); +b.InstallGetter(p.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(p.prototype,2,[ +"subarray",Float64ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(q,Uint8ClampedArrayConstructor); +%FunctionSetPrototype(q,new f()); +%AddNamedProperty(q,"BYTES_PER_ELEMENT",1, +1|2|4); +%AddNamedProperty(q.prototype, +"constructor",a.Uint8ClampedArray,2); +%AddNamedProperty(q.prototype, +"BYTES_PER_ELEMENT",1, +1|2|4); +b.InstallGetter(q.prototype,"buffer",Uint8ClampedArray_GetBuffer); +b.InstallGetter(q.prototype,"byteOffset",Uint8ClampedArray_GetByteOffset, +2|4); +b.InstallGetter(q.prototype,"byteLength",Uint8ClampedArray_GetByteLength, +2|4); +b.InstallGetter(q.prototype,"length",Uint8ClampedArray_GetLength, +2|4); +b.InstallGetter(q.prototype,h, +TypedArrayGetToStringTag); +b.InstallFunctions(q.prototype,2,[ +"subarray",Uint8ClampedArraySubArray, +"set",TypedArraySet +]); + + +function DataViewConstructor(v,w,D){ +if(%_IsConstructCall()){ +if(!(%_ClassOf(v)==='ArrayBuffer'))throw MakeTypeError(23); +if(!(w===(void 0))){ +w=$toPositiveInteger(w,137); +} +if(!(D===(void 0))){ +D=(%_ToInteger(D)); +} +var y=%_ArrayBufferGetByteLength(v); +var z=(w===(void 0))?0:w; +if(z>y)throw MakeRangeError(137); +var x=(D===(void 0)) +?y-z +:D; +if(x<0||z+x>y){ +throw new MakeRangeError(136); +} +%_DataViewInitialize(this,v,z,x); +}else{ +throw MakeTypeError(21,"DataView"); +} +} +function DataViewGetBufferJS(){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36,'DataView.buffer',this); +} +return %DataViewGetBuffer(this); +} +function DataViewGetByteOffset(){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.byteOffset',this); +} +return %_ArrayBufferViewGetByteOffset(this); +} +function DataViewGetByteLength(){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.byteLength',this); +} +return %_ArrayBufferViewGetByteLength(this); +} +function DataViewGetInt8JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getInt8',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetInt8(this,z,!!ai); +} +function DataViewSetInt8JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setInt8',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetInt8(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + +function DataViewGetUint8JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getUint8',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetUint8(this,z,!!ai); +} +function DataViewSetUint8JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setUint8',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetUint8(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + +function DataViewGetInt16JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getInt16',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetInt16(this,z,!!ai); +} +function DataViewSetInt16JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setInt16',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetInt16(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + +function DataViewGetUint16JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getUint16',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetUint16(this,z,!!ai); +} +function DataViewSetUint16JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setUint16',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetUint16(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + +function DataViewGetInt32JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getInt32',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetInt32(this,z,!!ai); +} +function DataViewSetInt32JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setInt32',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetInt32(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + +function DataViewGetUint32JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getUint32',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetUint32(this,z,!!ai); +} +function DataViewSetUint32JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setUint32',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetUint32(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + +function DataViewGetFloat32JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getFloat32',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetFloat32(this,z,!!ai); +} +function DataViewSetFloat32JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setFloat32',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetFloat32(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + +function DataViewGetFloat64JS(z,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.getFloat64',this); +} +if(%_ArgumentsLength()<1)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +return %DataViewGetFloat64(this,z,!!ai); +} +function DataViewSetFloat64JS(z,M,ai){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(36, +'DataView.setFloat64',this); +} +if(%_ArgumentsLength()<2)throw MakeTypeError(39); +z=$toPositiveInteger(z,135); +%DataViewSetFloat64(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); +} + + +%SetCode(e,DataViewConstructor); +%FunctionSetPrototype(e,new f); +%AddNamedProperty(e.prototype,"constructor",e, +2); +%AddNamedProperty(e.prototype,h,"DataView", +1|2); +b.InstallGetter(e.prototype,"buffer",DataViewGetBufferJS); +b.InstallGetter(e.prototype,"byteOffset", +DataViewGetByteOffset); +b.InstallGetter(e.prototype,"byteLength", +DataViewGetByteLength); +b.InstallFunctions(e.prototype,2,[ +"getInt8",DataViewGetInt8JS, +"setInt8",DataViewSetInt8JS, +"getUint8",DataViewGetUint8JS, +"setUint8",DataViewSetUint8JS, +"getInt16",DataViewGetInt16JS, +"setInt16",DataViewSetInt16JS, +"getUint16",DataViewGetUint16JS, +"setUint16",DataViewSetUint16JS, +"getInt32",DataViewGetInt32JS, +"setInt32",DataViewSetInt32JS, +"getUint32",DataViewGetUint32JS, +"setUint32",DataViewSetUint32JS, +"getFloat32",DataViewGetFloat32JS, +"setFloat32",DataViewSetFloat32JS, +"getFloat64",DataViewGetFloat64JS, +"setFloat64",DataViewSetFloat64JS +]); +}) + +Hiterator-prototypeÕ +var $iteratorPrototype; +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Object; +var d=b.ImportNow("iterator_symbol"); +function IteratorPrototypeIterator(){ +return this; +} +b.SetFunctionName(IteratorPrototypeIterator,d); +%AddNamedProperty($iteratorPrototype,d, +IteratorPrototypeIterator,2); +}) + +$generator  +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Function; +var d; +var e=b.ImportNow("to_string_tag_symbol"); +b.Import(function(f){ +d=f.NewFunctionString; +}); +function GeneratorObjectNext(g){ +if(!(%_ClassOf(this)==='Generator')){ +throw MakeTypeError(36, +'[Generator].prototype.next',this); +} +var h=%GeneratorGetContinuation(this); +if(h>0){ +if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this); +try{ +return %_GeneratorNext(this,g); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(h==0){ +return{value:void 0,done:true}; +}else{ +throw MakeTypeError(34); +} +} +function GeneratorObjectThrow(i){ +if(!(%_ClassOf(this)==='Generator')){ +throw MakeTypeError(36, +'[Generator].prototype.throw',this); +} +var h=%GeneratorGetContinuation(this); +if(h>0){ +try{ +return %_GeneratorThrow(this,i); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(h==0){ +throw i; +}else{ +throw MakeTypeError(34); +} +} +function GeneratorFunctionConstructor(j){ +var k=d(arguments,'function*'); +var l=%GlobalProxy(GeneratorFunctionConstructor); +var m=%_CallFunction(l,%CompileString(k,true)); +%FunctionMarkNameShouldPrintAsAnonymous(m); +return m; +} +%NeverOptimizeFunction(GeneratorObjectNext); +%NeverOptimizeFunction(GeneratorObjectThrow); +var n=GeneratorFunctionPrototype.prototype; +b.InstallFunctions(n, +2, +["next",GeneratorObjectNext, +"throw",GeneratorObjectThrow]); +%AddNamedProperty(n,"constructor", +GeneratorFunctionPrototype,2|1); +%AddNamedProperty(n, +e,"Generator",2|1); +%InternalSetPrototype(GeneratorFunctionPrototype,c.prototype); +%AddNamedProperty(GeneratorFunctionPrototype, +e,"GeneratorFunction",2|1); +%AddNamedProperty(GeneratorFunctionPrototype,"constructor", +GeneratorFunction,2|1); +%InternalSetPrototype(GeneratorFunction,c); +%SetCode(GeneratorFunction,GeneratorFunctionConstructor); +}) + +8object-observe³ +var $observeEnqueueSpliceRecord; +var $observeBeginPerformSplice; +var $observeEndPerformSplice; +var $observeObjectMethods; +var $observeArrayMethods; +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Array; +var d=a.Object; +var e=b.InternalArray; +var f; +var g; +b.Import(function(h){ +f=h.ObjectFreeze; +g=h.ObjectIsFrozen; +}); +var i; +var j={}; +function GetObservationStateJS(){ +if((i===(void 0))){ +i=%GetObservationState(); +} +if((i.callbackInfoMap===(void 0))){ +i.callbackInfoMap=%ObservationWeakMapCreate(); +i.objectInfoMap=%ObservationWeakMapCreate(); +i.notifierObjectInfoMap=%ObservationWeakMapCreate(); +i.pendingObservers=null; +i.nextCallbackPriority=0; +i.lastMicrotaskId=0; +} +return i; +} +function GetPendingObservers(){ +return GetObservationStateJS().pendingObservers; +} +function SetPendingObservers(k){ +GetObservationStateJS().pendingObservers=k; +} +function GetNextCallbackPriority(){ +return GetObservationStateJS().nextCallbackPriority++; +} +function nullProtoObject(){ +return{__proto__:null}; +} +function TypeMapCreate(){ +return nullProtoObject(); +} +function TypeMapAddType(l,m,n){ +l[m]=n?1:(l[m]||0)+1; +} +function TypeMapRemoveType(l,m){ +l[m]--; +} +function TypeMapCreateFromList(o,p){ +var l=TypeMapCreate(); +for(var q=0;q0?y.performing:null; +} +function ConvertAcceptListToTypeMap(E){ +if((E===(void 0))) +return E; +if(!(%_IsSpecObject(E)))throw MakeTypeError(72); +var F=(%_ToInteger(E.length)); +if(F<0)F=0; +return TypeMapCreateFromList(E,F); +} +function CallbackInfoGet(v){ +return %WeakCollectionGet(GetObservationStateJS().callbackInfoMap,v, +$getHash(v)); +} +function CallbackInfoSet(v,C){ +%WeakCollectionSet(GetObservationStateJS().callbackInfoMap, +v,C,$getHash(v)); +} +function CallbackInfoGetOrCreate(v){ +var C=CallbackInfoGet(v); +if(!(C===(void 0))) +return C; +var D=GetNextCallbackPriority(); +CallbackInfoSet(v,D); +return D; +} +function CallbackInfoGetPriority(C){ +if((typeof(C)==='number')) +return C; +else +return C.priority; +} +function CallbackInfoNormalize(v){ +var C=CallbackInfoGet(v); +if((typeof(C)==='number')){ +var D=C; +C=new e; +C.priority=D; +CallbackInfoSet(v,C); +} +return C; +} +function ObjectObserve(z,v,w){ +if(!(%_IsSpecObject(z))) +throw MakeTypeError(74,"observe","observe"); +if(%IsJSGlobalProxy(z)) +throw MakeTypeError(70,"observe"); +if(%IsAccessCheckNeeded(z)) +throw MakeTypeError(71,"observe"); +if(!(typeof(v)==='function')) +throw MakeTypeError(73,"observe"); +if(g(v)) +throw MakeTypeError(69); +var G=%GetObjectContextObjectObserve(z); +return G(z,v,w); +} +function NativeObjectObserve(z,v,w){ +var y=ObjectInfoGetOrCreate(z); +var o=ConvertAcceptListToTypeMap(w); +ObjectInfoAddObserver(y,v,o); +return z; +} +function ObjectUnobserve(z,v){ +if(!(%_IsSpecObject(z))) +throw MakeTypeError(74,"unobserve","unobserve"); +if(%IsJSGlobalProxy(z)) +throw MakeTypeError(70,"unobserve"); +if(!(typeof(v)==='function')) +throw MakeTypeError(73,"unobserve"); +var y=ObjectInfoGet(z); +if((y===(void 0))) +return z; +ObjectInfoRemoveObserver(y,v); +return z; +} +function ArrayObserve(z,v){ +return ObjectObserve(z,v,['add', +'update', +'delete', +'splice']); +} +function ArrayUnobserve(z,v){ +return ObjectUnobserve(z,v); +} +function ObserverEnqueueIfActive(x,y,H){ +if(!ObserverIsActive(x,y)|| +!TypeMapHasType(ObserverGetAcceptTypes(x),H.type)){ +return; +} +var v=ObserverGetCallback(x); +if(!%ObserverObjectAndRecordHaveSameOrigin(v,H.object, +H)){ +return; +} +var C=CallbackInfoNormalize(v); +if((GetPendingObservers()===null)){ +SetPendingObservers(nullProtoObject()); +if((%_DebugIsActive()!=0)){ +var I=++GetObservationStateJS().lastMicrotaskId; +var J="Object.observe"; +%EnqueueMicrotask(function(){ +%DebugAsyncTaskEvent({type:"willHandle",id:I,name:J}); +ObserveMicrotaskRunner(); +%DebugAsyncTaskEvent({type:"didHandle",id:I,name:J}); +}); +%DebugAsyncTaskEvent({type:"enqueue",id:I,name:J}); +}else{ +%EnqueueMicrotask(ObserveMicrotaskRunner); +} +} +GetPendingObservers()[C.priority]=v; +C.push(H); +} +function ObjectInfoEnqueueExternalChangeRecord(y,H,m){ +if(!ObjectInfoHasActiveObservers(y)) +return; +var K=!(m===(void 0)); +var L=K? +{object:y.object,type:m}: +{object:y.object}; +for(var M in H){ +if(M==='object'||(K&&M==='type'))continue; +%DefineDataPropertyUnchecked( +L,M,H[M],1+4); +} +f(L); +ObjectInfoEnqueueInternalChangeRecord(y,L); +} +function ObjectInfoEnqueueInternalChangeRecord(y,H){ +if((typeof(H.name)==='symbol'))return; +if(ChangeObserversIsOptimized(y.changeObservers)){ +var x=y.changeObservers; +ObserverEnqueueIfActive(x,y,H); +return; +} +for(var D in y.changeObservers){ +var x=y.changeObservers[D]; +if((x===null)) +continue; +ObserverEnqueueIfActive(x,y,H); +} +} +function BeginPerformSplice(N){ +var y=ObjectInfoGet(N); +if(!(y===(void 0))) +ObjectInfoAddPerformingType(y,'splice'); +} +function EndPerformSplice(N){ +var y=ObjectInfoGet(N); +if(!(y===(void 0))) +ObjectInfoRemovePerformingType(y,'splice'); +} +function EnqueueSpliceRecord(N,O,P,Q){ +var y=ObjectInfoGet(N); +if(!ObjectInfoHasActiveObservers(y)) +return; +var H={ +type:'splice', +object:N, +index:O, +removed:P, +addedCount:Q +}; +f(H); +f(H.removed); +ObjectInfoEnqueueInternalChangeRecord(y,H); +} +function NotifyChange(m,z,J,R){ +var y=ObjectInfoGet(z); +if(!ObjectInfoHasActiveObservers(y)) +return; +var H; +if(arguments.length==2){ +H={type:m,object:z}; +}else if(arguments.length==3){ +H={type:m,object:z,name:J}; +}else{ +H={ +type:m, +object:z, +name:J, +oldValue:R +}; +} +f(H); +ObjectInfoEnqueueInternalChangeRecord(y,H); +} +function ObjectNotifierNotify(H){ +if(!(%_IsSpecObject(this))) +throw MakeTypeError(14,"notify"); +var y=ObjectInfoGetFromNotifier(this); +if((y===(void 0))) +throw MakeTypeError(75); +if(!(typeof(H.type)==='string')) +throw MakeTypeError(78); +ObjectInfoEnqueueExternalChangeRecord(y,H); +} +function ObjectNotifierPerformChange(S,T){ +if(!(%_IsSpecObject(this))) +throw MakeTypeError(14,"performChange"); +var y=ObjectInfoGetFromNotifier(this); +if((y===(void 0))) +throw MakeTypeError(75); +if(!(typeof(S)==='string')) +throw MakeTypeError(77); +if(!(typeof(T)==='function')) +throw MakeTypeError(76); +var U=%GetObjectContextNotifierPerformChange(y); +U(y,S,T); +} +function NativeObjectNotifierPerformChange(y,S,T){ +ObjectInfoAddPerformingType(y,S); +var H; +try{ +H=T(); +}finally{ +ObjectInfoRemovePerformingType(y,S); +} +if((%_IsSpecObject(H))) +ObjectInfoEnqueueExternalChangeRecord(y,H,S); +} +function ObjectGetNotifier(z){ +if(!(%_IsSpecObject(z))) +throw MakeTypeError(74,"getNotifier","getNotifier"); +if(%IsJSGlobalProxy(z)) +throw MakeTypeError(70,"getNotifier"); +if(%IsAccessCheckNeeded(z)) +throw MakeTypeError(71,"getNotifier"); +if(g(z))return null; +if(!%ObjectWasCreatedInCurrentOrigin(z))return null; +var V=%GetObjectContextObjectGetNotifier(z); +return V(z); +} +function NativeObjectGetNotifier(z){ +var y=ObjectInfoGetOrCreate(z); +return ObjectInfoGetNotifier(y); +} +function CallbackDeliverPending(v){ +var C=CallbackInfoGet(v); +if((C===(void 0))||(typeof(C)==='number')) +return false; +var D=C.priority; +CallbackInfoSet(v,D); +var k=GetPendingObservers(); +if(!(k===null)) +delete k[D]; +var W=[]; +%MoveArrayContents(C,W); +%DeliverObservationChangeRecords(v,W); +return true; +} +function ObjectDeliverChangeRecords(v){ +if(!(typeof(v)==='function')) +throw MakeTypeError(73,"deliverChangeRecords"); +while(CallbackDeliverPending(v)){} +} +function ObserveMicrotaskRunner(){ +var k=GetPendingObservers(); +if(!(k===null)){ +SetPendingObservers(null); +for(var q in k){ +CallbackDeliverPending(k[q]); +} +} +} +b.InstallFunctions(j,2,[ +"notify",ObjectNotifierNotify, +"performChange",ObjectNotifierPerformChange +]); +$observeObjectMethods=[ +"deliverChangeRecords",ObjectDeliverChangeRecords, +"getNotifier",ObjectGetNotifier, +"observe",ObjectObserve, +"unobserve",ObjectUnobserve +]; +$observeArrayMethods=[ +"observe",ArrayObserve, +"unobserve",ArrayUnobserve +]; +var X=function(Y,q){ +if(q % 2===1)%FunctionRemovePrototype(Y); +}; +$observeObjectMethods.forEach(X); +$observeArrayMethods.forEach(X); +$observeEnqueueSpliceRecord=EnqueueSpliceRecord; +$observeBeginPerformSplice=BeginPerformSplice; +$observeEndPerformSplice=EndPerformSplice; +%InstallToContext([ +"native_object_get_notifier",NativeObjectGetNotifier, +"native_object_notifier_perform_change",NativeObjectNotifierPerformChange, +"native_object_observe",NativeObjectObserve, +"observers_begin_perform_splice",BeginPerformSplice, +"observers_end_perform_splice",EndPerformSplice, +"observers_enqueue_splice",EnqueueSpliceRecord, +"observers_notify_change",NotifyChange, +]); +}) + +(collection½ˆ +var $getHash; +var $getExistingHash; +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Map; +var d=a.Object; +var e=a.Set; +var f=b.ImportNow("hash_code_symbol"); +var g; +var h=b.ImportNow("to_string_tag_symbol"); +b.Import(function(i){ +g=i.IntRandom; +}); +var j; +b.Import(function(i){ +j=i.NumberIsNaN; +}); +function HashToEntry(k,l,m){ +var n=(l&((m)-1)); +return((%_FixedArrayGet(k,(3+(n))|0))); +} +%SetForceInlineFlag(HashToEntry); +function SetFindEntry(k,m,o,l){ +var p=HashToEntry(k,l,m); +if(p===-1)return p; +var q=((%_FixedArrayGet(k,((3+(m)+((p)<<1)))|0))); +if(o===q)return p; +var r=j(o); +while(true){ +if(r&&j(q)){ +return p; +} +p=((%_FixedArrayGet(k,((3+(m)+((p)<<1))+1)|0))); +if(p===-1)return p; +q=((%_FixedArrayGet(k,((3+(m)+((p)<<1)))|0))); +if(o===q)return p; +} +return-1; +} +%SetForceInlineFlag(SetFindEntry); +function MapFindEntry(k,m,o,l){ +var p=HashToEntry(k,l,m); +if(p===-1)return p; +var q=((%_FixedArrayGet(k,((3+(m)+((p)*3)))|0))); +if(o===q)return p; +var r=j(o); +while(true){ +if(r&&j(q)){ +return p; +} +p=((%_FixedArrayGet(k,((3+(m)+((p)*3))+2)|0))); +if(p===-1)return p; +q=((%_FixedArrayGet(k,((3+(m)+((p)*3)))|0))); +if(o===q)return p; +} +return-1; +} +%SetForceInlineFlag(MapFindEntry); +function ComputeIntegerHash(o,s){ +var l=o; +l=l^s; +l=~l+(l<<15); +l=l^(l>>>12); +l=l+(l<<2); +l=l^(l>>>4); +l=(l*2057)|0; +l=l^(l>>>16); +return l&0x3fffffff; +} +%SetForceInlineFlag(ComputeIntegerHash); +function GetExistingHash(o){ +if(%_IsSmi(o)){ +return ComputeIntegerHash(o,0); +} +if((typeof(o)==='string')){ +var t=%_StringGetRawHashField(o); +if((t&1)===0){ +return t>>>2; +} +}else if((%_IsSpecObject(o))&&!%_IsJSProxy(o)&&!(%_ClassOf(o)==='global')){ +var l=(o[f]); +return l; +} +return %GenericHash(o); +} +%SetForceInlineFlag(GetExistingHash); +function GetHash(o){ +var l=GetExistingHash(o); +if((l===(void 0))){ +l=g()|0; +if(l===0)l=1; +(o[f]=l); +} +return l; +} +%SetForceInlineFlag(GetHash); +function SetConstructor(u){ +if(!%_IsConstructCall()){ +throw MakeTypeError(21,"Set"); +} +%_SetInitialize(this); +if(!(u==null)){ +var v=this.add; +if(!(typeof(v)==='function')){ +throw MakeTypeError(82,'add',this); +} +for(var w of u){ +%_Call(v,this,w); +} +} +} +function SetAdd(o){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(36,'Set.prototype.add',this); +} +if(o===0){ +o=0; +} +var k=%_JSCollectionGetTable(this); +var m=((%_FixedArrayGet(k,(0)|0))); +var l=GetHash(o); +if(SetFindEntry(k,m,o,l)!==-1)return this; +var x=((%_FixedArrayGet(k,(1)|0))); +var y=((%_FixedArrayGet(k,(2)|0))); +var z=m<<1; +if((x+y)>=z){ +%SetGrow(this); +k=%_JSCollectionGetTable(this); +m=((%_FixedArrayGet(k,(0)|0))); +x=((%_FixedArrayGet(k,(1)|0))); +y=((%_FixedArrayGet(k,(2)|0))); +} +var p=x+y; +var A=(3+(m)+((p)<<1)); +var n=(l&((m)-1)); +var B=((%_FixedArrayGet(k,(3+(n))|0))); +((%_FixedArraySet(k,(3+(n))|0,p))); +(((%_FixedArraySet(k,(1)|0,(x+1)|0)))); +(%_FixedArraySet(k,(A)|0,o)); +((%_FixedArraySet(k,(A+1)|0,(B)|0))); +return this; +} +function SetHas(o){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(36,'Set.prototype.has',this); +} +var k=%_JSCollectionGetTable(this); +var m=((%_FixedArrayGet(k,(0)|0))); +var l=GetExistingHash(o); +if((l===(void 0)))return false; +return SetFindEntry(k,m,o,l)!==-1; +} +function SetDelete(o){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(36, +'Set.prototype.delete',this); +} +var k=%_JSCollectionGetTable(this); +var m=((%_FixedArrayGet(k,(0)|0))); +var l=GetExistingHash(o); +if((l===(void 0)))return false; +var p=SetFindEntry(k,m,o,l); +if(p===-1)return false; +var x=((%_FixedArrayGet(k,(1)|0)))-1; +var y=((%_FixedArrayGet(k,(2)|0)))+1; +var A=(3+(m)+((p)<<1)); +(%_FixedArraySet(k,(A)|0,%_TheHole())); +(((%_FixedArraySet(k,(1)|0,(x)|0)))); +(((%_FixedArraySet(k,(2)|0,(y)|0)))); +if(x<(m>>>1))%SetShrink(this); +return true; +} +function SetGetSize(){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(36, +'Set.prototype.size',this); +} +var k=%_JSCollectionGetTable(this); +return((%_FixedArrayGet(k,(1)|0))); +} +function SetClearJS(){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(36, +'Set.prototype.clear',this); +} +%_SetClear(this); +} +function SetForEach(C,D){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(36, +'Set.prototype.forEach',this); +} +if(!(typeof(C)==='function'))throw MakeTypeError(13,C); +var E=new SetIterator(this,2); +var o; +var F=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(C); +var G=[(void 0)]; +while(%SetIteratorNext(E,G)){ +if(F)%DebugPrepareStepInIfStepping(C); +o=G[0]; +%_Call(C,D,o,o,this); +} +} +%SetCode(e,SetConstructor); +%FunctionSetLength(e,0); +%FunctionSetPrototype(e,new d()); +%AddNamedProperty(e.prototype,"constructor",e,2); +%AddNamedProperty(e.prototype,h,"Set", +2|1); +%FunctionSetLength(SetForEach,1); +b.InstallGetter(e.prototype,"size",SetGetSize); +b.InstallFunctions(e.prototype,2,[ +"add",SetAdd, +"has",SetHas, +"delete",SetDelete, +"clear",SetClearJS, +"forEach",SetForEach +]); +function MapConstructor(u){ +if(!%_IsConstructCall()){ +throw MakeTypeError(21,"Map"); +} +%_MapInitialize(this); +if(!(u==null)){ +var v=this.set; +if(!(typeof(v)==='function')){ +throw MakeTypeError(82,'set',this); +} +for(var H of u){ +if(!(%_IsSpecObject(H))){ +throw MakeTypeError(42,H); +} +%_Call(v,this,H[0],H[1]); +} +} +} +function MapGet(o){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(36, +'Map.prototype.get',this); +} +var k=%_JSCollectionGetTable(this); +var m=((%_FixedArrayGet(k,(0)|0))); +var l=GetExistingHash(o); +if((l===(void 0)))return(void 0); +var p=MapFindEntry(k,m,o,l); +if(p===-1)return(void 0); +return((%_FixedArrayGet(k,((3+(m)+((p)*3))+1)|0))); +} +function MapSet(o,w){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(36, +'Map.prototype.set',this); +} +if(o===0){ +o=0; +} +var k=%_JSCollectionGetTable(this); +var m=((%_FixedArrayGet(k,(0)|0))); +var l=GetHash(o); +var p=MapFindEntry(k,m,o,l); +if(p!==-1){ +var I=(3+(m)+((p)*3)); +(%_FixedArraySet(k,(I+1)|0,w)); +return this; +} +var x=((%_FixedArrayGet(k,(1)|0))); +var y=((%_FixedArrayGet(k,(2)|0))); +var z=m<<1; +if((x+y)>=z){ +%MapGrow(this); +k=%_JSCollectionGetTable(this); +m=((%_FixedArrayGet(k,(0)|0))); +x=((%_FixedArrayGet(k,(1)|0))); +y=((%_FixedArrayGet(k,(2)|0))); +} +p=x+y; +var A=(3+(m)+((p)*3)); +var n=(l&((m)-1)); +var B=((%_FixedArrayGet(k,(3+(n))|0))); +((%_FixedArraySet(k,(3+(n))|0,p))); +(((%_FixedArraySet(k,(1)|0,(x+1)|0)))); +(%_FixedArraySet(k,(A)|0,o)); +(%_FixedArraySet(k,(A+1)|0,w)); +(%_FixedArraySet(k,(A+2)|0,B)); +return this; +} +function MapHas(o){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(36, +'Map.prototype.has',this); +} +var k=%_JSCollectionGetTable(this); +var m=((%_FixedArrayGet(k,(0)|0))); +var l=GetHash(o); +return MapFindEntry(k,m,o,l)!==-1; +} +function MapDelete(o){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(36, +'Map.prototype.delete',this); +} +var k=%_JSCollectionGetTable(this); +var m=((%_FixedArrayGet(k,(0)|0))); +var l=GetHash(o); +var p=MapFindEntry(k,m,o,l); +if(p===-1)return false; +var x=((%_FixedArrayGet(k,(1)|0)))-1; +var y=((%_FixedArrayGet(k,(2)|0)))+1; +var A=(3+(m)+((p)*3)); +(%_FixedArraySet(k,(A)|0,%_TheHole())); +(%_FixedArraySet(k,(A+1)|0,%_TheHole())); +(((%_FixedArraySet(k,(1)|0,(x)|0)))); +(((%_FixedArraySet(k,(2)|0,(y)|0)))); +if(x<(m>>>1))%MapShrink(this); +return true; +} +function MapGetSize(){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(36, +'Map.prototype.size',this); +} +var k=%_JSCollectionGetTable(this); +return((%_FixedArrayGet(k,(1)|0))); +} +function MapClearJS(){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(36, +'Map.prototype.clear',this); +} +%_MapClear(this); +} +function MapForEach(C,D){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(36, +'Map.prototype.forEach',this); +} +if(!(typeof(C)==='function'))throw MakeTypeError(13,C); +var E=new MapIterator(this,3); +var F=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(C); +var G=[(void 0),(void 0)]; +while(%MapIteratorNext(E,G)){ +if(F)%DebugPrepareStepInIfStepping(C); +%_Call(C,D,G[1],G[0],this); +} +} +%SetCode(c,MapConstructor); +%FunctionSetLength(c,0); +%FunctionSetPrototype(c,new d()); +%AddNamedProperty(c.prototype,"constructor",c,2); +%AddNamedProperty( +c.prototype,h,"Map",2|1); +%FunctionSetLength(MapForEach,1); +b.InstallGetter(c.prototype,"size",MapGetSize); +b.InstallFunctions(c.prototype,2,[ +"get",MapGet, +"set",MapSet, +"has",MapHas, +"delete",MapDelete, +"clear",MapClearJS, +"forEach",MapForEach +]); +$getHash=GetHash; +$getExistingHash=GetExistingHash; +function MapFromArray(J){ +var K=new c; +var L=J.length; +for(var M=0;M0?"Promise.resolve":"Promise.reject"; +%DebugAsyncTaskEvent({type:"enqueue",id:C,name:D}); +} +} +function PromiseIdResolveHandler(p){return p} +function PromiseIdRejectHandler(q){throw q} +function PromiseNopResolver(){} +function IsPromise(p){ +return(%_IsSpecObject(p))&&(!(p[i]===(void 0))); +} +function PromiseCreate(){ +return new m(PromiseNopResolver) +} +function PromiseResolve(o,p){ +PromiseDone(o,+1,p,g) +} +function PromiseReject(o,q){ +if((o[i])==0){ +var G=(%_DebugIsActive()!=0); +if(G|| +!(!(o[e]===(void 0)))){ +%PromiseRejectEvent(o,q,G); +} +} +PromiseDone(o,-1,q,f) +} +function PromiseDeferred(){ +if(this===m){ +var o=PromiseInit(new m(h)); +return{ +promise:o, +resolve:function(p){PromiseResolve(o,p)}, +reject:function(q){PromiseReject(o,q)} +}; +}else{ +var B={promise:(void 0),reject:(void 0),resolve:(void 0)}; +B.promise=new this(function(H,I){ +B.resolve=H; +B.reject=I; +}); +return B; +} +} +function PromiseResolved(p){ +if(this===m){ +return PromiseCreateAndSet(+1,p); +}else{ +return new this(function(H,I){H(p)}); +} +} +function PromiseRejected(q){ +var o; +if(this===m){ +o=PromiseCreateAndSet(-1,q); +%PromiseRejectEvent(o,q,false); +}else{ +o=new this(function(H,I){I(q)}); +} +return o; +} +function PromiseChain(t,u){ +t=(t===(void 0))?PromiseIdResolveHandler:t; +u=(u===(void 0))?PromiseIdRejectHandler:u; +var z=%_CallFunction(this.constructor,PromiseDeferred); +switch((this[i])){ +case(void 0): +throw MakeTypeError(54,this); +case 0: +(this[g]).push(t,z); +(this[f]).push(u,z); +break; +case+1: +PromiseEnqueue((this[j]), +[t,z], ++1); +break; +case-1: +if(!(!(this[e]===(void 0)))){ +%PromiseRevokeReject(this); +} +PromiseEnqueue((this[j]), +[u,z], +-1); +break; +} +(this[e]=true); +if((%_DebugIsActive()!=0)){ +%DebugPromiseEvent({promise:z.promise,parentPromise:this}); +} +return z.promise; +} +function PromiseCatch(u){ +return this.then((void 0),u); +} +function PromiseThen(t,u){ +t=(typeof(t)==='function')?t:PromiseIdResolveHandler; +u=(typeof(u)==='function')?u:PromiseIdRejectHandler; +var J=this; +var x=this.constructor; +return %_CallFunction( +this, +function(p){ +p=PromiseCoerce(x,p); +if(p===J){ +if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(u)))%DebugPrepareStepInIfStepping(u); +return u(MakeTypeError(80,p)); +}else if(IsPromise(p)){ +return p.then(t,u); +}else{ +if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(t)))%DebugPrepareStepInIfStepping(t); +return t(p); +} +}, +u, +PromiseChain +); +} +function PromiseCast(p){ +return IsPromise(p)?p:new this(function(H){H(p)}); +} +function PromiseAll(K){ +var z=%_CallFunction(this,PromiseDeferred); +var L=[]; +try{ +var M=0; +var F=0; +for(var s of K){ +this.resolve(s).then( +(function(F){ +return function(p){ +L[F]=p; +if(--M===0)z.resolve(L); +} +})(F), +function(q){z.reject(q);}); +++F; +++M; +} +if(M===0){ +z.resolve(L); +} +}catch(e){ +z.reject(e) +} +return z.promise; +} +function PromiseRace(K){ +var z=%_CallFunction(this,PromiseDeferred); +try{ +for(var s of K){ +this.resolve(s).then( +function(p){z.resolve(p)}, +function(q){z.reject(q)}); +} +}catch(e){ +z.reject(e) +} +return z.promise; +} +function PromiseHasUserDefinedRejectHandlerRecursive(o){ +var N=(o[f]); +if((N===(void 0)))return false; +for(var F=0;F128){ +M=%_SubString(M,0,111)+"......"+ +%_SubString(M,M.length-2,M.length); +} +return M; +} +if((typeof(L)==='symbol'))return %_CallFunction(L,z); +if((%_IsSimdValue(L))){ +switch(typeof(L)){ +case'float32x4':return %_CallFunction(L,k); +case'int32x4':return %_CallFunction(L,p); +case'int16x8':return %_CallFunction(L,o); +case'int8x16':return %_CallFunction(L,q); +case'uint32x4':return %_CallFunction(L,B); +case'uint16x8':return %_CallFunction(L,A); +case'uint8x16':return %_CallFunction(L,C); +case'bool32x4':return %_CallFunction(L,e); +case'bool16x8':return %_CallFunction(L,d); +case'bool8x16':return %_CallFunction(L,f); +} +} +if((typeof(L)==='object') +&&%GetDataProperty(L,"toString")===u){ +var N=%GetDataProperty(L,"constructor"); +if(typeof N=="function"){ +var O=N.name; +if((typeof(O)==='string')&&O!==""){ +return"#<"+O+">"; +} +} +} +if(CanBeSafelyTreatedAsAnErrorObject(L)){ +return %_CallFunction(L,ErrorToString); +} +return %_CallFunction(L,NoSideEffectsObjectToString); +} +function CanBeSafelyTreatedAsAnErrorObject(L){ +switch(%_ClassOf(L)){ +case'Error': +case'EvalError': +case'RangeError': +case'ReferenceError': +case'SyntaxError': +case'TypeError': +case'URIError': +return true; +} +var P=%GetDataProperty(L,"toString"); +return L instanceof E&&P===ErrorToString; +} +function ToStringCheckErrorObject(L){ +if(CanBeSafelyTreatedAsAnErrorObject(L)){ +return %_CallFunction(L,ErrorToString); +}else{ +return(%_ToString(L)); +} +} +function ToDetailString(L){ +if(L!=null&&(typeof(L)==='object')&&L.toString===u){ +var N=L.constructor; +if(typeof N=="function"){ +var O=N.name; +if((typeof(O)==='string')&&O!==""){ +return"#<"+O+">"; +} +} +} +return ToStringCheckErrorObject(L); +} +function MakeGenericError(N,Q,R,S,T){ +var U=new N(FormatMessage(Q,R,S,T)); +U[s]=true; +return U; +} +%FunctionSetInstanceClassName(Script,'Script'); +%AddNamedProperty(Script.prototype,'constructor',Script, +2|4|1); +%SetCode(Script,function(V){ +throw MakeError(6); +}); +function FormatMessage(Q,R,S,T){ +var R=NoSideEffectToString(R); +var S=NoSideEffectToString(S); +var T=NoSideEffectToString(T); +try{ +return %FormatMessageString(Q,R,S,T); +}catch(e){ +return""; +} +} +function GetLineNumber(W){ +var X=%MessageGetStartPosition(W); +if(X==-1)return 0; +var Y=%MessageGetScript(W); +var Z=Y.locationFromPosition(X,true); +if(Z==null)return 0; +return Z.line+1; +} +function GetColumnNumber(W){ +var Y=%MessageGetScript(W); +var X=%MessageGetStartPosition(W); +var Z=Y.locationFromPosition(X,true); +if(Z==null)return-1; +return Z.column; +} +function GetSourceLine(W){ +var Y=%MessageGetScript(W); +var X=%MessageGetStartPosition(W); +var Z=Y.locationFromPosition(X,true); +if(Z==null)return""; +return Z.sourceText(); +} +function ScriptLineFromPosition(aa){ +var ab=0; +var ac=this.lineCount()-1; +var ad=this.line_ends; +if(aa>ad[ac]){ +return-1; +} +if(aa<=ad[0]){ +return 0; +} +while(ac>=1){ +var ae=(ab+ac)>>1; +if(aa>ad[ae]){ +ab=ae+1; +}else if(aa<=ad[ae-1]){ +ac=ae-1; +}else{ +return ae; +} +} +return-1; +} +function ScriptLocationFromPosition(aa, +include_resource_offset){ +var af=this.lineFromPosition(aa); +if(af==-1)return null; +var ad=this.line_ends; +var ag=af==0?0:ad[af-1]+1; +var ah=ad[af]; +if(ah>0&&%_CallFunction(this.source,ah-1,w)=='\r'){ +ah--; +} +var ai=aa-ag; +if(include_resource_offset){ +af+=this.line_offset; +if(af==this.line_offset){ +ai+=this.column_offset; +} +} +return new SourceLocation(this,aa,af,ai,ag,ah); +} +function ScriptLocationFromLine(aj,ak,al){ +var af=0; +if(!(aj===(void 0))){ +af=aj-this.line_offset; +} +var ai=ak||0; +if(af==0){ +ai-=this.column_offset; +} +var am=al||0; +if(af<0||ai<0||am<0)return null; +if(af==0){ +return this.locationFromPosition(am+ai,false); +}else{ +var an=this.lineFromPosition(am); +if(an==-1||an+af>=this.lineCount()){ +return null; +} +return this.locationFromPosition( +this.line_ends[an+af-1]+1+ai); +} +} +function ScriptSourceSlice(ao,ap){ +var aq=(ao===(void 0))?this.line_offset +:ao; +var ar=(ap===(void 0))?this.line_offset+this.lineCount() +:ap; +aq-=this.line_offset; +ar-=this.line_offset; +if(aq<0)aq=0; +if(ar>this.lineCount())ar=this.lineCount(); +if(aq>=this.lineCount()|| +ar<0|| +aq>ar){ +return null; +} +var ad=this.line_ends; +var as=aq==0?0:ad[aq-1]+1; +var at=ar==0?0:ad[ar-1]+1; +return new SourceSlice(this, +aq+this.line_offset, +ar+this.line_offset, +as,at); +} +function ScriptSourceLine(aj){ +var af=0; +if(!(aj===(void 0))){ +af=aj-this.line_offset; +} +if(af<0||this.lineCount()<=af){ +return null; +} +var ad=this.line_ends; +var ag=af==0?0:ad[af-1]+1; +var ah=ad[af]; +return %_CallFunction(this.source,ag,ah,y); +} +function ScriptLineCount(){ +return this.line_ends.length; +} +function ScriptLineEnd(au){ +return this.line_ends[au]; +} +function ScriptNameOrSourceURL(){ +if(this.source_url)return this.source_url; +return this.name; +} +b.SetUpLockedPrototype(Script,[ +"source", +"name", +"source_url", +"source_mapping_url", +"line_ends", +"line_offset", +"column_offset" +],[ +"lineFromPosition",ScriptLineFromPosition, +"locationFromPosition",ScriptLocationFromPosition, +"locationFromLine",ScriptLocationFromLine, +"sourceSlice",ScriptSourceSlice, +"sourceLine",ScriptSourceLine, +"lineCount",ScriptLineCount, +"nameOrSourceURL",ScriptNameOrSourceURL, +"lineEnd",ScriptLineEnd +] +); +function SourceLocation(Y,aa,af,ai,ag,ah){ +this.script=Y; +this.position=aa; +this.line=af; +this.column=ai; +this.start=ag; +this.end=ah; +} +function SourceLocationSourceText(){ +return %_CallFunction(this.script.source, +this.start, +this.end, +y); +} +b.SetUpLockedPrototype(SourceLocation, +["script","position","line","column","start","end"], +["sourceText",SourceLocationSourceText] +); +function SourceSlice(Y,aq,ar,as,at){ +this.script=Y; +this.from_line=aq; +this.to_line=ar; +this.from_position=as; +this.to_position=at; +} +function SourceSliceSourceText(){ +return %_CallFunction(this.script.source, +this.from_position, +this.to_position, +y); +} +b.SetUpLockedPrototype(SourceSlice, +["script","from_line","to_line","from_position","to_position"], +["sourceText",SourceSliceSourceText] +); +function GetStackTraceLine(av,aw,ax,ay){ +return new CallSite(av,aw,ax,false).toString(); +} +function CallSite(az,aw,ax,aA){ +(this[g]=az); +(this[h]=aw); +(this[i]=ax); +(this[j]=aA); +} +function CallSiteGetThis(){ +return(this[j]) +?(void 0):(this[g]); +} +function CallSiteGetFunction(){ +return(this[j]) +?(void 0):(this[h]); +} +function CallSiteGetPosition(){ +return(this[i]); +} +function CallSiteGetTypeName(){ +return GetTypeName((this[g]),false); +} +function CallSiteIsToplevel(){ +return %CallSiteIsToplevelRT(this); +} +function CallSiteIsEval(){ +return %CallSiteIsEvalRT(this); +} +function CallSiteGetEvalOrigin(){ +var Y=%FunctionGetScript((this[h])); +return FormatEvalOrigin(Y); +} +function CallSiteGetScriptNameOrSourceURL(){ +return %CallSiteGetScriptNameOrSourceUrlRT(this); +} +function CallSiteGetFunctionName(){ +return %CallSiteGetFunctionNameRT(this); +} +function CallSiteGetMethodName(){ +return %CallSiteGetMethodNameRT(this); +} +function CallSiteGetFileName(){ +return %CallSiteGetFileNameRT(this); +} +function CallSiteGetLineNumber(){ +return %CallSiteGetLineNumberRT(this); +} +function CallSiteGetColumnNumber(){ +return %CallSiteGetColumnNumberRT(this); +} +function CallSiteIsNative(){ +return %CallSiteIsNativeRT(this); +} +function CallSiteIsConstructor(){ +return %CallSiteIsConstructorRT(this); +} +function CallSiteToString(){ +var aB; +var aC=""; +if(this.isNative()){ +aC="native"; +}else{ +aB=this.getScriptNameOrSourceURL(); +if(!aB&&this.isEval()){ +aC=this.getEvalOrigin(); +aC+=", "; +} +if(aB){ +aC+=aB; +}else{ +aC+=""; +} +var aD=this.getLineNumber(); +if(aD!=null){ +aC+=":"+aD; +var aE=this.getColumnNumber(); +if(aE){ +aC+=":"+aE; +} +} +} +var af=""; +var aF=this.getFunctionName(); +var aG=true; +var aH=this.isConstructor(); +var aI=!(this.isToplevel()||aH); +if(aI){ +var aJ=GetTypeName((this[g]),true); +var aK=this.getMethodName(); +if(aF){ +if(aJ&& +%_CallFunction(aF,aJ,x)!=0){ +af+=aJ+"."; +} +af+=aF; +if(aK&& +(%_CallFunction(aF,"."+aK,x)!= +aF.length-aK.length-1)){ +af+=" [as "+aK+"]"; +} +}else{ +af+=aJ+"."+(aK||""); +} +}else if(aH){ +af+="new "+(aF||""); +}else if(aF){ +af+=aF; +}else{ +af+=aC; +aG=false; +} +if(aG){ +af+=" ("+aC+")"; +} +return af; +} +b.SetUpLockedPrototype(CallSite,["receiver","fun","pos"],[ +"getThis",CallSiteGetThis, +"getTypeName",CallSiteGetTypeName, +"isToplevel",CallSiteIsToplevel, +"isEval",CallSiteIsEval, +"getEvalOrigin",CallSiteGetEvalOrigin, +"getScriptNameOrSourceURL",CallSiteGetScriptNameOrSourceURL, +"getFunction",CallSiteGetFunction, +"getFunctionName",CallSiteGetFunctionName, +"getMethodName",CallSiteGetMethodName, +"getFileName",CallSiteGetFileName, +"getLineNumber",CallSiteGetLineNumber, +"getColumnNumber",CallSiteGetColumnNumber, +"isNative",CallSiteIsNative, +"getPosition",CallSiteGetPosition, +"isConstructor",CallSiteIsConstructor, +"toString",CallSiteToString +]); +function FormatEvalOrigin(Y){ +var aL=Y.nameOrSourceURL(); +if(aL){ +return aL; +} +var aM="eval at "; +if(Y.eval_from_function_name){ +aM+=Y.eval_from_function_name; +}else{ +aM+=""; +} +var aN=Y.eval_from_script; +if(aN){ +if(aN.compilation_type==1){ +aM+=" ("+FormatEvalOrigin(aN)+")"; +}else{ +if(aN.name){ +aM+=" ("+aN.name; +var Z=aN.locationFromPosition( +Y.eval_from_script_position,true); +if(Z){ +aM+=":"+(Z.line+1); +aM+=":"+(Z.column+1); +} +aM+=")"; +}else{ +aM+=" (unknown source)"; +} +} +} +return aM; +} +function FormatErrorString(U){ +try{ +return %_CallFunction(U,ErrorToString); +}catch(e){ +try{ +return""; +}catch(ee){ +return""; +} +} +} +function GetStackFrames(aO){ +var aP=new r(); +var aQ=aO[0]; +for(var ae=1;ae"; +}catch(ee){ +af=""; +} +} +aW.push(" at "+af); +} +return %_CallFunction(aW,"\n",c); +} +function GetTypeName(az,aY){ +if((az==null))return null; +var N=az.constructor; +if(!N){ +return aY?null: +%_CallFunction(az,NoSideEffectsObjectToString); +} +var O=N.name; +if(!O){ +return aY?null: +%_CallFunction(az,NoSideEffectsObjectToString); +} +return O; +} +var aZ=function(){ +var ba=(void 0); +var bb=this; +while(bb){ +var ba= +(bb[l]); +if((ba===(void 0))){ +var aV=(bb[v]); +if((aV===(void 0))){ +bb=%_GetPrototype(bb); +continue; +} +ba=FormatStackTrace(bb,aV); +(bb[v]=(void 0)); +(bb[l]=ba); +} +return ba; +} +return(void 0); +}; +var bc=function(bd){ +if((%HasOwnProperty(this,v))){ +(this[v]=(void 0)); +(this[l]=bd); +} +}; +var be=function(){}; +function DefineError(a,bf){ +var bg=bf.name; +%AddNamedProperty(a,bg,bf,2); +if(bg=='Error'){ +var bh=function(){}; +%FunctionSetPrototype(bh,n.prototype); +%FunctionSetInstanceClassName(bh,'Error'); +%FunctionSetPrototype(bf,new bh()); +}else{ +%FunctionSetPrototype(bf,new E()); +%InternalSetPrototype(bf,E); +} +%FunctionSetInstanceClassName(bf,'Error'); +%AddNamedProperty(bf.prototype,'constructor',bf,2); +%AddNamedProperty(bf.prototype,'name',bg,2); +%SetCode(bf,function(bi){ +if(%_IsConstructCall()){ +try{be(this,bf);}catch(e){} +if(!(bi===(void 0))){ +%AddNamedProperty(this,'message',(%_ToString(bi)),2); +} +}else{ +return new bf(bi); +} +}); +%SetNativeFlag(bf); +return bf; +}; +E=DefineError(a,function Error(){}); +K=DefineError(a,function EvalError(){}); +G=DefineError(a,function RangeError(){}); +J=DefineError(a,function ReferenceError(){}); +I=DefineError(a,function SyntaxError(){}); +F=DefineError(a,function TypeError(){}); +H=DefineError(a,function URIError(){}); +%AddNamedProperty(E.prototype,'message','',2); +function ErrorToString(){ +if(!(%_IsSpecObject(this))){ +throw MakeTypeError(14,"Error.prototype.toString"); +} +return %ErrorToStringRT(this); +} +b.InstallFunctions(E.prototype,2, +['toString',ErrorToString]); +$errorToString=ErrorToString; +MakeError=function(Q,R,S,T){ +return MakeGenericError(E,Q,R,S,T); +} +MakeRangeError=function(Q,R,S,T){ +return MakeGenericError(G,Q,R,S,T); +} +MakeSyntaxError=function(Q,R,S,T){ +return MakeGenericError(I,Q,R,S,T); +} +MakeTypeError=function(Q,R,S,T){ +return MakeGenericError(F,Q,R,S,T); +} +MakeURIError=function(){ +return MakeGenericError(H,240); +} +var bj=MakeRangeError(151); +%DefineAccessorPropertyUnchecked(bj,'stack', +aZ,bc, +2); +be=function captureStackTrace(L,bk){ +t(L,'stack',{get:aZ, +set:bc, +configurable:true}); +%CollectStackTrace(L,bk?bk:be); +}; +E.captureStackTrace=be; +%InstallToContext([ +"error_function",E, +"eval_error_function",K, +"get_stack_trace_line_fun",GetStackTraceLine, +"make_error_function",MakeGenericError, +"make_range_error",MakeRangeError, +"make_type_error",MakeTypeError, +"message_get_column_number",GetColumnNumber, +"message_get_line_number",GetLineNumber, +"message_get_source_line",GetSourceLine, +"no_side_effect_to_string_fun",NoSideEffectToString, +"range_error_function",G, +"reference_error_function",J, +"stack_overflow_boilerplate",bj, +"syntax_error_function",I, +"to_detail_string_fun",ToDetailString, +"type_error_function",F, +"uri_error_function",H, +]); +}); + +jsonõ: +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.JSON; +var d=b.InternalArray; +var e; +var f; +var g; +var h; +var i=b.ImportNow("to_string_tag_symbol"); +b.Import(function(j){ +e=j.MathMax; +f=j.MathMin; +g=j.ObjectHasOwnProperty; +h=j.ToNumber; +}); +function Revive(k,l,m){ +var n=k[l]; +if((typeof(n)==='object')){ +if((%_IsArray(n))){ +var o=n.length; +for(var p=0;p0){ +var E=",\n"+x; +D="[\n"+x+A.join(E)+"\n"+ +z+"]"; +}else{ +D="[]"; +} +w.pop(); +return D; +} +function SerializeObject(u,v,w,x,y){ +if(!%PushIfAbsent(w,u))throw MakeTypeError(18); +var z=x; +x+=y; +var A=new d(); +if((%_IsArray(v))){ +var o=v.length; +for(var p=0;p0){ +var E=",\n"+x; +D="{\n"+x+A.join(E)+"\n"+ +z+"}"; +}else{ +D="{}"; +} +w.pop(); +return D; +} +function JSONSerialize(G,k,v,w,x,y){ +var u=k[G]; +if((%_IsSpecObject(u))){ +var H=u.toJSON; +if((typeof(H)==='function')){ +u=%_Call(H,u,G); +} +} +if((typeof(v)==='function')){ +u=%_Call(v,k,G,u); +} +if((typeof(u)==='string')){ +return %QuoteJSONString(u); +}else if((typeof(u)==='number')){ +return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null"); +}else if((typeof(u)==='boolean')){ +return u?"true":"false"; +}else if((u===null)){ +return"null"; +}else if((%_IsSpecObject(u))&&!(typeof(u)==='function')){ +if((%_IsArray(u))){ +return SerializeArray(u,v,w,x,y); +}else if((%_ClassOf(u)==='Number')){ +u=h(u); +return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null"); +}else if((%_ClassOf(u)==='String')){ +return %QuoteJSONString((%_ToString(u))); +}else if((%_ClassOf(u)==='Boolean')){ +return %_ValueOf(u)?"true":"false"; +}else{ +return SerializeObject(u,v,w,x,y); +} +} +return(void 0); +} +function JSONStringify(u,v,I){ +if(%_ArgumentsLength()==1){ +return %BasicJSONStringify(u); +} +if((%_IsArray(v))){ +var J=new d(); +var K={__proto__:null}; +var o=v.length; +for(var p=0;p10){ +y=%_SubString(I,0,10); +}else{ +y=I; +} +}else{ +y=""; +} +return JSONSerialize('',{'':u},v,new d(),"",y); +} +%AddNamedProperty(c,i,"JSON",1|2); +b.InstallFunctions(c,2,[ +"parse",JSONParse, +"stringify",JSONStringify +]); +function JsonSerializeAdapter(G,N){ +var k={}; +k[G]=N; +return JSONSerialize(G,k,(void 0),new d(),"",""); +} +%InstallToContext(["json_serialize_adapter",JsonSerializeAdapter]); +}) + +8array-iterator = +var $arrayValues; +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c= +b.ImportNow("array_iteration_kind_symbol"); +var d= +b.ImportNow("array_iterator_next_symbol"); +var e= +b.ImportNow("array_iterator_object_symbol"); +var f=a.Array; +var g=b.ImportNow("iterator_symbol"); +var h=b.ImportNow("to_string_tag_symbol"); +var i=a.Uint8Array; + +var j=a.Int8Array; + +var k=a.Uint16Array; + +var l=a.Int16Array; + +var m=a.Uint32Array; + +var n=a.Int32Array; + +var o=a.Float32Array; + +var p=a.Float64Array; + +var q=a.Uint8ClampedArray; + + +function ArrayIterator(){} +function CreateArrayIterator(r,s){ +var t=(%_ToObject(r)); +var u=new ArrayIterator; +(u[e]=t); +(u[d]=0); +(u[c]=s); +return u; +} +function ArrayIteratorIterator(){ +return this; +} +function ArrayIteratorNext(){ +var u=this; +var v=(void 0); +var w=true; +if(!(%_IsSpecObject(u))|| +!(!(u[d]===(void 0)))){ +throw MakeTypeError(36, +'Array Iterator.prototype.next',this); +} +var r=(u[e]); +if(!(r===(void 0))){ +var x=(u[d]); +var y=(u[c]); +var z=(r.length>>>0); +if(x>=z){ +(u[e]=(void 0)); +}else{ +(u[d]=x+1); +if(y==2){ +v=r[x]; +}else if(y==3){ +v=[x,r[x]]; +}else{ +v=x; +} +w=false; +} +} +return %_CreateIterResultObject(v,w); +} +function ArrayEntries(){ +return CreateArrayIterator(this,3); +} +function ArrayValues(){ +return CreateArrayIterator(this,2); +} +function ArrayKeys(){ +return CreateArrayIterator(this,1); +} +%FunctionSetPrototype(ArrayIterator,{__proto__:$iteratorPrototype}); +%FunctionSetInstanceClassName(ArrayIterator,'Array Iterator'); +b.InstallFunctions(ArrayIterator.prototype,2,[ +'next',ArrayIteratorNext +]); +b.SetFunctionName(ArrayIteratorIterator,g); +%AddNamedProperty(ArrayIterator.prototype,g, +ArrayIteratorIterator,2); +%AddNamedProperty(ArrayIterator.prototype,h, +"Array Iterator",1|2); +b.InstallFunctions(f.prototype,2,[ +'entries',ArrayEntries, +'keys',ArrayKeys +]); +b.SetFunctionName(ArrayValues,'values'); +%AddNamedProperty(f.prototype,g,ArrayValues, +2); +%AddNamedProperty(i.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(i.prototype,'values',ArrayValues,2); +%AddNamedProperty(i.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(i.prototype,g,ArrayValues, +2); + +%AddNamedProperty(j.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(j.prototype,'values',ArrayValues,2); +%AddNamedProperty(j.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(j.prototype,g,ArrayValues, +2); + +%AddNamedProperty(k.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(k.prototype,'values',ArrayValues,2); +%AddNamedProperty(k.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(k.prototype,g,ArrayValues, +2); + +%AddNamedProperty(l.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(l.prototype,'values',ArrayValues,2); +%AddNamedProperty(l.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(l.prototype,g,ArrayValues, +2); + +%AddNamedProperty(m.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(m.prototype,'values',ArrayValues,2); +%AddNamedProperty(m.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(m.prototype,g,ArrayValues, +2); + +%AddNamedProperty(n.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(n.prototype,'values',ArrayValues,2); +%AddNamedProperty(n.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(n.prototype,g,ArrayValues, +2); + +%AddNamedProperty(o.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(o.prototype,'values',ArrayValues,2); +%AddNamedProperty(o.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(o.prototype,g,ArrayValues, +2); + +%AddNamedProperty(p.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(p.prototype,'values',ArrayValues,2); +%AddNamedProperty(p.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(p.prototype,g,ArrayValues, +2); + +%AddNamedProperty(q.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(q.prototype,'values',ArrayValues,2); +%AddNamedProperty(q.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(q.prototype,g,ArrayValues, +2); + + +$arrayValues=ArrayValues; +%InstallToContext(["array_values_iterator",ArrayValues]); +}) + +>>0); +if(m>=n){ +(j[e]=(void 0)); +}else{ +var o=%_StringCharCodeAt(i,m); +k=%_StringCharFromCode(o); +l=false; +m++; +if(o>=0xD800&&o<=0xDBFF&&m=0xDC00&&p<=0xDFFF){ +k+=%_StringCharFromCode(p); +m++; +} +} +(j[f]=m); +} +} +return %_CreateIterResultObject(k,l); +} +function StringPrototypeIterator(){ +return CreateStringIterator(this); +} +%FunctionSetPrototype(StringIterator,{__proto__:$iteratorPrototype}); +%FunctionSetInstanceClassName(StringIterator,'String Iterator'); +b.InstallFunctions(StringIterator.prototype,2,[ +'next',StringIteratorNext +]); +%AddNamedProperty(StringIterator.prototype,g, +"String Iterator",1|2); +b.SetFunctionName(StringPrototypeIterator,d); +%AddNamedProperty(c.prototype,d, +StringPrototypeIterator,2); +}) + +$templatesi +(function(a,b){ +"use strict"; +%CheckIsBootstrapping(); +var c=a.Map; +var d=b.InternalArray; +var e=new c; +var f=c.prototype.get; +var g=c.prototype.set; +function SameCallSiteElements(h,i){ +var j=h.length; +var i=i.raw; +if(j!==i.length)return false; +for(var k=0;k0){ +if(l in p){ +p[r]=p[l]; +}else{ +delete p[r]; +} +l=l+u; +r=r+u; +t--; +} +return p; +} +function ArrayCopyWithin(m,n,o){ +if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.copyWithin"); +var p=(%_ToObject(this)); +var q=(%ToLength(p.length)); +return InnerArrayCopyWithin(m,n,o,p,q); +} +function InnerArrayFind(v,w,p,q){ +if(!(typeof(v)==='function')){ +throw MakeTypeError(13,v); +} +for(var x=0;xq)x=q; +} +if(o<0){ +o+=q; +if(o<0)o=0; +}else{ +if(o>q)o=q; +} +if((o-x)>0&&i(p)){ +throw MakeTypeError(10); +} +for(;x>>0)); +return InnerArrayFill(z,n,o,p,q); +} +function AddArrayElement(A,p,x,z){ +if(A===e){ +%AddElement(p,x,z); +}else{ +j(p,x,{ +value:z,writable:true,configurable:true,enumerable:true +}); +} +} +function ArrayFrom(B,C,D){ +var E=(%_ToObject(B)); +var F=!(C===(void 0)); +if(F){ +if(!(typeof(C)==='function')){ +throw MakeTypeError(13,C); +} +} +var G=d(E,f); +var H; +var I; +var J; +var K; +if(!(G===(void 0))){ +I=%IsConstructor(this)?new this():[]; +var L=c(E,G); +H=0; +while(true){ +var M=L.next(); +if(!(typeof(M)==='object')){ +throw MakeTypeError(41,M); +} +if(M.done){ +I.length=H; +return I; +} +K=M.value; +if(F){ +J=%_Call(C,D,K,H); +}else{ +J=K; +} +AddArrayElement(this,I,H,J); +H++; +} +}else{ +var N=(%ToLength(E.length)); +I=%IsConstructor(this)?new this(N):new e(N); +for(H=0;H0){ +return L(O,%_Arguments(0)); +}else{ +return L(O); +} +} +} +%FunctionSetName(P,N); +%FunctionRemovePrototype(P); +%SetNativeFlag(P); +this[N]=P; +} +return this[N]; +} +%FunctionSetName(getter,K); +%FunctionRemovePrototype(getter); +%SetNativeFlag(getter); +o(J.prototype,K,{ +get:getter, +enumerable:false, +configurable:true +}); +} +function supportedLocalesOf(S,T,U){ +if((%_CallFunction(S,GetServiceRE(),s)===null)){ +throw MakeError(7,S); +} +if((U===(void 0))){ +U={}; +}else{ +U=(%_ToObject(U)); +} +var V=U.localeMatcher; +if(!(V===(void 0))){ +V=l(V); +if(V!=='lookup'&&V!=='best fit'){ +throw MakeRangeError(147,V); +} +}else{ +V='best fit'; +} +var W=initializeLocaleList(T); +if((z[S]===(void 0))){ +z[S]=getAvailableLocalesOf(S); +} +if(V==='best fit'){ +return initializeLocaleList(bestFitSupportedLocalesOf( +W,z[S])); +} +return initializeLocaleList(lookupSupportedLocalesOf( +W,z[S])); +} +function lookupSupportedLocalesOf(W,X){ +var Y=[]; +for(var Z=0;Z=3&&M<=8&&!(ao===(void 0))){ +an[ao]=ap; +ao=(void 0); +}else{ +return{}; +} +} +return an; +} +function setOptions(aq,an,ar,ad,as){ +var al=''; +var at=function updateExtension(au,ai){ +return'-'+au+'-'+l(ai); +} +var av=function updateProperty(ae,af,ai){ +if(af==='boolean'&&(typeof ai==='string')){ +ai=(ai==='true')?true:false; +} +if(!(ae===(void 0))){ +defineWEProperty(as,ae,ai); +} +} +for(var au in ar){ +if(%HasOwnProperty(ar,au)){ +var ai=(void 0); +var aw=ar[au]; +if(!(aw.property===(void 0))){ +ai=ad(aw.property,aw.type,aw.values); +} +if(!(ai===(void 0))){ +av(aw.property,aw.type,ai); +al+=at(au,ai); +continue; +} +if(%HasOwnProperty(an,au)){ +ai=an[au]; +if(!(ai===(void 0))){ +av(aw.property,aw.type,ai); +al+=at(au,ai); +}else if(aw.type==='boolean'){ +av(aw.property,aw.type,true); +al+=at(au,true); +} +} +} +} +return al===''?'':'-u'+al; +} +function freezeArray(ax){ +var ay=ax.length; +for(var Z=0;Z>>0); +for(var aL=0;aLbo){ +throw MakeRangeError(150,ae); +} +return m(ai); +} +return bp; +} +function initializeNumberFormat(bq,T,U){ +if(%IsInitializedIntlObject(bq)){ +throw MakeTypeError(99,"NumberFormat"); +} +if((U===(void 0))){ +U={}; +} +var ad=getGetOption(U,'numberformat'); +var aa=resolveLocale('numberformat',T,U); +var be={}; +defineWEProperty(be,'style',ad( +'style','string',['decimal','percent','currency'],'decimal')); +var bm=ad('currency','string'); +if(!(bm===(void 0))&&!isWellFormedCurrencyCode(bm)){ +throw MakeRangeError(134,bm); +} +if(be.style==='currency'&&(bm===(void 0))){ +throw MakeTypeError(22); +} +var br=ad( +'currencyDisplay','string',['code','symbol','name'],'symbol'); +if(be.style==='currency'){ +defineWEProperty(be,'currency',%StringToUpperCase(bm)); +defineWEProperty(be,'currencyDisplay',br); +} +var bs=getNumberOption(U,'minimumIntegerDigits',1,21,1); +defineWEProperty(be,'minimumIntegerDigits',bs); +var bt=U['minimumFractionDigits']; +var bu=U['maximumFractionDigits']; +if(!(bt===(void 0))||be.style!=='currency'){ +bt=getNumberOption(U,'minimumFractionDigits',0,20,0); +defineWEProperty(be,'minimumFractionDigits',bt); +} +if(!(bu===(void 0))||be.style!=='currency'){ +var bv=be.style==='percent'?0:3; +bt=(bt===(void 0))?0:bt; +fallback_limit=(bt>bv)?bt:bv; +bu=getNumberOption(U,'maximumFractionDigits',bt,20,fallback_limit); +defineWEProperty(be,'maximumFractionDigits',bu); +} +var bw=U['minimumSignificantDigits']; +var bx=U['maximumSignificantDigits']; +if(!(bw===(void 0))||!(bx===(void 0))){ +bw=getNumberOption(U,'minimumSignificantDigits',1,21,0); +defineWEProperty(be,'minimumSignificantDigits',bw); +bx=getNumberOption(U,'maximumSignificantDigits',bw,21,21); +defineWEProperty(be,'maximumSignificantDigits',bx); +} +defineWEProperty(be,'useGrouping',ad( +'useGrouping','boolean',(void 0),true)); +var an=parseExtension(aa.extension); +var by={ +'nu':{'property':(void 0),'type':'string'} +}; +var al=setOptions(U,an,by, +ad,be); +var bj=aa.locale+al; +var aj=n({},{ +currency:{writable:true}, +currencyDisplay:{writable:true}, +locale:{writable:true}, +maximumFractionDigits:{writable:true}, +minimumFractionDigits:{writable:true}, +minimumIntegerDigits:{writable:true}, +numberingSystem:{writable:true}, +requestedLocale:{value:bj,writable:true}, +style:{value:be.style,writable:true}, +useGrouping:{writable:true} +}); +if(%HasOwnProperty(be,'minimumSignificantDigits')){ +defineWEProperty(aj,'minimumSignificantDigits',(void 0)); +} +if(%HasOwnProperty(be,'maximumSignificantDigits')){ +defineWEProperty(aj,'maximumSignificantDigits',(void 0)); +} +var bz=%CreateNumberFormat(bj, +be, +aj); +if(be.style==='currency'){ +o(aj,'currencyDisplay',{value:br, +writable:true}); +} +%MarkAsInitializedIntlObjectOfType(bq,'numberformat',bz); +o(bq,'resolved',{value:aj}); +return bq; +} +%AddNamedProperty(y,'NumberFormat',function(){ +var T=%_Arguments(0); +var U=%_Arguments(1); +if(!this||this===y){ +return new y.NumberFormat(T,U); +} +return initializeNumberFormat((%_ToObject(this)),T,U); +}, +2 +); +%AddNamedProperty(y.NumberFormat.prototype,'resolvedOptions',function(){ +if(%_IsConstructCall()){ +throw MakeTypeError(79); +} +if(!%IsInitializedIntlObjectOfType(this,'numberformat')){ +throw MakeTypeError(100,"NumberFormat"); +} +var bA=this; +var aa=getOptimalLanguageTag(bA.resolved.requestedLocale, +bA.resolved.locale); +var bB={ +locale:aa, +numberingSystem:bA.resolved.numberingSystem, +style:bA.resolved.style, +useGrouping:bA.resolved.useGrouping, +minimumIntegerDigits:bA.resolved.minimumIntegerDigits, +minimumFractionDigits:bA.resolved.minimumFractionDigits, +maximumFractionDigits:bA.resolved.maximumFractionDigits, +}; +if(bB.style==='currency'){ +defineWECProperty(bB,'currency',bA.resolved.currency); +defineWECProperty(bB,'currencyDisplay', +bA.resolved.currencyDisplay); +} +if(%HasOwnProperty(bA.resolved,'minimumSignificantDigits')){ +defineWECProperty(bB,'minimumSignificantDigits', +bA.resolved.minimumSignificantDigits); +} +if(%HasOwnProperty(bA.resolved,'maximumSignificantDigits')){ +defineWECProperty(bB,'maximumSignificantDigits', +bA.resolved.maximumSignificantDigits); +} +return bB; +}, +2 +); +%FunctionSetName(y.NumberFormat.prototype.resolvedOptions, +'resolvedOptions'); +%FunctionRemovePrototype(y.NumberFormat.prototype.resolvedOptions); +%SetNativeFlag(y.NumberFormat.prototype.resolvedOptions); +%AddNamedProperty(y.NumberFormat,'supportedLocalesOf',function(T){ +if(%_IsConstructCall()){ +throw MakeTypeError(79); +} +return supportedLocalesOf('numberformat',T,%_Arguments(1)); +}, +2 +); +%FunctionSetName(y.NumberFormat.supportedLocalesOf,'supportedLocalesOf'); +%FunctionRemovePrototype(y.NumberFormat.supportedLocalesOf); +%SetNativeFlag(y.NumberFormat.supportedLocalesOf); +function formatNumber(bz,ai){ +var bC=ToNumber(ai)+0; +return %InternalNumberFormat(%GetImplFromInitializedIntlObject(bz), +bC); +} +function parseNumber(bz,ai){ +return %InternalNumberParse(%GetImplFromInitializedIntlObject(bz), +l(ai)); +} +addBoundMethod(y.NumberFormat,'format',formatNumber,1); +addBoundMethod(y.NumberFormat,'v8Parse',parseNumber,1); +function toLDMLString(U){ +var ad=getGetOption(U,'dateformat'); +var bD=''; +var bE=ad('weekday','string',['narrow','short','long']); +bD+=appendToLDMLString( +bE,{narrow:'EEEEE',short:'EEE',long:'EEEE'}); +bE=ad('era','string',['narrow','short','long']); +bD+=appendToLDMLString( +bE,{narrow:'GGGGG',short:'GGG',long:'GGGG'}); +bE=ad('year','string',['2-digit','numeric']); +bD+=appendToLDMLString(bE,{'2-digit':'yy','numeric':'y'}); +bE=ad('month','string', +['2-digit','numeric','narrow','short','long']); +bD+=appendToLDMLString(bE,{'2-digit':'MM','numeric':'M', +'narrow':'MMMMM','short':'MMM','long':'MMMM'}); +bE=ad('day','string',['2-digit','numeric']); +bD+=appendToLDMLString( +bE,{'2-digit':'dd','numeric':'d'}); +var bF=ad('hour12','boolean'); +bE=ad('hour','string',['2-digit','numeric']); +if((bF===(void 0))){ +bD+=appendToLDMLString(bE,{'2-digit':'jj','numeric':'j'}); +}else if(bF===true){ +bD+=appendToLDMLString(bE,{'2-digit':'hh','numeric':'h'}); +}else{ +bD+=appendToLDMLString(bE,{'2-digit':'HH','numeric':'H'}); +} +bE=ad('minute','string',['2-digit','numeric']); +bD+=appendToLDMLString(bE,{'2-digit':'mm','numeric':'m'}); +bE=ad('second','string',['2-digit','numeric']); +bD+=appendToLDMLString(bE,{'2-digit':'ss','numeric':'s'}); +bE=ad('timeZoneName','string',['short','long']); +bD+=appendToLDMLString(bE,{short:'z',long:'zzzz'}); +return bD; +} +function appendToLDMLString(bE,bG){ +if(!(bE===(void 0))){ +return bG[bE]; +}else{ +return''; +} +} +function fromLDMLString(bD){ +bD=%_CallFunction(bD,GetQuotedStringRE(),'', +t); +var U={}; +var bH=%_CallFunction(bD,/E{3,5}/g,s); +U=appendToDateTimeObject( +U,'weekday',bH,{EEEEE:'narrow',EEE:'short',EEEE:'long'}); +bH=%_CallFunction(bD,/G{3,5}/g,s); +U=appendToDateTimeObject( +U,'era',bH,{GGGGG:'narrow',GGG:'short',GGGG:'long'}); +bH=%_CallFunction(bD,/y{1,2}/g,s); +U=appendToDateTimeObject( +U,'year',bH,{y:'numeric',yy:'2-digit'}); +bH=%_CallFunction(bD,/M{1,5}/g,s); +U=appendToDateTimeObject(U,'month',bH,{MM:'2-digit', +M:'numeric',MMMMM:'narrow',MMM:'short',MMMM:'long'}); +bH=%_CallFunction(bD,/L{1,5}/g,s); +U=appendToDateTimeObject(U,'month',bH,{LL:'2-digit', +L:'numeric',LLLLL:'narrow',LLL:'short',LLLL:'long'}); +bH=%_CallFunction(bD,/d{1,2}/g,s); +U=appendToDateTimeObject( +U,'day',bH,{d:'numeric',dd:'2-digit'}); +bH=%_CallFunction(bD,/h{1,2}/g,s); +if(bH!==null){ +U['hour12']=true; +} +U=appendToDateTimeObject( +U,'hour',bH,{h:'numeric',hh:'2-digit'}); +bH=%_CallFunction(bD,/H{1,2}/g,s); +if(bH!==null){ +U['hour12']=false; +} +U=appendToDateTimeObject( +U,'hour',bH,{H:'numeric',HH:'2-digit'}); +bH=%_CallFunction(bD,/m{1,2}/g,s); +U=appendToDateTimeObject( +U,'minute',bH,{m:'numeric',mm:'2-digit'}); +bH=%_CallFunction(bD,/s{1,2}/g,s); +U=appendToDateTimeObject( +U,'second',bH,{s:'numeric',ss:'2-digit'}); +bH=%_CallFunction(bD,/z|zzzz/g,s); +U=appendToDateTimeObject( +U,'timeZoneName',bH,{z:'short',zzzz:'long'}); +return U; +} +function appendToDateTimeObject(U,bE,bH,bG){ +if((bH===null)){ +if(!%HasOwnProperty(U,bE)){ +defineWEProperty(U,bE,(void 0)); +} +return U; +} +var ae=bH[0]; +defineWEProperty(U,bE,bG[ae]); +return U; +} +function toDateTimeOptions(U,bI,bJ){ +if((U===(void 0))){ +U={}; +}else{ +U=(%_ToObject(U)); +} +var bK=true; +if((bI==='date'||bI==='any')&& +(!(U.weekday===(void 0))||!(U.year===(void 0))|| +!(U.month===(void 0))||!(U.day===(void 0)))){ +bK=false; +} +if((bI==='time'||bI==='any')&& +(!(U.hour===(void 0))||!(U.minute===(void 0))|| +!(U.second===(void 0)))){ +bK=false; +} +if(bK&&(bJ==='date'||bJ==='all')){ +o(U,'year',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +o(U,'month',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +o(U,'day',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +} +if(bK&&(bJ==='time'||bJ==='all')){ +o(U,'hour',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +o(U,'minute',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +o(U,'second',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +} +return U; +} +function initializeDateTimeFormat(bL,T,U){ +if(%IsInitializedIntlObject(bL)){ +throw MakeTypeError(99,"DateTimeFormat"); +} +if((U===(void 0))){ +U={}; +} +var aa=resolveLocale('dateformat',T,U); +U=toDateTimeOptions(U,'any','date'); +var ad=getGetOption(U,'dateformat'); +var V=ad('formatMatcher','string', +['basic','best fit'],'best fit'); +var bD=toLDMLString(U); +var bM=canonicalizeTimeZoneID(U.timeZone); +var be={}; +var an=parseExtension(aa.extension); +var bN={ +'ca':{'property':(void 0),'type':'string'}, +'nu':{'property':(void 0),'type':'string'} +}; +var al=setOptions(U,an,bN, +ad,be); +var bj=aa.locale+al; +var aj=n({},{ +calendar:{writable:true}, +day:{writable:true}, +era:{writable:true}, +hour12:{writable:true}, +hour:{writable:true}, +locale:{writable:true}, +minute:{writable:true}, +month:{writable:true}, +numberingSystem:{writable:true}, +pattern:{writable:true}, +requestedLocale:{value:bj,writable:true}, +second:{writable:true}, +timeZone:{writable:true}, +timeZoneName:{writable:true}, +tz:{value:bM,writable:true}, +weekday:{writable:true}, +year:{writable:true} +}); +var bz=%CreateDateTimeFormat( +bj,{skeleton:bD,timeZone:bM},aj); +if(!(bM===(void 0))&&bM!==aj.timeZone){ +throw MakeRangeError(156,bM); +} +%MarkAsInitializedIntlObjectOfType(bL,'dateformat',bz); +o(bL,'resolved',{value:aj}); +return bL; +} +%AddNamedProperty(y,'DateTimeFormat',function(){ +var T=%_Arguments(0); +var U=%_Arguments(1); +if(!this||this===y){ +return new y.DateTimeFormat(T,U); +} +return initializeDateTimeFormat((%_ToObject(this)),T,U); +}, +2 +); +%AddNamedProperty(y.DateTimeFormat.prototype,'resolvedOptions',function(){ +if(%_IsConstructCall()){ +throw MakeTypeError(79); +} +if(!%IsInitializedIntlObjectOfType(this,'dateformat')){ +throw MakeTypeError(100,"DateTimeFormat"); +} +var bO={ +'gregorian':'gregory', +'japanese':'japanese', +'buddhist':'buddhist', +'roc':'roc', +'persian':'persian', +'islamic-civil':'islamicc', +'islamic':'islamic', +'hebrew':'hebrew', +'chinese':'chinese', +'indian':'indian', +'coptic':'coptic', +'ethiopic':'ethiopic', +'ethiopic-amete-alem':'ethioaa' +}; +var bA=this; +var bP=fromLDMLString(bA.resolved.pattern); +var bQ=bO[bA.resolved.calendar]; +if((bQ===(void 0))){ +bQ=bA.resolved.calendar; +} +var aa=getOptimalLanguageTag(bA.resolved.requestedLocale, +bA.resolved.locale); +var bB={ +locale:aa, +numberingSystem:bA.resolved.numberingSystem, +calendar:bQ, +timeZone:bA.resolved.timeZone +}; +addWECPropertyIfDefined(bB,'timeZoneName',bP.timeZoneName); +addWECPropertyIfDefined(bB,'era',bP.era); +addWECPropertyIfDefined(bB,'year',bP.year); +addWECPropertyIfDefined(bB,'month',bP.month); +addWECPropertyIfDefined(bB,'day',bP.day); +addWECPropertyIfDefined(bB,'weekday',bP.weekday); +addWECPropertyIfDefined(bB,'hour12',bP.hour12); +addWECPropertyIfDefined(bB,'hour',bP.hour); +addWECPropertyIfDefined(bB,'minute',bP.minute); +addWECPropertyIfDefined(bB,'second',bP.second); +return bB; +}, +2 +); +%FunctionSetName(y.DateTimeFormat.prototype.resolvedOptions, +'resolvedOptions'); +%FunctionRemovePrototype(y.DateTimeFormat.prototype.resolvedOptions); +%SetNativeFlag(y.DateTimeFormat.prototype.resolvedOptions); +%AddNamedProperty(y.DateTimeFormat,'supportedLocalesOf',function(T){ +if(%_IsConstructCall()){ +throw MakeTypeError(79); +} +return supportedLocalesOf('dateformat',T,%_Arguments(1)); +}, +2 +); +%FunctionSetName(y.DateTimeFormat.supportedLocalesOf,'supportedLocalesOf'); +%FunctionRemovePrototype(y.DateTimeFormat.supportedLocalesOf); +%SetNativeFlag(y.DateTimeFormat.supportedLocalesOf); +function formatDate(bz,bR){ +var bS; +if((bR===(void 0))){ +bS=%DateCurrentTime(); +}else{ +bS=ToNumber(bR); +} +if(!f(bS))throw MakeRangeError(128); +return %InternalDateFormat(%GetImplFromInitializedIntlObject(bz), +new i(bS)); +} +function parseDate(bz,ai){ +return %InternalDateParse(%GetImplFromInitializedIntlObject(bz), +l(ai)); +} +addBoundMethod(y.DateTimeFormat,'format',formatDate,0); +addBoundMethod(y.DateTimeFormat,'v8Parse',parseDate,1); +function canonicalizeTimeZoneID(bT){ +if((bT===(void 0))){ +return bT; +} +var bU=%StringToUpperCase(bT); +if(bU==='UTC'||bU==='GMT'|| +bU==='ETC/UTC'||bU==='ETC/GMT'){ +return'UTC'; +} +var bH=%_CallFunction(bT,GetTimezoneNameCheckRE(),s); +if((bH===null))throw MakeRangeError(129,bT); +var bB=toTitleCaseWord(bH[1])+'/'+toTitleCaseWord(bH[2]); +var Z=3; +while(!(bH[Z]===(void 0))&&Z0){ +if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this); +try{ +return %_GeneratorNext(this,g); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(h==0){ +return{value:void 0,done:true}; +}else{ +throw MakeTypeError(34); +} +} +function GeneratorObjectThrow(i){ +if(!(%_ClassOf(this)==='Generator')){ +throw MakeTypeError(36, +'[Generator].prototype.throw',this); +} +var h=%GeneratorGetContinuation(this); +if(h>0){ +try{ +return %_GeneratorThrow(this,i); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(h==0){ +throw i; +}else{ +throw MakeTypeError(34); +} +} +function GeneratorFunctionConstructor(j){ +var k=d(arguments,'function*'); +var l=%GlobalProxy(GeneratorFunctionConstructor); +var m=%_CallFunction(l,%CompileString(k,true)); +%FunctionMarkNameShouldPrintAsAnonymous(m); +return m; +} +%NeverOptimizeFunction(GeneratorObjectNext); +%NeverOptimizeFunction(GeneratorObjectThrow); +var n=GeneratorFunctionPrototype.prototype; +b.InstallFunctions(n, +2, +["next",GeneratorObjectNext, +"throw",GeneratorObjectThrow]); +%AddNamedProperty(n,"constructor", +GeneratorFunctionPrototype,2|1); +%AddNamedProperty(n, +e,"Generator",2|1); +%InternalSetPrototype(GeneratorFunctionPrototype,c.prototype); +%AddNamedProperty(GeneratorFunctionPrototype, +e,"GeneratorFunction",2|1); +%AddNamedProperty(GeneratorFunctionPrototype,"constructor", +GeneratorFunction,2|1); +%InternalSetPrototype(GeneratorFunction,c); +%SetCode(GeneratorFunction,GeneratorFunctionConstructor); +}) + +=%_TypedArrayGetLength(i)){ +return(void 0); +} +k=e(k); +l=e(l); +return %_AtomicsCompareExchange(i,j,k,l); +} +function AtomicsLoadJS(i,j){ +CheckSharedIntegerTypedArray(i); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(i)){ +return(void 0); +} +return %_AtomicsLoad(i,j); +} +function AtomicsStoreJS(i,j,m){ +CheckSharedIntegerTypedArray(i); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(i)){ +return(void 0); +} +m=e(m); +return %_AtomicsStore(i,j,m); +} +function AtomicsAddJS(h,j,m){ +CheckSharedIntegerTypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +m=e(m); +return %_AtomicsAdd(h,j,m); +} +function AtomicsSubJS(h,j,m){ +CheckSharedIntegerTypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +m=e(m); +return %_AtomicsSub(h,j,m); +} +function AtomicsAndJS(h,j,m){ +CheckSharedIntegerTypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +m=e(m); +return %_AtomicsAnd(h,j,m); +} +function AtomicsOrJS(h,j,m){ +CheckSharedIntegerTypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +m=e(m); +return %_AtomicsOr(h,j,m); +} +function AtomicsXorJS(h,j,m){ +CheckSharedIntegerTypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +m=e(m); +return %_AtomicsXor(h,j,m); +} +function AtomicsExchangeJS(h,j,m){ +CheckSharedIntegerTypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +m=e(m); +return %_AtomicsExchange(h,j,m); +} +function AtomicsIsLockFreeJS(n){ +return %_AtomicsIsLockFree(n); +} +function AtomicsFutexWaitJS(h,j,m,o){ +CheckSharedInteger32TypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +if((o===(void 0))){ +o=(1/0); +}else{ +o=e(o); +if((!%_IsSmi(%IS_VAR(o))&&!(o==o))){ +o=(1/0); +}else{ +o=d(0,o); +} +} +return %AtomicsFutexWait(h,j,m,o); +} +function AtomicsFutexWakeJS(h,j,p){ +CheckSharedInteger32TypedArray(h); +j=(%_ToInteger(j)); +if(j<0||j>=%_TypedArrayGetLength(h)){ +return(void 0); +} +p=d(0,(%_ToInteger(p))); +return %AtomicsFutexWake(h,j,p); +} +function AtomicsFutexWakeOrRequeueJS(h,q,p,m,r){ +CheckSharedInteger32TypedArray(h); +q=(%_ToInteger(q)); +p=d(0,(%_ToInteger(p))); +m=(m|0); +r=(%_ToInteger(r)); +if(q<0||q>=%_TypedArrayGetLength(h)|| +r<0||r>=%_TypedArrayGetLength(h)){ +return(void 0); +} +return %AtomicsFutexWakeOrRequeue(h,q,p,m,r); +} +function AtomicsConstructor(){} +var s=new AtomicsConstructor(); +%InternalSetPrototype(s,c.prototype); +%AddNamedProperty(a,"Atomics",s,2); +%FunctionSetInstanceClassName(AtomicsConstructor,'Atomics'); +%AddNamedProperty(s,f,"Atomics",1|2); +b.InstallConstants(s,[ +"OK",0, +"NOTEQUAL",-1, +"TIMEDOUT",-2, +]); +b.InstallFunctions(s,2,[ +"compareExchange",AtomicsCompareExchangeJS, +"load",AtomicsLoadJS, +"store",AtomicsStoreJS, +"add",AtomicsAddJS, +"sub",AtomicsSubJS, +"and",AtomicsAndJS, +"or",AtomicsOrJS, +"xor",AtomicsXorJS, +"exchange",AtomicsExchangeJS, +"isLockFree",AtomicsIsLockFreeJS, +"futexWait",AtomicsFutexWaitJS, +"futexWake",AtomicsFutexWakeJS, +"futexWakeOrRequeue",AtomicsFutexWakeOrRequeueJS, +]); +}) + +Xharmony-array-includesñ +(function(a,b){ +'use strict'; +%CheckIsBootstrapping(); +var c=a.Array; +function InnerArrayIncludes(d,e,f,g){ +if(g===0){ +return false; +} +var h=(%_ToInteger(e)); +var i; +if(h>=0){ +i=h; +}else{ +i=g+h; +if(i<0){ +i=0; +} +} +while(i + +@class MTLModel; + +// A MTLModel object that supports being parsed from and serialized to JSON. +@protocol MTLJSONSerializing +@required + +// Specifies how to map property keys to different key paths in JSON. +// +// Subclasses overriding this method should combine their values with those of +// `super`. +// +// Any property keys not present in the dictionary are assumed to match the JSON +// key that should be used. Any keys associated with NSNull will not participate +// in JSON serialization. +// +// Returns a dictionary mapping property keys to JSON key paths (as strings) or +// NSNull values. ++ (NSDictionary *)JSONKeyPathsByPropertyKey; + +@optional + +// Specifies how to convert a JSON value to the given property key. If +// reversible, the transformer will also be used to convert the property value +// back to JSON. +// +// If the receiver implements a `+JSONTransformer` method, MTLJSONAdapter +// will use the result of that method instead. +// +// Returns a value transformer, or nil if no transformation should be performed. ++ (NSValueTransformer *)JSONTransformerForKey:(NSString *)key; + +// Overridden to parse the receiver as a different class, based on information +// in the provided dictionary. +// +// This is mostly useful for class clusters, where the abstract base class would +// be passed into -[MTLJSONAdapter initWithJSONDictionary:modelClass:], but +// a subclass should be instantiated instead. +// +// JSONDictionary - The JSON dictionary that will be parsed. +// +// Returns the class that should be parsed (which may be the receiver), or nil +// to abort parsing (e.g., if the data is invalid). ++ (Class)classForParsingJSONDictionary:(NSDictionary *)JSONDictionary; + +@end + +// The domain for errors originating from MTLJSONAdapter. +extern NSString * const MTLJSONAdapterErrorDomain; + +// +classForParsingJSONDictionary: returned nil for the given dictionary. +extern const NSInteger MTLJSONAdapterErrorNoClassFound; + +// The provided JSONDictionary is not valid. +extern const NSInteger MTLJSONAdapterErrorInvalidJSONDictionary; + +// The model's implementation of +JSONKeyPathsByPropertyKey included a key which +// does not actually exist in +propertyKeys. +extern const NSInteger MTLJSONAdapterErrorInvalidJSONMapping; + +// Converts a MTLModel object to and from a JSON dictionary. +@interface MTLJSONAdapter : NSObject + +// The model object that the receiver was initialized with, or that the receiver +// parsed from a JSON dictionary. +@property (nonatomic, strong, readonly) MTLModel *model; + +// Attempts to parse a JSON dictionary into a model object. +// +// modelClass - The MTLModel subclass to attempt to parse from the JSON. +// This class must conform to . This +// argument must not be nil. +// JSONDictionary - A dictionary representing JSON data. This should match the +// format returned by NSJSONSerialization. If this argument is +// nil, the method returns nil. +// error - If not NULL, this may be set to an error that occurs during +// parsing or initializing an instance of `modelClass`. +// +// Returns an instance of `modelClass` upon success, or nil if a parsing error +// occurred. ++ (id)modelOfClass:(Class)modelClass fromJSONDictionary:(NSDictionary *)JSONDictionary error:(NSError **)error; + +// Attempts to parse an array of JSON dictionary objects into a model objects +// of a specific class. +// +// modelClass - The MTLModel subclass to attempt to parse from the JSON. This +// class must conform to . This argument must +// not be nil. +// JSONArray - A array of dictionaries representing JSON data. This should +// match the format returned by NSJSONSerialization. If this +// argument is nil, the method returns nil. +// error - If not NULL, this may be set to an error that occurs during +// parsing or initializing an any of the instances of +// `modelClass`. +// +// Returns an array of `modelClass` instances upon success, or nil if a parsing +// error occurred. ++ (NSArray *)modelsOfClass:(Class)modelClass fromJSONArray:(NSArray *)JSONArray error:(NSError **)error; + +// Converts a model into a JSON representation. +// +// model - The model to use for JSON serialization. This argument must not be +// nil. +// +// Returns a JSON dictionary, or nil if a serialization error occurred. ++ (NSDictionary *)JSONDictionaryFromModel:(MTLModel *)model; + +// Converts a array of models into a JSON representation. +// +// models - The array of models to use for JSON serialization. This argument +// must not be nil. +// +// Returns a JSON array, or nil if a serialization error occurred for any +// model. ++ (NSArray *)JSONArrayFromModels:(NSArray *)models; + +// Initializes the receiver by attempting to parse a JSON dictionary into +// a model object. +// +// JSONDictionary - A dictionary representing JSON data. This should match the +// format returned by NSJSONSerialization. If this argument is +// nil, the method returns nil and an error with code +// MTLJSONAdapterErrorInvalidJSONDictionary. +// modelClass - The MTLModel subclass to attempt to parse from the JSON. +// This class must conform to . This +// argument must not be nil. +// error - If not NULL, this may be set to an error that occurs during +// parsing or initializing an instance of `modelClass`. +// +// Returns an initialized adapter upon success, or nil if a parsing error +// occurred. +- (id)initWithJSONDictionary:(NSDictionary *)JSONDictionary modelClass:(Class)modelClass error:(NSError **)error; + +// Initializes the receiver with an existing model. +// +// model - The model to use for JSON serialization. This argument must not be +// nil. +- (id)initWithModel:(MTLModel *)model; + +// Serializes the receiver's `model` into JSON. +// +// Returns a JSON dictionary, or nil if a serialization error occurred. +- (NSDictionary *)JSONDictionary; + +// Looks up the JSON key path in the model's +propertyKeys. +// +// Subclasses may override this method to customize the adapter's seralizing +// behavior. You should not call this method directly. +// +// key - The property key to retrieve the corresponding JSON key path for. This +// argument must not be nil. +// +// Returns a key path to use, or nil to omit the property from JSON. +- (NSString *)JSONKeyPathForPropertyKey:(NSString *)key; + +@end + +@interface MTLJSONAdapter (Deprecated) + ++ (id)modelOfClass:(Class)modelClass fromJSONDictionary:(NSDictionary *)JSONDictionary __attribute__((deprecated("Replaced by +modelOfClass:fromJSONDictionary:error:"))); +- (id)initWithJSONDictionary:(NSDictionary *)JSONDictionary modelClass:(Class)modelClass __attribute__((deprecated("Replaced by -initWithJSONDictionary:modelClass:error:"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLManagedObjectAdapter.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLManagedObjectAdapter.h new file mode 100644 index 0000000..11b2bcf --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLManagedObjectAdapter.h @@ -0,0 +1,215 @@ +// +// MTLManagedObjectAdapter.h +// Mantle +// +// Created by Justin Spahr-Summers on 2013-03-29. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import + +@class MTLModel; + +// A MTLModel object that supports being serialized to and from Core Data as an +// NSManagedObject. +@protocol MTLManagedObjectSerializing +@required + +// The name of the Core Data entity that the receiver serializes to and +// deserializes from. +// +// This method must not return nil. ++ (NSString *)managedObjectEntityName; + +// Specifies how to map property keys to different keys on the receiver's +// +managedObjectEntity. +// +// Entity attributes will be mapped to and from the receiver's properties using +// +entityAttributeTransformerForKey:. Entity relationships will be mapped to +// and from MTLModel objects using +relationshipModelClassesByPropertyKey. +// Fetched properties are not supported. +// +// Subclasses overriding this method should combine their values with those of +// `super`. +// +// Any property keys not present in the dictionary are assumed to match the +// entity key that should be used. Any keys associated with NSNull will not +// participate in managed object serialization. +// +// Returns a dictionary mapping property keys to entity keys (as strings) or +// NSNull values. ++ (NSDictionary *)managedObjectKeysByPropertyKey; + +@optional + +// Specifies a set of property keys used by the adapter to check for an already +// existing managed object when converting the MTLModel to its related +// NSManagedObject. +// +// The adapter will first map any keys provided by this method to the correct +// keys in managedObjectKeysByPropertyKey. +// +// The adapter will then perform a fetch request in the provided context for a +// managed object that matches the MTLModel's managedObjectEntityName and has +// equal values set for the property keys on the MTLModel. +// +// The managed object returned by the fetch request will then be set with all +// values from the MTLModel that the managed object is being converted from. +// +// If a property value of our MTLModel is yet another MTLModel which needs to be +// converted to a managed object, the class for that MTLModel can also implement +// this method to perform its own uniqing. +// +// For example: +// 1. An MTLModel subclass has id_number = 10. +// 2. An NSManagedObject accessible to the adapter's context has idnumber = 10. +// 3. managedObjectKeysByPropertyKey returns @{@"id_number" : @"idnumber"} +// 4. propertyKeysForManagedObjectUniquing returns +// [NSSet setWithObject:@"id_number"]; +// 5. Then our fetch request may return this managed object (or another managed +// object with idnumber = 10). +// +// NOTE: If multiple managed objects follow the same uniquing criteria only one +// of them will be set with our MTLModel's values. ++ (NSSet *)propertyKeysForManagedObjectUniquing; + +// Specifies how to convert the given property key to a managed object +// attribute. If reversible, the transformer will also be used to convert the +// managed object attribute back to the property. +// +// If the receiver implements a `+EntityAttributeTransformer` method, +// MTLManagedObjectAdapter will use the result of that method instead. +// +// Returns a value transformer, or nil if no transformation should be performed. ++ (NSValueTransformer *)entityAttributeTransformerForKey:(NSString *)key; + +// Specifies the MTLModel subclasses that should be deserialized to the +// receiver's property keys when a property key corresponds to an entity +// relationship. +// +// In other words, the dictionary returned by this method is used to decode +// managed object relationships into MTLModels (or NSArrays or NSSets thereof) +// set on the receiver. +// +// If a property key is omitted from the returned dictionary, but present in +// +managedObjectKeysByPropertyKey, and the receiver's +managedObjectEntity has +// a relationship at the corresponding key, an exception will be thrown during +// deserialization. +// +// Subclasses overriding this method should combine their values with those of +// `super`. +// +// Returns a dictionary mapping property keys to the Class objects that should +// be used. ++ (NSDictionary *)relationshipModelClassesByPropertyKey; + +// Overridden to deserialize a different class instead of the receiver, based on +// information in the provided object. +// +// This is mostly useful for class clusters, where the abstract base class would +// be passed into +[MTLManagedObjectAdapter +// modelOfClass:fromManagedObject:error:], but a subclass should be instantiated +// instead. +// +// managedObject - The object that will be deserialized. +// +// Returns the class that should be instantiated (which may be the receiver), or +// nil to abort parsing (e.g., if the data is invalid). ++ (Class)classForDeserializingManagedObject:(NSManagedObject *)managedObject; + +// Overriden when merging the value of the given key on the receiver with the +// value of the same key from the given `NSManagedObject` requires custom +// handling. +// +// By default, this method is not implemented, and precedence will be given to +// the value of the receiving model implicitly. +// +// When implemented, this method is called when an existing `NSManagedObject` +// is found for the receiving model, before updating the `NSManagedObject`'s +// properties. +// +// When implementing, you should use `+managedObjectKeysByPropertyKey` to map +// the given `key` to the appropriate `NSManagedObject` property. +- (void)mergeValueForKey:(NSString *)key fromManagedObject:(NSManagedObject *)managedObject; + +// Overriden when merging values on the receiver with the given +// `NSManagedObject` requires custom handling. +// +// By default, this method is not implemented, and precedence will be given to +// the values of the receiving model implicitly. +// +// When implemented, this method is called when an existing `NSManagedObject` +// is found for the receiving model, before updating the `NSManagedObject`'s +// properties. +// +// When implementing, you should use `+managedObjectKeysByPropertyKey` to map +// the given `key` to the appropriate `NSManagedObject` property. +// +// If you have also implemented `mergeValueForKey:fromManagedObject:` you have +// to make sure to call `mergeValueForKey:fromManagedObject:` from this method +// when appropriate. +- (void)mergeValuesForKeysFromManagedObject:(NSManagedObject *)managedObject; + +@end + +// The domain for errors originating from MTLManagedObjectAdapter. +extern NSString * const MTLManagedObjectAdapterErrorDomain; + +// +classForDeserializingManagedObject: returned nil for the given object. +extern const NSInteger MTLManagedObjectAdapterErrorNoClassFound; + +// An NSManagedObject failed to initialize. +extern const NSInteger MTLManagedObjectAdapterErrorInitializationFailed; + +// The managed object key specified by +managedObjectKeysByPropertyKey does not +// exist in the NSEntityDescription. +extern const NSInteger MTLManagedObjectAdapterErrorInvalidManagedObjectKey; + +// The managed object property specified has a type that isn't supported by +// MTLManagedObjectAdapter. +extern const NSInteger MTLManagedObjectAdapterErrorUnsupportedManagedObjectPropertyType; + +// The fetch request to find an existing managed object based on +// `+propertyKeysForManagedObjectUniquing` failed. +extern const NSInteger MTLManagedObjectAdapterErrorUniqueFetchRequestFailed; + +// A MTLModel property cannot be serialized to or deserialized from an +// NSManagedObject relationship. +// +// For a to-one relationship, this means that the property does not contain +// a MTLModel, or the MTLModel does not conform to . +// +// For a to-many relationship, this means that the property does not contain an +// NSArray or NSSet of MTLModel instances. +extern const NSInteger MTLManagedObjectAdapterErrorUnsupportedRelationshipClass; + +// The model's implementation of +managedObjectKeysByPropertyKey included a key +// which does not actually exist in +propertyKeys. +extern const NSInteger MTLManagedObjectAdapterErrorInvalidManagedObjectMapping; + +// Converts a MTLModel object to and from an NSManagedObject. +@interface MTLManagedObjectAdapter : NSObject + +// Attempts to deserialize an NSManagedObject into a MTLModel object. +// +// modelClass - The MTLModel subclass to return. This class must conform to +// . This argument must not be nil. +// managedObject - The managed object to deserialize. If this argument is nil, +// the method returns nil. +// error - If not NULL, this may be set to an error that occurs during +// deserialization or initializing an instance of `modelClass`. +// +// Returns an instance of `modelClass` upon success, or nil if an error +// occurred. ++ (id)modelOfClass:(Class)modelClass fromManagedObject:(NSManagedObject *)managedObject error:(NSError **)error; + +// Serializes a MTLModel into an NSManagedObject. +// +// model - The model object to serialize. This argument must not be nil. +// context - The context into which to insert the created managed object. This +// argument must not be nil. +// error - If not NULL, this may be set to an error that occurs during +// serialization or insertion. ++ (id)managedObjectFromModel:(MTLModel *)model insertingIntoContext:(NSManagedObjectContext *)context error:(NSError **)error; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel+NSCoding.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel+NSCoding.h new file mode 100644 index 0000000..94b8f7b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel+NSCoding.h @@ -0,0 +1,128 @@ +// +// MTLModel+NSCoding.h +// Mantle +// +// Created by Justin Spahr-Summers on 2013-02-12. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import "MTLModel.h" + +// Defines how a MTLModel property key should be encoded into an archive. +// +// MTLModelEncodingBehaviorExcluded - The property should never be encoded. +// MTLModelEncodingBehaviorUnconditional - The property should always be +// encoded. +// MTLModelEncodingBehaviorConditional - The object should be encoded only +// if unconditionally encoded elsewhere. +// This should only be used for object +// properties. +typedef enum : NSUInteger { + MTLModelEncodingBehaviorExcluded = 0, + MTLModelEncodingBehaviorUnconditional, + MTLModelEncodingBehaviorConditional, +} MTLModelEncodingBehavior; + +// Implements default archiving and unarchiving behaviors for MTLModel. +@interface MTLModel (NSCoding) + +// Initializes the receiver from an archive. +// +// This will decode the original +modelVersion of the archived object, then +// invoke -decodeValueForKey:withCoder:modelVersion: for each of the receiver's +// +propertyKeys. +// +// Returns an initialized model object, or nil if a decoding error occurred. +- (id)initWithCoder:(NSCoder *)coder; + +// Archives the receiver using the given coder. +// +// This will encode the receiver's +modelVersion, then the receiver's properties +// according to the behaviors specified in +encodingBehaviorsByPropertyKey. +- (void)encodeWithCoder:(NSCoder *)coder; + +// Determines how the +propertyKeys of the class are encoded into an archive. +// The values of this dictionary should be boxed MTLModelEncodingBehavior +// values. +// +// Any keys not present in the dictionary will be excluded from the archive. +// +// Subclasses overriding this method should combine their values with those of +// `super`. +// +// Returns a dictionary mapping the receiver's +propertyKeys to default encoding +// behaviors. If a property is an object with `weak` semantics, the default +// behavior is MTLModelEncodingBehaviorConditional; otherwise, the default is +// MTLModelEncodingBehaviorUnconditional. ++ (NSDictionary *)encodingBehaviorsByPropertyKey; + +// Determines the classes that are allowed to be decoded for each of the +// receiver's properties when using . The values of this +// dictionary should be NSArrays of Class objects. +// +// If any encodable keys (as determined by +encodingBehaviorsByPropertyKey) are +// not present in the dictionary, an exception will be thrown during secure +// encoding or decoding. +// +// Subclasses overriding this method should combine their values with those of +// `super`. +// +// Returns a dictionary mapping the receiver's encodable keys (as determined by +// +encodingBehaviorsByPropertyKey) to default allowed classes, based on the +// type that each property is declared as. If type of an encodable property +// cannot be determined (e.g., it is declared as `id`), it will be omitted from +// the dictionary, and subclasses must provide a valid value to prevent an +// exception being thrown during encoding/decoding. ++ (NSDictionary *)allowedSecureCodingClassesByPropertyKey; + +// Decodes the value of the given property key from an archive. +// +// By default, this method looks for a `-decodeWithCoder:modelVersion:` +// method on the receiver, and invokes it if found. +// +// If the custom method is not implemented and `coder` does not require secure +// coding, `-[NSCoder decodeObjectForKey:]` will be invoked with the given +// `key`. +// +// If the custom method is not implemented and `coder` requires secure coding, +// `-[NSCoder decodeObjectOfClasses:forKey:]` will be invoked with the +// information from +allowedSecureCodingClassesByPropertyKey and the given `key`. The +// receiver must conform to for this to work correctly. +// +// key - The property key to decode the value for. This argument cannot +// be nil. +// coder - The NSCoder representing the archive being decoded. This +// argument cannot be nil. +// modelVersion - The version of the original model object that was encoded. +// +// Returns the decoded and boxed value, or nil if the key was not present. +- (id)decodeValueForKey:(NSString *)key withCoder:(NSCoder *)coder modelVersion:(NSUInteger)modelVersion; + +// The version of this MTLModel subclass. +// +// This version number is saved in archives so that later model changes can be +// made backwards-compatible with old versions. +// +// Subclasses should override this method to return a higher version number +// whenever a breaking change is made to the model. +// +// Returns 0. ++ (NSUInteger)modelVersion; + +@end + +// This method must be overridden to support archives created by older versions +// of Mantle (before the `MTLModel+NSCoding` interface existed). +@interface MTLModel (OldArchiveSupport) + +// Converts an archived external representation to a dictionary suitable for +// passing to -initWithDictionary:. +// +// externalRepresentation - The decoded external representation of the receiver. +// fromVersion - The model version at the time the external +// representation was encoded. +// +// Returns nil by default, indicating that conversion failed. ++ (NSDictionary *)dictionaryValueFromArchivedExternalRepresentation:(NSDictionary *)externalRepresentation version:(NSUInteger)fromVersion; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel.h new file mode 100644 index 0000000..65da40d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel.h @@ -0,0 +1,125 @@ +// +// MTLModel.h +// Mantle +// +// Created by Justin Spahr-Summers on 2012-09-11. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +// An abstract base class for model objects, using reflection to provide +// sensible default behaviors. +// +// The default implementations of , -hash, and -isEqual: make use of +// the +propertyKeys method. +@interface MTLModel : NSObject + +// Returns a new instance of the receiver initialized using +// -initWithDictionary:error:. ++ (instancetype)modelWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error; + +// Initializes the receiver with default values. +// +// This is the designated initializer for this class. +- (instancetype)init; + +// Initializes the receiver using key-value coding, setting the keys and values +// in the given dictionary. +// +// Subclass implementations may override this method, calling the super +// implementation, in order to perform further processing and initialization +// after deserialization. +// +// dictionaryValue - Property keys and values to set on the receiver. Any NSNull +// values will be converted to nil before being used. KVC +// validation methods will automatically be invoked for all of +// the properties given. If nil, this method is equivalent to +// -init. +// error - If not NULL, this may be set to any error that occurs +// (like a KVC validation error). +// +// Returns an initialized model object, or nil if validation failed. +- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error; + +// Returns the keys for all @property declarations, except for `readonly` +// properties without ivars, or properties on MTLModel itself. ++ (NSSet *)propertyKeys; + +// A dictionary representing the properties of the receiver. +// +// The default implementation combines the values corresponding to all +// +propertyKeys into a dictionary, with any nil values represented by NSNull. +// +// This property must never be nil. +@property (nonatomic, copy, readonly) NSDictionary *dictionaryValue; + +// Merges the value of the given key on the receiver with the value of the same +// key from the given model object, giving precedence to the other model object. +// +// By default, this method looks for a `-mergeFromModel:` method on the +// receiver, and invokes it if found. If not found, and `model` is not nil, the +// value for the given key is taken from `model`. +- (void)mergeValueForKey:(NSString *)key fromModel:(MTLModel *)model; + +// Merges the values of the given model object into the receiver, using +// -mergeValueForKey:fromModel: for each key in +propertyKeys. +// +// `model` must be an instance of the receiver's class or a subclass thereof. +- (void)mergeValuesForKeysFromModel:(MTLModel *)model; + +// Compares the receiver with another object for equality. +// +// The default implementation is equivalent to comparing both models' +// -dictionaryValue. +// +// Note that this may lead to infinite loops if the receiver holds a circular +// reference to another MTLModel and both use the default behavior. +// It is recommended to override -isEqual: in this scenario. +- (BOOL)isEqual:(id)object; + +// A string that describes the contents of the receiver. +// +// The default implementation is based on the receiver's class and its +// -dictionaryValue. +// +// Note that this may lead to infinite loops if the receiver holds a circular +// reference to another MTLModel and both use the default behavior. +// It is recommended to override -description in this scenario. +- (NSString *)description; + +@end + +// Implements validation logic for MTLModel. +@interface MTLModel (Validation) + +// Validates the model. +// +// The default implementation simply invokes -validateValue:forKey:error: with +// all +propertyKeys and their current value. If -validateValue:forKey:error: +// returns a new value, the property is set to that new value. +// +// error - If not NULL, this may be set to any error that occurs during +// validation +// +// Returns YES if the model is valid, or NO if the validation failed. +- (BOOL)validate:(NSError **)error; + +@end + +@interface MTLModel (Unavailable) + ++ (instancetype)modelWithDictionary:(NSDictionary *)dictionaryValue __attribute__((deprecated("Replaced by +modelWithDictionary:error:"))); +- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue __attribute__((deprecated("Replaced by -initWithDictionary:error:"))); + ++ (instancetype)modelWithExternalRepresentation:(NSDictionary *)externalRepresentation __attribute__((deprecated("Replaced by -[MTLJSONAdapter initWithJSONDictionary:modelClass:]"))); +- (instancetype)initWithExternalRepresentation:(NSDictionary *)externalRepresentation __attribute__((deprecated("Replaced by -[MTLJSONAdapter initWithJSONDictionary:modelClass:]"))); + +@property (nonatomic, copy, readonly) NSDictionary *externalRepresentation __attribute__((deprecated("Replaced by MTLJSONAdapter.JSONDictionary"))); + ++ (NSDictionary *)externalRepresentationKeyPathsByPropertyKey __attribute__((deprecated("Replaced by +JSONKeyPathsByPropertyKey in "))); ++ (NSValueTransformer *)transformerForKey:(NSString *)key __attribute__((deprecated("Replaced by +JSONTransformerForKey: in "))); + ++ (NSDictionary *)migrateExternalRepresentation:(NSDictionary *)externalRepresentation fromVersion:(NSUInteger)fromVersion __attribute__((deprecated("Replaced by -decodeValueForKey:withCoder:modelVersion:"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLValueTransformer.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLValueTransformer.h new file mode 100644 index 0000000..231b59f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLValueTransformer.h @@ -0,0 +1,29 @@ +// +// MTLValueTransformer.h +// Mantle +// +// Created by Justin Spahr-Summers on 2012-09-11. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +typedef id (^MTLValueTransformerBlock)(id); + +// +// A value transformer supporting block-based transformation. +// +@interface MTLValueTransformer : NSValueTransformer + +// Returns a transformer which transforms values using the given block. Reverse +// transformations will not be allowed. ++ (instancetype)transformerWithBlock:(MTLValueTransformerBlock)transformationBlock; + +// Returns a transformer which transforms values using the given block, for +// forward or reverse transformations. ++ (instancetype)reversibleTransformerWithBlock:(MTLValueTransformerBlock)transformationBlock; + +// Returns a transformer which transforms values using the given blocks. ++ (instancetype)reversibleTransformerWithForwardBlock:(MTLValueTransformerBlock)forwardBlock reverseBlock:(MTLValueTransformerBlock)reverseBlock; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/Mantle.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/Mantle.h new file mode 100644 index 0000000..ebd74e7 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/Mantle.h @@ -0,0 +1,26 @@ +// +// Mantle.h +// Mantle +// +// Created by Justin Spahr-Summers on 2012-09-04. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +//! Project version number for Mantle. +FOUNDATION_EXPORT double MantleVersionNumber; + +//! Project version string for Mantle. +FOUNDATION_EXPORT const unsigned char MantleVersionString[]; + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSArray+MTLManipulationAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSArray+MTLManipulationAdditions.h new file mode 100644 index 0000000..fd7347c --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSArray+MTLManipulationAdditions.h @@ -0,0 +1,28 @@ +// +// NSArray+MTLManipulationAdditions.h +// Mantle +// +// Created by Josh Abernathy on 9/19/12. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@interface NSArray (MTLManipulationAdditions) + +// The first object in the array or nil if the array is empty. +// Forwards to `firstObject` which has been first declared in iOS7, but works with iOS4/10.6. +@property (nonatomic, readonly, strong) id mtl_firstObject; + +// Returns a new array without all instances of the given object. +- (NSArray *)mtl_arrayByRemovingObject:(id)object; + +// Returns a new array without the first object. If the array is empty, it +// returns the empty array. +- (NSArray *)mtl_arrayByRemovingFirstObject; + +// Returns a new array without the last object. If the array is empty, it +// returns the empty array. +- (NSArray *)mtl_arrayByRemovingLastObject; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSDictionary+MTLManipulationAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSDictionary+MTLManipulationAdditions.h new file mode 100644 index 0000000..83254d3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSDictionary+MTLManipulationAdditions.h @@ -0,0 +1,25 @@ +// +// NSDictionary+MTLManipulationAdditions.h +// Mantle +// +// Created by Justin Spahr-Summers on 2012-09-24. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@interface NSDictionary (MTLManipulationAdditions) + +// Merges the keys and values from the given dictionary into the receiver. If +// both the receiver and `dictionary` have a given key, the value from +// `dictionary` is used. +// +// Returns a new dictionary containing the entries of the receiver combined with +// those of `dictionary`. +- (NSDictionary *)mtl_dictionaryByAddingEntriesFromDictionary:(NSDictionary *)dictionary; + +// Creates a new dictionary with all the entries for the given keys removed from +// the receiver. +- (NSDictionary *)mtl_dictionaryByRemovingEntriesWithKeys:(NSSet *)keys; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSObject+MTLComparisonAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSObject+MTLComparisonAdditions.h new file mode 100644 index 0000000..4f7c03e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSObject+MTLComparisonAdditions.h @@ -0,0 +1,15 @@ +// +// NSObject+MTLComparisonAdditions.h +// Mantle +// +// Created by Josh Vera on 10/26/12. +// Copyright (c) 2012 GitHub. All rights reserved. +// +// Portions copyright (c) 2011 Bitswift. All rights reserved. +// See the LICENSE file for more information. +// + +#import + +// Returns whether both objects are identical or equal via -isEqual: +BOOL MTLEqualObjects(id obj1, id obj2); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLInversionAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLInversionAdditions.h new file mode 100644 index 0000000..eefceec --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLInversionAdditions.h @@ -0,0 +1,21 @@ +// +// NSValueTransformer+MTLInversionAdditions.h +// Mantle +// +// Created by Justin Spahr-Summers on 2013-05-18. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import + +@interface NSValueTransformer (MTLInversionAdditions) + +// Flips the direction of the receiver's transformation, such that +// -transformedValue: will become -reverseTransformedValue:, and vice-versa. +// +// The receiver must allow reverse transformation. +// +// Returns an inverted transformer. +- (NSValueTransformer *)mtl_invertedTransformer; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLPredefinedTransformerAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLPredefinedTransformerAdditions.h new file mode 100644 index 0000000..78a6b19 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLPredefinedTransformerAdditions.h @@ -0,0 +1,84 @@ +// +// NSValueTransformer+MTLPredefinedTransformerAdditions.h +// Mantle +// +// Created by Justin Spahr-Summers on 2012-09-27. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +// The name for a value transformer that converts strings into URLs and back. +extern NSString * const MTLURLValueTransformerName; + +// Ensure an NSNumber is backed by __NSCFBoolean/CFBooleanRef +// +// NSJSONSerialization, and likely other serialization libraries, ordinarily +// serialize NSNumbers as numbers, and thus booleans would be serialized as +// 0/1. The exception is when the NSNumber is backed by __NSCFBoolean, which, +// though very much an implementation detail, is detected and serialized as a +// proper boolean. +extern NSString * const MTLBooleanValueTransformerName; + +@interface NSValueTransformer (MTLPredefinedTransformerAdditions) + +// Creates a reversible transformer to convert a JSON dictionary into a MTLModel +// object, and vice-versa. +// +// modelClass - The MTLModel subclass to attempt to parse from the JSON. This +// class must conform to . This argument must +// not be nil. +// +// Returns a reversible transformer which uses MTLJSONAdapter for transforming +// values back and forth. ++ (NSValueTransformer *)mtl_JSONDictionaryTransformerWithModelClass:(Class)modelClass; + +// Creates a reversible transformer to convert an array of JSON dictionaries +// into an array of MTLModel objects, and vice-versa. +// +// modelClass - The MTLModel subclass to attempt to parse from each JSON +// dictionary. This class must conform to . +// This argument must not be nil. +// +// Returns a reversible transformer which uses MTLJSONAdapter for transforming +// array elements back and forth. ++ (NSValueTransformer *)mtl_JSONArrayTransformerWithModelClass:(Class)modelClass; + +// A reversible value transformer to transform between the keys and objects of a +// dictionary. +// +// dictionary - The dictionary whose keys and values should be +// transformed between. This argument must not be nil. +// defaultValue - The result to fall back to, in case no key matching the +// input value was found during a forward transformation. +// reverseDefaultValue - The result to fall back to, in case no value matching +// the input value was found during a reverse +// transformation. +// +// Can for example be used for transforming between enum values and their string +// representation. +// +// NSValueTransformer *valueTransformer = [NSValueTransformer mtl_valueMappingTransformerWithDictionary:@{ +// @"foo": @(EnumDataTypeFoo), +// @"bar": @(EnumDataTypeBar), +// } defaultValue: @(EnumDataTypeUndefined) reverseDefaultValue: @"undefined"]; +// +// Returns a transformer that will map from keys to values in dictionary +// for forward transformation, and from values to keys for reverse +// transformations. If no matching key or value can be found, the respective +// default value is returned. ++ (NSValueTransformer *)mtl_valueMappingTransformerWithDictionary:(NSDictionary *)dictionary defaultValue:(id)defaultValue reverseDefaultValue:(id)reverseDefaultValue; + +// Returns a value transformer created by calling +// `+mtl_valueMappingTransformerWithDictionary:defaultValue:reverseDefaultValue:` +// with a default value of `nil` and a reverse default value of `nil`. ++ (NSValueTransformer *)mtl_valueMappingTransformerWithDictionary:(NSDictionary *)dictionary; + +@end + +@interface NSValueTransformer (UnavailableMTLPredefinedTransformerAdditions) + ++ (NSValueTransformer *)mtl_externalRepresentationTransformerWithModelClass:(Class)modelClass __attribute__((deprecated("Replaced by +mtl_JSONDictionaryTransformerWithModelClass:"))); ++ (NSValueTransformer *)mtl_externalRepresentationArrayTransformerWithModelClass:(Class)modelClass __attribute__((deprecated("Replaced by +mtl_JSONArrayTransformerWithModelClass:"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle new file mode 100755 index 0000000..06ee2b4 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Modules/module.modulemap b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..958298b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Mantle { + umbrella header "Mantle.h" + + export * + module * { export * } +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Resources/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..f8ffa47 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,45 @@ + + + + + BuildMachineOSBuild + 14C1514 + CFBundleDevelopmentRegion + en + CFBundleExecutable + Mantle + CFBundleIdentifier + org.mantle.Mantle + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Mantle + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6C131e + DTPlatformVersion + GM + DTSDKBuild + 14A383 + DTSDKName + macosx10.10 + DTXcode + 0620 + DTXcodeBuild + 6C131e + UIDeviceFamily + + 1 + 2 + + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/Current b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Mantle.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Headers b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Modules b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/ReactiveCocoa b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/ReactiveCocoa new file mode 120000 index 0000000..5dd82ab --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/ReactiveCocoa @@ -0,0 +1 @@ +Versions/Current/ReactiveCocoa \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Resources b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTKeyPathCoding.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTKeyPathCoding.h new file mode 100644 index 0000000..f34dc4a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTKeyPathCoding.h @@ -0,0 +1,68 @@ +// +// EXTKeyPathCoding.h +// extobjc +// +// Created by Justin Spahr-Summers on 19.06.12. +// Copyright (C) 2012 Justin Spahr-Summers. +// Released under the MIT license. +// + +#import +#import "metamacros.h" + +/** + * \@keypath allows compile-time verification of key paths. Given a real object + * receiver and key path: + * + * @code + +NSString *UTF8StringPath = @keypath(str.lowercaseString.UTF8String); +// => @"lowercaseString.UTF8String" + +NSString *versionPath = @keypath(NSObject, version); +// => @"version" + +NSString *lowercaseStringPath = @keypath(NSString.new, lowercaseString); +// => @"lowercaseString" + + * @endcode + * + * ... the macro returns an \c NSString containing all but the first path + * component or argument (e.g., @"lowercaseString.UTF8String", @"version"). + * + * In addition to simply creating a key path, this macro ensures that the key + * path is valid at compile-time (causing a syntax error if not), and supports + * refactoring, such that changing the name of the property will also update any + * uses of \@keypath. + */ +#define keypath(...) \ + metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__))(keypath1(__VA_ARGS__))(keypath2(__VA_ARGS__)) + +#define keypath1(PATH) \ + (((void)(NO && ((void)PATH, NO)), strchr(# PATH, '.') + 1)) + +#define keypath2(OBJ, PATH) \ + (((void)(NO && ((void)OBJ.PATH, NO)), # PATH)) + +/** + * \@collectionKeypath allows compile-time verification of key paths across collections NSArray/NSSet etc. Given a real object + * receiver, collection object receiver and related keypaths: + * + * @code + + NSString *employessFirstNamePath = @collectionKeypath(department.employees, Employee.new, firstName) + // => @"employees.firstName" + + NSString *employessFirstNamePath = @collectionKeypath(Department.new, employees, Employee.new, firstName) + // => @"employees.firstName" + + * @endcode + * + */ +#define collectionKeypath(...) \ + metamacro_if_eq(3, metamacro_argcount(__VA_ARGS__))(collectionKeypath3(__VA_ARGS__))(collectionKeypath4(__VA_ARGS__)) + +#define collectionKeypath3(PATH, COLLECTION_OBJECT, COLLECTION_PATH) ([[NSString stringWithFormat:@"%s.%s",keypath(PATH), keypath(COLLECTION_OBJECT, COLLECTION_PATH)] UTF8String]) + +#define collectionKeypath4(OBJ, PATH, COLLECTION_OBJECT, COLLECTION_PATH) ([[NSString stringWithFormat:@"%s.%s",keypath(OBJ, PATH), keypath(COLLECTION_OBJECT, COLLECTION_PATH)] UTF8String]) + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTScope.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTScope.h new file mode 100644 index 0000000..4a16f4a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTScope.h @@ -0,0 +1,118 @@ +// +// EXTScope.h +// extobjc +// +// Created by Justin Spahr-Summers on 2011-05-04. +// Copyright (C) 2012 Justin Spahr-Summers. +// Released under the MIT license. +// + +#import "metamacros.h" + +/** + * \@onExit defines some code to be executed when the current scope exits. The + * code must be enclosed in braces and terminated with a semicolon, and will be + * executed regardless of how the scope is exited, including from exceptions, + * \c goto, \c return, \c break, and \c continue. + * + * Provided code will go into a block to be executed later. Keep this in mind as + * it pertains to memory management, restrictions on assignment, etc. Because + * the code is used within a block, \c return is a legal (though perhaps + * confusing) way to exit the cleanup block early. + * + * Multiple \@onExit statements in the same scope are executed in reverse + * lexical order. This helps when pairing resource acquisition with \@onExit + * statements, as it guarantees teardown in the opposite order of acquisition. + * + * @note This statement cannot be used within scopes defined without braces + * (like a one line \c if). In practice, this is not an issue, since \@onExit is + * a useless construct in such a case anyways. + */ +#define onExit \ + rac_keywordify \ + __strong rac_cleanupBlock_t metamacro_concat(rac_exitBlock_, __LINE__) __attribute__((cleanup(rac_executeCleanupBlock), unused)) = ^ + +/** + * Creates \c __weak shadow variables for each of the variables provided as + * arguments, which can later be made strong again with #strongify. + * + * This is typically used to weakly reference variables in a block, but then + * ensure that the variables stay alive during the actual execution of the block + * (if they were live upon entry). + * + * See #strongify for an example of usage. + */ +#define weakify(...) \ + rac_keywordify \ + metamacro_foreach_cxt(rac_weakify_,, __weak, __VA_ARGS__) + +/** + * Like #weakify, but uses \c __unsafe_unretained instead, for targets or + * classes that do not support weak references. + */ +#define unsafeify(...) \ + rac_keywordify \ + metamacro_foreach_cxt(rac_weakify_,, __unsafe_unretained, __VA_ARGS__) + +/** + * Strongly references each of the variables provided as arguments, which must + * have previously been passed to #weakify. + * + * The strong references created will shadow the original variable names, such + * that the original names can be used without issue (and a significantly + * reduced risk of retain cycles) in the current scope. + * + * @code + + id foo = [[NSObject alloc] init]; + id bar = [[NSObject alloc] init]; + + @weakify(foo, bar); + + // this block will not keep 'foo' or 'bar' alive + BOOL (^matchesFooOrBar)(id) = ^ BOOL (id obj){ + // but now, upon entry, 'foo' and 'bar' will stay alive until the block has + // finished executing + @strongify(foo, bar); + + return [foo isEqual:obj] || [bar isEqual:obj]; + }; + + * @endcode + */ +#define strongify(...) \ + rac_keywordify \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wshadow\"") \ + metamacro_foreach(rac_strongify_,, __VA_ARGS__) \ + _Pragma("clang diagnostic pop") + +/*** implementation details follow ***/ +typedef void (^rac_cleanupBlock_t)(); + +static inline void rac_executeCleanupBlock (__strong rac_cleanupBlock_t *block) { + (*block)(); +} + +#define rac_weakify_(INDEX, CONTEXT, VAR) \ + CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); + +#define rac_strongify_(INDEX, VAR) \ + __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); + +// Details about the choice of backing keyword: +// +// The use of @try/@catch/@finally can cause the compiler to suppress +// return-type warnings. +// The use of @autoreleasepool {} is not optimized away by the compiler, +// resulting in superfluous creation of autorelease pools. +// +// Since neither option is perfect, and with no other alternatives, the +// compromise is to use @autorelease in DEBUG builds to maintain compiler +// analysis, and to use @try/@catch otherwise to avoid insertion of unnecessary +// autorelease pools. +#if DEBUG +#define rac_keywordify autoreleasepool {} +#else +#define rac_keywordify try {} @catch (...) {} +#endif diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSArray+RACSequenceAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSArray+RACSequenceAdditions.h new file mode 100644 index 0000000..d2d0b3f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSArray+RACSequenceAdditions.h @@ -0,0 +1,20 @@ +// +// NSArray+RACSequenceAdditions.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-10-29. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@class RACSequence; + +@interface NSArray (RACSequenceAdditions) + +/// Creates and returns a sequence corresponding to the receiver. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACCommandSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACCommandSupport.h new file mode 100644 index 0000000..4e51577 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACCommandSupport.h @@ -0,0 +1,22 @@ +// +// NSControl+RACCommandSupport.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/3/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACCommand; + +@interface NSControl (RACCommandSupport) + +/// Sets the control's command. When the control is clicked, the command is +/// executed with the sender of the event. The control's enabledness is bound +/// to the command's `canExecute`. +/// +/// Note: this will reset the control's target and action. +@property (nonatomic, strong) RACCommand *rac_command; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACTextSignalSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACTextSignalSupport.h new file mode 100644 index 0000000..3d3618d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACTextSignalSupport.h @@ -0,0 +1,24 @@ +// +// NSControl+RACTextSignalSupport.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2013-03-08. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSignal; + +@interface NSControl (RACTextSignalSupport) + +/// Observes a text-based control for changes. +/// +/// Using this method on a control without editable text is considered undefined +/// behavior. +/// +/// Returns a signal which sends the current string value of the receiver, then +/// the new value any time it changes. +- (RACSignal *)rac_textSignal; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSData+RACSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSData+RACSupport.h new file mode 100644 index 0000000..0e47f8a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSData+RACSupport.h @@ -0,0 +1,22 @@ +// +// NSData+RACSupport.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 5/11/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACScheduler; +@class RACSignal; + +@interface NSData (RACSupport) + +// Read the data at the URL using -[NSData initWithContentsOfURL:options:error:]. +// Sends the data or the error. +// +// scheduler - cannot be nil. ++ (RACSignal *)rac_readContentsOfURL:(NSURL *)URL options:(NSDataReadingOptions)options scheduler:(RACScheduler *)scheduler; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSDictionary+RACSequenceAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSDictionary+RACSequenceAdditions.h new file mode 100644 index 0000000..4871fe7 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSDictionary+RACSequenceAdditions.h @@ -0,0 +1,31 @@ +// +// NSDictionary+RACSequenceAdditions.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-10-29. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@class RACSequence; + +@interface NSDictionary (RACSequenceAdditions) + +/// Creates and returns a sequence of RACTuple key/value pairs. The key will be +/// the first element in the tuple, and the value will be the second. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +/// Creates and returns a sequence corresponding to the keys in the receiver. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_keySequence; + +/// Creates and returns a sequence corresponding to the values in the receiver. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_valueSequence; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSEnumerator+RACSequenceAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSEnumerator+RACSequenceAdditions.h new file mode 100644 index 0000000..1d8fc84 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSEnumerator+RACSequenceAdditions.h @@ -0,0 +1,20 @@ +// +// NSEnumerator+RACSequenceAdditions.h +// ReactiveCocoa +// +// Created by Uri Baghin on 07/01/2013. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSequence; + +@interface NSEnumerator (RACSequenceAdditions) + +/// Creates and returns a sequence corresponding to the receiver. +/// +/// The receiver is exhausted lazily as the sequence is enumerated. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSFileHandle+RACSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSFileHandle+RACSupport.h new file mode 100644 index 0000000..985398d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSFileHandle+RACSupport.h @@ -0,0 +1,19 @@ +// +// NSFileHandle+RACSupport.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 5/10/12. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@class RACSignal; + +@interface NSFileHandle (RACSupport) + +// Read any available data in the background and send it. Completes when data +// length is <= 0. +- (RACSignal *)rac_readInBackground; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSIndexSet+RACSequenceAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSIndexSet+RACSequenceAdditions.h new file mode 100644 index 0000000..4fe3820 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSIndexSet+RACSequenceAdditions.h @@ -0,0 +1,21 @@ +// +// NSIndexSet+RACSequenceAdditions.h +// ReactiveCocoa +// +// Created by Sergey Gavrilyuk on 12/17/13. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSequence; + +@interface NSIndexSet (RACSequenceAdditions) + +/// Creates and returns a sequence of indexes (as `NSNumber`s) corresponding to +/// the receiver. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSNotificationCenter+RACSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSNotificationCenter+RACSupport.h new file mode 100644 index 0000000..ddb3954 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSNotificationCenter+RACSupport.h @@ -0,0 +1,18 @@ +// +// NSNotificationCenter+RACSupport.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 5/10/12. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@class RACSignal; + +@interface NSNotificationCenter (RACSupport) + +// Sends the NSNotification every time the notification is posted. +- (RACSignal *)rac_addObserverForName:(NSString *)notificationName object:(id)object; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACAppKitBindings.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACAppKitBindings.h new file mode 100644 index 0000000..eaec439 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACAppKitBindings.h @@ -0,0 +1,40 @@ +// +// NSObject+RACAppKitBindings.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 4/17/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACChannelTerminal; + +@interface NSObject (RACAppKitBindings) + +/// Invokes -rac_channelToBinding:options: without any options. +- (RACChannelTerminal *)rac_channelToBinding:(NSString *)binding; + +/// Applies a Cocoa binding to the receiver, then exposes a RACChannel-based +/// interface for manipulating it. +/// +/// Creating two of the same bindings on the same object will result in undefined +/// behavior. +/// +/// binding - The name of the binding. This must not be nil. +/// options - Any options to pass to Cocoa Bindings. This may be nil. +/// +/// Returns a RACChannelTerminal which will send future values from the receiver, +/// and update the receiver when values are sent to the terminal. +- (RACChannelTerminal *)rac_channelToBinding:(NSString *)binding options:(NSDictionary *)options; + +@end + +@interface NSObject (RACAppKitBindingsDeprecated) + +- (void)rac_bind:(NSString *)binding toObject:(id)object withKeyPath:(NSString *)keyPath __attribute__((deprecated("Use -rac_bind:options: instead"))); +- (void)rac_bind:(NSString *)binding toObject:(id)object withKeyPath:(NSString *)keyPath nilValue:(id)nilValue __attribute__((deprecated("Use -rac_bind:options: instead"))); +- (void)rac_bind:(NSString *)binding toObject:(id)object withKeyPath:(NSString *)keyPath transform:(id (^)(id value))transformBlock __attribute__((deprecated("Use -rac_bind:options: instead"))); +- (void)rac_bind:(NSString *)binding toObject:(id)object withNegatedKeyPath:(NSString *)keyPath __attribute__((deprecated("Use -rac_bind:options: instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACDeallocating.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACDeallocating.h new file mode 100644 index 0000000..1530eb4 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACDeallocating.h @@ -0,0 +1,34 @@ +// +// NSObject+RACDeallocating.h +// ReactiveCocoa +// +// Created by Kazuo Koga on 2013/03/15. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACCompoundDisposable; +@class RACDisposable; +@class RACSignal; + +@interface NSObject (RACDeallocating) + +/// The compound disposable which will be disposed of when the receiver is +/// deallocated. +@property (atomic, readonly, strong) RACCompoundDisposable *rac_deallocDisposable; + +/// Returns a signal that will complete immediately before the receiver is fully +/// deallocated. If already deallocated when the signal is subscribed to, +/// a `completed` event will be sent immediately. +- (RACSignal *)rac_willDeallocSignal; + +@end + +@interface NSObject (RACDeallocatingDeprecated) + +- (RACSignal *)rac_didDeallocSignal __attribute__((deprecated("Use -rac_willDeallocSignal"))); + +- (void)rac_addDeallocDisposable:(RACDisposable *)disposable __attribute__((deprecated("Add disposables to -rac_deallocDisposable instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACLifting.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACLifting.h new file mode 100644 index 0000000..bc4bca2 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACLifting.h @@ -0,0 +1,61 @@ +// +// NSObject+RACLifting.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 10/13/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSignal; + +@interface NSObject (RACLifting) + +/// Lifts the selector on the receiver into the reactive world. The selector will +/// be invoked whenever any signal argument sends a value, but only after each +/// signal has sent an initial value. +/// +/// It will replay the most recently sent value to new subscribers. +/// +/// This does not support C arrays or unions. +/// +/// selector - The selector on self to invoke. +/// firstSignal - The signal corresponding to the first method argument. This +/// must not be nil. +/// ... - A list of RACSignals corresponding to the remaining arguments. +/// There must be a non-nil signal for each method argument. +/// +/// Examples +/// +/// [button rac_liftSelector:@selector(setTitleColor:forState:) withSignals:textColorSignal, [RACSignal return:@(UIControlStateNormal)], nil]; +/// +/// Returns a signal which sends the return value from each invocation of the +/// selector. If the selector returns void, it instead sends RACUnit.defaultUnit. +/// It completes only after all the signal arguments complete. +- (RACSignal *)rac_liftSelector:(SEL)selector withSignals:(RACSignal *)firstSignal, ... NS_REQUIRES_NIL_TERMINATION; + +/// Like -rac_liftSelector:withSignals:, but accepts an array instead of +/// a variadic list of arguments. +- (RACSignal *)rac_liftSelector:(SEL)selector withSignalsFromArray:(NSArray *)signals; + +/// Like -rac_liftSelector:withSignals:, but accepts a signal sending tuples of +/// arguments instead of a variadic list of arguments. +- (RACSignal *)rac_liftSelector:(SEL)selector withSignalOfArguments:(RACSignal *)arguments; + +@end + +@interface NSObject (RACLiftingDeprecated) + +- (RACSignal *)rac_liftSelector:(SEL)selector withObjects:(id)arg, ... __attribute__((deprecated("Use -rac_liftSelector:withSignals: instead"))); +- (RACSignal *)rac_liftSelector:(SEL)selector withObjectsFromArray:(NSArray *)args __attribute__((deprecated("Use -rac_liftSelector:withSignalsFromArray: instead"))); +- (RACSignal *)rac_liftBlock:(id)block withArguments:(id)arg, ... NS_REQUIRES_NIL_TERMINATION __attribute__((deprecated("Use +combineLatest:reduce: instead"))); +- (RACSignal *)rac_liftBlock:(id)block withArgumentsFromArray:(NSArray *)args __attribute__((deprecated("Use +combineLatest:reduce: instead"))); + +@end + +@interface NSObject (RACLiftingUnavailable) + +- (instancetype)rac_lift __attribute__((unavailable("Use -rac_liftSelector:withSignals: instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACPropertySubscribing.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACPropertySubscribing.h new file mode 100644 index 0000000..2c14d5d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACPropertySubscribing.h @@ -0,0 +1,105 @@ +// +// NSObject+RACPropertySubscribing.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/2/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import +#import "EXTKeyPathCoding.h" +#import "metamacros.h" + +/// Creates a signal which observes `KEYPATH` on `TARGET` for changes. +/// +/// In either case, the observation continues until `TARGET` _or self_ is +/// deallocated. If any intermediate object is deallocated instead, it will be +/// assumed to have been set to nil. +/// +/// Make sure to `@strongify(self)` when using this macro within a block! The +/// macro will _always_ reference `self`, which can silently introduce a retain +/// cycle within a block. As a result, you should make sure that `self` is a weak +/// reference (e.g., created by `@weakify` and `@strongify`) before the +/// expression that uses `RACObserve`. +/// +/// Examples +/// +/// // Observes self, and doesn't stop until self is deallocated. +/// RACSignal *selfSignal = RACObserve(self, arrayController.items); +/// +/// // Observes the array controller, and stops when self _or_ the array +/// // controller is deallocated. +/// RACSignal *arrayControllerSignal = RACObserve(self.arrayController, items); +/// +/// // Observes obj.arrayController, and stops when self _or_ the array +/// // controller is deallocated. +/// RACSignal *signal2 = RACObserve(obj.arrayController, items); +/// +/// @weakify(self); +/// RACSignal *signal3 = [anotherSignal flattenMap:^(NSArrayController *arrayController) { +/// // Avoids a retain cycle because of RACObserve implicitly referencing +/// // self. +/// @strongify(self); +/// return RACObserve(arrayController, items); +/// }]; +/// +/// Returns a signal which sends the current value of the key path on +/// subscription, then sends the new value every time it changes, and sends +/// completed if self or observer is deallocated. +#define RACObserve(TARGET, KEYPATH) \ + ({ \ + __weak id target_ = (TARGET); \ + [target_ rac_valuesForKeyPath:@keypath(TARGET, KEYPATH) observer:self]; \ + }) + +@class RACDisposable; +@class RACSignal; + +@interface NSObject (RACPropertySubscribing) + +/// Creates a signal to observe the value at the given key path. +/// +/// The initial value is sent on subscription, the subsequent values are sent +/// from whichever thread the change occured on, even if it doesn't have a valid +/// scheduler. +/// +/// Returns a signal that immediately sends the receiver's current value at the +/// given keypath, then any changes thereafter. +- (RACSignal *)rac_valuesForKeyPath:(NSString *)keyPath observer:(__weak NSObject *)observer; + +/// Creates a signal to observe the changes of the given key path. +/// +/// The initial value is sent on subscription, the subsequent values are sent +/// from whichever thread the change occured on, even if it doesn't have a valid +/// scheduler. +/// +/// Returns a signal that sends tuples containing the current value at the key +/// path and the change dictionary for each KVO callback. +- (RACSignal *)rac_valuesAndChangesForKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options observer:(__weak NSObject *)observer; + +@end + +#define RACAble(...) \ + metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__)) \ + (_RACAbleObject(self, __VA_ARGS__)) \ + (_RACAbleObject(__VA_ARGS__)) + +#define _RACAbleObject(object, property) [object rac_signalForKeyPath:@keypath(object, property) observer:self] + +#define RACAbleWithStart(...) \ + metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__)) \ + (_RACAbleWithStartObject(self, __VA_ARGS__)) \ + (_RACAbleWithStartObject(__VA_ARGS__)) + +#define _RACAbleWithStartObject(object, property) [object rac_signalWithStartingValueForKeyPath:@keypath(object, property) observer:self] + +@interface NSObject (RACPropertySubscribingDeprecated) + ++ (RACSignal *)rac_signalFor:(NSObject *)object keyPath:(NSString *)keyPath observer:(NSObject *)observer __attribute__((deprecated("Use -rac_valuesForKeyPath:observer: or RACObserve() instead."))); ++ (RACSignal *)rac_signalWithStartingValueFor:(NSObject *)object keyPath:(NSString *)keyPath observer:(NSObject *)observer __attribute__((deprecated("Use -rac_valuesForKeyPath:observer: or RACObserve() instead."))); ++ (RACSignal *)rac_signalWithChangesFor:(NSObject *)object keyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options observer:(NSObject *)observer __attribute__((deprecated("Use -rac_valuesAndChangesForKeyPath:options:observer: instead."))); +- (RACSignal *)rac_signalForKeyPath:(NSString *)keyPath observer:(NSObject *)observer __attribute__((deprecated("Use -rac_valuesForKeyPath:observer: or RACObserve() instead."))); +- (RACSignal *)rac_signalWithStartingValueForKeyPath:(NSString *)keyPath observer:(NSObject *)observer __attribute__((deprecated("Use -rac_valuesForKeyPath:observer: or RACObserve() instead."))); +- (RACDisposable *)rac_deriveProperty:(NSString *)keyPath from:(RACSignal *)signal __attribute__((deprecated("Use -[RACSignal setKeyPath:onObject:] instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACSelectorSignal.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACSelectorSignal.h new file mode 100644 index 0000000..c6f3de5 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACSelectorSignal.h @@ -0,0 +1,79 @@ +// +// NSObject+RACSelectorSignal.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/18/13. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSignal; + +/// The domain for any errors originating from -rac_signalForSelector:. +extern NSString * const RACSelectorSignalErrorDomain; + +/// -rac_signalForSelector: was going to add a new method implementation for +/// `selector`, but another thread added an implementation before it was able to. +/// +/// This will _not_ occur for cases where a method implementation exists before +/// -rac_signalForSelector: is invoked. +extern const NSInteger RACSelectorSignalErrorMethodSwizzlingRace; + +@interface NSObject (RACSelectorSignal) + +/// Creates a signal associated with the receiver, which will send a tuple of the +/// method's arguments each time the given selector is invoked. +/// +/// If the selector is already implemented on the receiver, the existing +/// implementation will be invoked _before_ the signal fires. +/// +/// If the selector is not yet implemented on the receiver, the injected +/// implementation will have a `void` return type and accept only object +/// arguments. Invoking the added implementation with non-object values, or +/// expecting a return value, will result in undefined behavior. +/// +/// This is useful for changing an event or delegate callback into a signal. For +/// example, on an NSView: +/// +/// [[view rac_signalForSelector:@selector(mouseDown:)] subscribeNext:^(RACTuple *args) { +/// NSEvent *event = args.first; +/// NSLog(@"mouse button pressed: %@", event); +/// }]; +/// +/// selector - The selector for whose invocations are to be observed. If it +/// doesn't exist, it will be implemented to accept object arguments +/// and return void. This cannot have C arrays or unions as arguments +/// or C arrays, unions, structs, complex or vector types as return +/// type. +/// +/// Returns a signal which will send a tuple of arguments upon each invocation of +/// the selector, then completes when the receiver is deallocated. `next` events +/// will be sent synchronously from the thread that invoked the method. If +/// a runtime call fails, the signal will send an error in the +/// RACSelectorSignalErrorDomain. +- (RACSignal *)rac_signalForSelector:(SEL)selector; + +/// Behaves like -rac_signalForSelector:, but if the selector is not yet +/// implemented on the receiver, its method signature is looked up within +/// `protocol`, and may accept non-object arguments. +/// +/// If the selector is not yet implemented and has a return value, the injected +/// method will return all zero bits (equal to `nil`, `NULL`, 0, 0.0f, etc.). +/// +/// selector - The selector for whose invocations are to be observed. If it +/// doesn't exist, it will be implemented using information from +/// `protocol`, and may accept non-object arguments and return +/// a value. This cannot have C arrays or unions as arguments or +/// return type. +/// protocol - The protocol in which `selector` is declared. This will be used +/// for type information if the selector is not already implemented on +/// the receiver. This must not be `NULL`, and `selector` must exist +/// in this protocol. +/// +/// Returns a signal which will send a tuple of arguments on each invocation of +/// the selector, or an error in RACSelectorSignalErrorDomain if a runtime +/// call fails. +- (RACSignal *)rac_signalForSelector:(SEL)selector fromProtocol:(Protocol *)protocol; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSOrderedSet+RACSequenceAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSOrderedSet+RACSequenceAdditions.h new file mode 100644 index 0000000..8bea2db --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSOrderedSet+RACSequenceAdditions.h @@ -0,0 +1,20 @@ +// +// NSOrderedSet+RACSequenceAdditions.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-10-29. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@class RACSequence; + +@interface NSOrderedSet (RACSequenceAdditions) + +/// Creates and returns a sequence corresponding to the receiver. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSSet+RACSequenceAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSSet+RACSequenceAdditions.h new file mode 100644 index 0000000..6665501 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSSet+RACSequenceAdditions.h @@ -0,0 +1,20 @@ +// +// NSSet+RACSequenceAdditions.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-10-29. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@class RACSequence; + +@interface NSSet (RACSequenceAdditions) + +/// Creates and returns a sequence corresponding to the receiver. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSequenceAdditions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSequenceAdditions.h new file mode 100644 index 0000000..0116231 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSequenceAdditions.h @@ -0,0 +1,21 @@ +// +// NSString+RACSequenceAdditions.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-10-29. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import + +@class RACSequence; + +@interface NSString (RACSequenceAdditions) + +/// Creates and returns a sequence containing strings corresponding to each +/// composed character sequence in the receiver. +/// +/// Mutating the receiver will not affect the sequence after it's been created. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSupport.h new file mode 100644 index 0000000..4c7fc72 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSupport.h @@ -0,0 +1,22 @@ +// +// NSString+RACSupport.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 5/11/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACScheduler; +@class RACSignal; + +@interface NSString (RACSupport) + +// Reads in the contents of the file using +[NSString stringWithContentsOfURL:usedEncoding:error:]. +// Note that encoding won't be valid until the signal completes successfully. +// +// scheduler - cannot be nil. ++ (RACSignal *)rac_readContentsOfURL:(NSURL *)URL usedEncoding:(NSStringEncoding *)encoding scheduler:(RACScheduler *)scheduler; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSText+RACSignalSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSText+RACSignalSupport.h new file mode 100644 index 0000000..e3fc8ed --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSText+RACSignalSupport.h @@ -0,0 +1,19 @@ +// +// NSText+RACSignalSupport.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2013-03-08. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSignal; + +@interface NSText (RACSignalSupport) + +/// Returns a signal which sends the current `string` of the receiver, then the +/// new value any time it changes. +- (RACSignal *)rac_textSignal; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSURLConnection+RACSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSURLConnection+RACSupport.h new file mode 100644 index 0000000..e9bf04f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSURLConnection+RACSupport.h @@ -0,0 +1,25 @@ +// +// NSURLConnection+RACSupport.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2013-10-01. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSignal; + +@interface NSURLConnection (RACSupport) + +// Lazily loads data for the given request in the background. +// +// request - The URL request to load. This must not be nil. +// +// Returns a signal which will begin loading the request upon each subscription, +// then send a `RACTuple` of the received `NSURLResponse` and downloaded +// `NSData`, and complete on a background thread. If any errors occur, the +// returned signal will error out. ++ (RACSignal *)rac_sendAsynchronousRequest:(NSURLRequest *)request; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSUserDefaults+RACSupport.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSUserDefaults+RACSupport.h new file mode 100644 index 0000000..8482fb3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSUserDefaults+RACSupport.h @@ -0,0 +1,27 @@ +// +// NSUserDefaults+RACSupport.h +// ReactiveCocoa +// +// Created by Matt Diephouse on 12/19/13. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +@class RACChannelTerminal; + +@interface NSUserDefaults (RACSupport) + +/// Creates and returns a terminal for binding the user defaults key. +/// +/// **Note:** The value in the user defaults is *asynchronously* updated with +/// values sent to the channel. +/// +/// key - The user defaults key to create the channel terminal for. +/// +/// Returns a channel terminal that sends the value of the user defaults key +/// upon subscription, sends an updated value whenever the default changes, and +/// updates the default asynchronously with values it receives. +- (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBacktrace.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBacktrace.h new file mode 100644 index 0000000..6037f87 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBacktrace.h @@ -0,0 +1,70 @@ +// +// RACBacktrace.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-08-20. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#ifdef RAC_DEBUG_BACKTRACE + +extern void rac_dispatch_async(dispatch_queue_t queue, dispatch_block_t block); +extern void rac_dispatch_barrier_async(dispatch_queue_t queue, dispatch_block_t block); +extern void rac_dispatch_after(dispatch_time_t time, dispatch_queue_t queue, dispatch_block_t block); +extern void rac_dispatch_async_f(dispatch_queue_t queue, void *context, dispatch_function_t function); +extern void rac_dispatch_barrier_async_f(dispatch_queue_t queue, void *context, dispatch_function_t function); +extern void rac_dispatch_after_f(dispatch_time_t time, dispatch_queue_t queue, void *context, dispatch_function_t function); + +#define dispatch_async rac_dispatch_async +#define dispatch_barrier_async rac_dispatch_barrier_async +#define dispatch_after rac_dispatch_after +#define dispatch_async_f rac_dispatch_async_f +#define dispatch_barrier_async_f rac_dispatch_barrier_async_f +#define dispatch_after_f rac_dispatch_after_f + +/// Preserves backtraces across asynchronous calls. +/// +/// On OS X, you can enable the automatic capturing of asynchronous backtraces +/// (in Debug builds) by setting the `DYLD_INSERT_LIBRARIES` environment variable +/// to `@executable_path/../Frameworks/ReactiveCocoa.framework/ReactiveCocoa` in +/// your scheme's Run action settings. +/// +/// On iOS, your project and RAC will automatically use the `rac_` GCD functions +/// (declared above) for asynchronous work. Unfortunately, unlike OS X, it's +/// impossible to capture backtraces inside NSOperationQueue or other code +/// outside of your project. +/// +/// Once backtraces are being captured, you can `po [RACBacktrace backtrace]` in +/// the debugger to print them out at any time. You can even set up an alias in +/// ~/.lldbinit to do so: +/// +/// command alias racbt po [RACBacktrace backtrace] +/// +@interface RACBacktrace : NSObject + +/// The backtrace from any previous thread. +@property (nonatomic, strong, readonly) RACBacktrace *previousThreadBacktrace; + +/// The call stack of this backtrace's thread. +@property (nonatomic, copy, readonly) NSArray *callStackSymbols; + +/// Captures the current thread's backtrace, appending it to any backtrace from +/// a previous thread. ++ (instancetype)backtrace; + +/// Same as +backtrace, but omits the specified number of frames at the +/// top of the stack (in addition to this method itself). ++ (instancetype)backtraceIgnoringFrames:(NSUInteger)ignoreCount; + +@end + +#else + +#define rac_dispatch_async dispatch_async +#define rac_dispatch_barrier_async dispatch_barrier_async +#define rac_dispatch_after dispatch_after +#define rac_dispatch_async_f dispatch_async_f +#define rac_dispatch_barrier_async_f dispatch_barrier_async_f +#define rac_dispatch_after_f dispatch_after_f + +#endif diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBehaviorSubject.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBehaviorSubject.h new file mode 100644 index 0000000..e95fe6d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBehaviorSubject.h @@ -0,0 +1,18 @@ +// +// RACBehaviorSubject.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/16/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACSubject.h" + +/// A behavior subject sends the last value it received when it is subscribed to. +@interface RACBehaviorSubject : RACSubject + +/// Creates a new behavior subject with a default value. If it hasn't received +/// any values when it gets subscribed to, it sends the default value. ++ (instancetype)behaviorSubjectWithDefaultValue:(id)value; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACChannel.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACChannel.h new file mode 100644 index 0000000..ef1d6f1 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACChannel.h @@ -0,0 +1,70 @@ +// +// RACChannel.h +// ReactiveCocoa +// +// Created by Uri Baghin on 01/01/2013. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import "RACSignal.h" +#import "RACSubscriber.h" + +@class RACChannelTerminal; + +/// A two-way channel. +/// +/// Conceptually, RACChannel can be thought of as a bidirectional connection, +/// composed of two controllable signals that work in parallel. +/// +/// For example, when connecting between a view and a model: +/// +/// Model View +/// `leadingTerminal` ------> `followingTerminal` +/// `leadingTerminal` <------ `followingTerminal` +/// +/// The initial value of the model and all future changes to it are _sent on_ the +/// `leadingTerminal`, and _received by_ subscribers of the `followingTerminal`. +/// +/// Likewise, whenever the user changes the value of the view, that value is sent +/// on the `followingTerminal`, and received in the model from the +/// `leadingTerminal`. However, the initial value of the view is not received +/// from the `leadingTerminal` (only future changes). +@interface RACChannel : NSObject + +/// The terminal which "leads" the channel, by sending its latest value +/// immediately to new subscribers of the `followingTerminal`. +/// +/// New subscribers to this terminal will not receive a starting value, but will +/// receive all future values that are sent to the `followingTerminal`. +@property (nonatomic, strong, readonly) RACChannelTerminal *leadingTerminal; + +/// The terminal which "follows" the lead of the other terminal, only sending +/// _future_ values to the subscribers of the `leadingTerminal`. +/// +/// The latest value sent to the `leadingTerminal` (if any) will be sent +/// immediately to new subscribers of this terminal, and then all future values +/// as well. +@property (nonatomic, strong, readonly) RACChannelTerminal *followingTerminal; + +@end + +/// Represents one end of a RACChannel. +/// +/// An terminal is similar to a socket or pipe -- it represents one end of +/// a connection (the RACChannel, in this case). Values sent to this terminal +/// will _not_ be received by its subscribers. Instead, the values will be sent +/// to the subscribers of the RACChannel's _other_ terminal. +/// +/// For example, when using the `followingTerminal`, _sent_ values can only be +/// _received_ from the `leadingTerminal`, and vice versa. +/// +/// To make it easy to terminate a RACChannel, `error` and `completed` events +/// sent to either terminal will be received by the subscribers of _both_ +/// terminals. +/// +/// Do not instantiate this class directly. Create a RACChannel instead. +@interface RACChannelTerminal : RACSignal + +- (id)init __attribute__((unavailable("Instantiate a RACChannel instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCommand.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCommand.h new file mode 100644 index 0000000..653d46b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCommand.h @@ -0,0 +1,123 @@ +// +// RACCommand.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/3/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACSignal; + +/// The domain for errors originating within `RACCommand`. +extern NSString * const RACCommandErrorDomain; + +/// -execute: was invoked while the command was disabled. +extern const NSInteger RACCommandErrorNotEnabled; + +/// A `userInfo` key for an error, associated with the `RACCommand` that the +/// error originated from. +/// +/// This is included only when the error code is `RACCommandErrorNotEnabled`. +extern NSString * const RACUnderlyingCommandErrorKey; + +/// A command is a signal triggered in response to some action, typically +/// UI-related. +@interface RACCommand : NSObject + +/// A signal of the signals returned by successful invocations of -execute: +/// (i.e., while the receiver is `enabled`). +/// +/// Errors will be automatically caught upon the inner signals, and sent upon +/// `errors` instead. If you _want_ to receive inner errors, use -execute: or +/// -[RACSignal materialize]. +/// +/// Only executions that begin _after_ subscription will be sent upon this +/// signal. All inner signals will arrive upon the main thread. +@property (nonatomic, strong, readonly) RACSignal *executionSignals; + +/// A signal of whether this command is currently executing. +/// +/// This will send YES whenever -execute: is invoked and the created signal has +/// not yet terminated. Once all executions have terminated, `executing` will +/// send NO. +/// +/// This signal will send its current value upon subscription, and then all +/// future values on the main thread. +@property (nonatomic, strong, readonly) RACSignal *executing; + +/// A signal of whether this command is able to execute. +/// +/// This will send NO if: +/// +/// - The command was created with an `enabledSignal`, and NO is sent upon that +/// signal, or +/// - `allowsConcurrentExecution` is NO and the command has started executing. +/// +/// Once the above conditions are no longer met, the signal will send YES. +/// +/// This signal will send its current value upon subscription, and then all +/// future values on the main thread. +@property (nonatomic, strong, readonly) RACSignal *enabled; + +/// Forwards any errors that occur within signals returned by -execute:. +/// +/// When an error occurs on a signal returned from -execute:, this signal will +/// send the associated NSError value as a `next` event (since an `error` event +/// would terminate the stream). +/// +/// After subscription, this signal will send all future errors on the main +/// thread. +@property (nonatomic, strong, readonly) RACSignal *errors; + +/// Whether the command allows multiple executions to proceed concurrently. +/// +/// The default value for this property is NO. +@property (atomic, assign) BOOL allowsConcurrentExecution; + +/// Invokes -initWithEnabled:signalBlock: with a nil `enabledSignal`. +- (id)initWithSignalBlock:(RACSignal * (^)(id input))signalBlock; + +/// Initializes a command that is conditionally enabled. +/// +/// This is the designated initializer for this class. +/// +/// enabledSignal - A signal of BOOLs which indicate whether the command should +/// be enabled. `enabled` will be based on the latest value sent +/// from this signal. Before any values are sent, `enabled` will +/// default to YES. This argument may be nil. +/// signalBlock - A block which will map each input value (passed to -execute:) +/// to a signal of work. The returned signal will be multicasted +/// to a replay subject, sent on `executionSignals`, then +/// subscribed to synchronously. Neither the block nor the +/// returned signal may be nil. +- (id)initWithEnabled:(RACSignal *)enabledSignal signalBlock:(RACSignal * (^)(id input))signalBlock; + +/// If the receiver is enabled, this method will: +/// +/// 1. Invoke the `signalBlock` given at the time of initialization. +/// 2. Multicast the returned signal to a RACReplaySubject. +/// 3. Send the multicasted signal on `executionSignals`. +/// 4. Subscribe (connect) to the original signal on the main thread. +/// +/// input - The input value to pass to the receiver's `signalBlock`. This may be +/// nil. +/// +/// Returns the multicasted signal, after subscription. If the receiver is not +/// enabled, returns a signal that will send an error with code +/// RACCommandErrorNotEnabled. +- (RACSignal *)execute:(id)input; + +@end + +@interface RACCommand (Unavailable) + +@property (atomic, readonly) BOOL canExecute __attribute__((unavailable("Use the 'enabled' signal instead"))); + ++ (instancetype)command __attribute__((unavailable("Use -initWithSignalBlock: instead"))); ++ (instancetype)commandWithCanExecuteSignal:(RACSignal *)canExecuteSignal __attribute__((unavailable("Use -initWithEnabled:signalBlock: instead"))); +- (id)initWithCanExecuteSignal:(RACSignal *)canExecuteSignal __attribute__((unavailable("Use -initWithEnabled:signalBlock: instead"))); +- (RACSignal *)addSignalBlock:(RACSignal * (^)(id value))signalBlock __attribute__((unavailable("Pass the signalBlock to -initWithSignalBlock: instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCompoundDisposable.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCompoundDisposable.h new file mode 100644 index 0000000..bb25f7d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCompoundDisposable.h @@ -0,0 +1,48 @@ +// +// RACCompoundDisposable.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 11/30/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACDisposable.h" + +/// A disposable of disposables. When it is disposed, it disposes of all its +/// contained disposables. +/// +/// If -addDisposable: is called after the compound disposable has been disposed +/// of, the given disposable is immediately disposed. This allows a compound +/// disposable to act as a stand-in for a disposable that will be delivered +/// asynchronously. +@interface RACCompoundDisposable : RACDisposable + +/// Creates and returns a new compound disposable. ++ (instancetype)compoundDisposable; + +/// Creates and returns a new compound disposable containing the given +/// disposables. ++ (instancetype)compoundDisposableWithDisposables:(NSArray *)disposables; + +/// Adds the given disposable. If the receiving disposable has already been +/// disposed of, the given disposable is disposed immediately. +/// +/// This method is thread-safe. +/// +/// disposable - The disposable to add. This may be nil, in which case nothing +/// happens. +- (void)addDisposable:(RACDisposable *)disposable; + +/// Removes the specified disposable from the compound disposable (regardless of +/// its disposed status), or does nothing if it's not in the compound disposable. +/// +/// This is mainly useful for limiting the memory usage of the compound +/// disposable for long-running operations. +/// +/// This method is thread-safe. +/// +/// disposable - The disposable to remove. This argument may be nil (to make the +/// use of weak references easier). +- (void)removeDisposable:(RACDisposable *)disposable; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACDisposable.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACDisposable.h new file mode 100644 index 0000000..5b4cf0b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACDisposable.h @@ -0,0 +1,35 @@ +// +// RACDisposable.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/16/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACScopedDisposable; + +/// A disposable encapsulates the work necessary to tear down and cleanup a +/// subscription. +@interface RACDisposable : NSObject + +/// Whether the receiver has been disposed. +/// +/// Use of this property is discouraged, since it may be set to `YES` +/// concurrently at any time. +/// +/// This property is not KVO-compliant. +@property (atomic, assign, getter = isDisposed, readonly) BOOL disposed; + ++ (instancetype)disposableWithBlock:(void (^)(void))block; + +/// Performs the disposal work. Can be called multiple times, though subsequent +/// calls won't do anything. +- (void)dispose; + +/// Returns a new disposable which will dispose of this disposable when it gets +/// dealloc'd. +- (RACScopedDisposable *)asScopedDisposable; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACEvent.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACEvent.h new file mode 100644 index 0000000..9e64e5a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACEvent.h @@ -0,0 +1,51 @@ +// +// RACEvent.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2013-01-07. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import + +/// Describes the type of a RACEvent. +/// +/// RACEventTypeCompleted - A `completed` event. +/// RACEventTypeError - An `error` event. +/// RACEventTypeNext - A `next` event. +typedef enum : NSUInteger { + RACEventTypeCompleted, + RACEventTypeError, + RACEventTypeNext +} RACEventType; + +/// Represents an event sent by a RACSignal. +/// +/// This corresponds to the `Notification` class in Rx. +@interface RACEvent : NSObject + +/// Returns a singleton RACEvent representing the `completed` event. ++ (instancetype)completedEvent; + +/// Returns a new event of type RACEventTypeError, containing the given error. ++ (instancetype)eventWithError:(NSError *)error; + +/// Returns a new event of type RACEventTypeNext, containing the given value. ++ (instancetype)eventWithValue:(id)value; + +/// The type of event represented by the receiver. +@property (nonatomic, assign, readonly) RACEventType eventType; + +/// Returns whether the receiver is of type RACEventTypeCompleted or +/// RACEventTypeError. +@property (nonatomic, getter = isFinished, assign, readonly) BOOL finished; + +/// The error associated with an event of type RACEventTypeError. This will be +/// nil for all other event types. +@property (nonatomic, strong, readonly) NSError *error; + +/// The value associated with an event of type RACEventTypeNext. This will be +/// nil for all other event types. +@property (nonatomic, strong, readonly) id value; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACGroupedSignal.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACGroupedSignal.h new file mode 100644 index 0000000..04c151b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACGroupedSignal.h @@ -0,0 +1,19 @@ +// +// RACGroupedSignal.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 5/2/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACSubject.h" + +/// A grouped signal is used by -[RACSignal groupBy:transform:]. +@interface RACGroupedSignal : RACSubject + +/// The key shared by the group. +@property (nonatomic, readonly, copy) id key; + ++ (instancetype)signalWithKey:(id)key; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACKVOChannel.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACKVOChannel.h new file mode 100644 index 0000000..ead15a4 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACKVOChannel.h @@ -0,0 +1,97 @@ +// +// RACKVOChannel.h +// ReactiveCocoa +// +// Created by Uri Baghin on 27/12/2012. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACChannel.h" +#import "EXTKeyPathCoding.h" +#import "metamacros.h" + +/// Creates a RACKVOChannel to the given key path. When the targeted object +/// deallocates, the channel will complete. +/// +/// If RACChannelTo() is used as an expression, it returns a RACChannelTerminal that +/// can be used to watch the specified property for changes, and set new values +/// for it. The terminal will start with the property's current value upon +/// subscription. +/// +/// If RACChannelTo() is used on the left-hand side of an assignment, there must a +/// RACChannelTerminal on the right-hand side of the assignment. The two will be +/// subscribed to one another: the property's value is immediately set to the +/// value of the channel terminal on the right-hand side, and subsequent changes +/// to either terminal will be reflected on the other. +/// +/// There are two different versions of this macro: +/// +/// - RACChannelTo(TARGET, KEYPATH, NILVALUE) will create a channel to the `KEYPATH` +/// of `TARGET`. If the terminal is ever sent a `nil` value, the property will +/// be set to `NILVALUE` instead. `NILVALUE` may itself be `nil` for object +/// properties, but an NSValue should be used for primitive properties, to +/// avoid an exception if `nil` is sent (which might occur if an intermediate +/// object is set to `nil`). +/// - RACChannelTo(TARGET, KEYPATH) is the same as the above, but `NILVALUE` defaults to +/// `nil`. +/// +/// Examples +/// +/// RACChannelTerminal *integerChannel = RACChannelTo(self, integerProperty, @42); +/// +/// // Sets self.integerProperty to 5. +/// [integerChannel sendNext:@5]; +/// +/// // Logs the current value of self.integerProperty, and all future changes. +/// [integerChannel subscribeNext:^(id value) { +/// NSLog(@"value: %@", value); +/// }]; +/// +/// // Binds properties to each other, taking the initial value from the right +/// side. +/// RACChannelTo(view, objectProperty) = RACChannelTo(model, objectProperty); +/// RACChannelTo(view, integerProperty, @2) = RACChannelTo(model, integerProperty, @10); +#define RACChannelTo(TARGET, ...) \ + metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__)) \ + (RACChannelTo_(TARGET, __VA_ARGS__, nil)) \ + (RACChannelTo_(TARGET, __VA_ARGS__)) + +/// Do not use this directly. Use the RACChannelTo macro above. +#define RACChannelTo_(TARGET, KEYPATH, NILVALUE) \ + [[RACKVOChannel alloc] initWithTarget:(TARGET) keyPath:@keypath(TARGET, KEYPATH) nilValue:(NILVALUE)][@keypath(RACKVOChannel.new, followingTerminal)] + +/// A RACChannel that observes a KVO-compliant key path for changes. +@interface RACKVOChannel : RACChannel + +/// Initializes a channel that will observe the given object and key path. +/// +/// The current value of the key path, and future KVO notifications for the given +/// key path, will be sent to subscribers of the channel's `followingTerminal`. +/// Values sent to the `followingTerminal` will be set at the given key path using +/// key-value coding. +/// +/// When the target object deallocates, the channel will complete. Signal errors +/// are considered undefined behavior. +/// +/// This is the designated initializer for this class. +/// +/// target - The object to bind to. +/// keyPath - The key path to observe and set the value of. +/// nilValue - The value to set at the key path whenever a `nil` value is +/// received. This may be nil when connecting to object properties, but +/// an NSValue should be used for primitive properties, to avoid an +/// exception if `nil` is received (which might occur if an intermediate +/// object is set to `nil`). +- (id)initWithTarget:(__weak NSObject *)target keyPath:(NSString *)keyPath nilValue:(id)nilValue; + +- (id)init __attribute__((unavailable("Use -initWithTarget:keyPath:nilValue: instead"))); + +@end + +/// Methods needed for the convenience macro. Do not call explicitly. +@interface RACKVOChannel (RACChannelTo) + +- (RACChannelTerminal *)objectForKeyedSubscript:(NSString *)key; +- (void)setObject:(RACChannelTerminal *)otherTerminal forKeyedSubscript:(NSString *)key; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACMulticastConnection.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACMulticastConnection.h new file mode 100644 index 0000000..67beff6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACMulticastConnection.h @@ -0,0 +1,48 @@ +// +// RACMulticastConnection.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 4/11/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACDisposable; +@class RACSignal; + +/// A multicast connection encapsulates the idea of sharing one subscription to a +/// signal to many subscribers. This is most often needed if the subscription to +/// the underlying signal involves side-effects or shouldn't be called more than +/// once. +/// +/// The multicasted signal is only subscribed to when +/// -[RACMulticastConnection connect] is called. Until that happens, no values +/// will be sent on `signal`. See -[RACMulticastConnection autoconnect] for how +/// -[RACMulticastConnection connect] can be called automatically. +/// +/// Note that you shouldn't create RACMulticastConnection manually. Instead use +/// -[RACSignal publish] or -[RACSignal multicast:]. +@interface RACMulticastConnection : NSObject + +/// The multicasted signal. +@property (nonatomic, strong, readonly) RACSignal *signal; + +/// Connect to the underlying signal by subscribing to it. Calling this multiple +/// times does nothing but return the existing connection's disposable. +/// +/// Returns the disposable for the subscription to the multicasted signal. +- (RACDisposable *)connect; + +/// Connects to the underlying signal when the returned signal is first +/// subscribed to, and disposes of the subscription to the multicasted signal +/// when the returned signal has no subscribers. +/// +/// If new subscribers show up after being disposed, they'll subscribe and then +/// be immediately disposed of. The returned signal will never re-connect to the +/// multicasted signal. +/// +/// Returns the autoconnecting signal. +- (RACSignal *)autoconnect; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler+Subclass.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler+Subclass.h new file mode 100644 index 0000000..b40f984 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler+Subclass.h @@ -0,0 +1,35 @@ +// +// RACQueueScheduler+Subclass.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 6/6/13. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import "RACQueueScheduler.h" +#import "RACScheduler+Subclass.h" + +/// An interface for use by GCD queue-based subclasses. +/// +/// See RACScheduler+Subclass.h for subclassing notes. +@interface RACQueueScheduler () + +/// The queue on which blocks are enqueued. +@property (nonatomic, strong, readonly) dispatch_queue_t queue; + +/// Initializes the receiver with the name of the scheduler and the queue which +/// the scheduler should use. +/// +/// name - The name of the scheduler. If nil, a default name will be used. +/// queue - The queue upon which the receiver should enqueue scheduled blocks. +/// This argument must not be NULL. +/// +/// Returns the initialized object. +- (id)initWithName:(NSString *)name queue:(dispatch_queue_t)queue; + +/// Converts a date into a GCD time using dispatch_walltime(). +/// +/// date - The date to convert. This must not be nil. ++ (dispatch_time_t)wallTimeWithDate:(NSDate *)date; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler.h new file mode 100644 index 0000000..ef42512 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler.h @@ -0,0 +1,18 @@ +// +// RACQueueScheduler.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 11/30/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACScheduler.h" + +/// An abstract scheduler which asynchronously enqueues all its work to a Grand +/// Central Dispatch queue. +/// +/// Because RACQueueScheduler is abstract, it should not be instantiated +/// directly. Create a subclass using the `RACQueueScheduler+Subclass.h` +/// interface and use that instead. +@interface RACQueueScheduler : RACScheduler +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACReplaySubject.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACReplaySubject.h new file mode 100644 index 0000000..3d429ea --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACReplaySubject.h @@ -0,0 +1,22 @@ +// +// RACReplaySubject.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/14/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACSubject.h" + +extern const NSUInteger RACReplaySubjectUnlimitedCapacity; + +/// A replay subject saves the values it is sent (up to its defined capacity) +/// and resends those to new subscribers. It will also replay an error or +/// completion. +@interface RACReplaySubject : RACSubject + +/// Creates a new replay subject with the given capacity. A capacity of +/// RACReplaySubjectUnlimitedCapacity means values are never trimmed. ++ (instancetype)replaySubjectWithCapacity:(NSUInteger)capacity; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler+Subclass.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler+Subclass.h new file mode 100644 index 0000000..b6e8a9e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler+Subclass.h @@ -0,0 +1,29 @@ +// +// RACScheduler.m +// ReactiveCocoa +// +// Created by MiÄ·elis Vindavs on 5/27/14. +// Copyright (c) 2014 GitHub, Inc. All rights reserved. +// + +#import +#import "RACScheduler.h" + +/// An interface for use by subclasses. +/// +/// Subclasses should use `-performAsCurrentScheduler:` to do the actual block +/// invocation so that +[RACScheduler currentScheduler] behaves as expected. +/// +/// **Note that RACSchedulers are expected to be serial**. Subclasses must honor +/// that contract. See `RACTargetQueueScheduler` for a queue-based scheduler +/// which will enforce the serialization guarantee. +@interface RACScheduler () + +/// Performs the given block with the receiver as the current scheduler for +/// its thread. This should only be called by subclasses to perform their +/// scheduled blocks. +/// +/// block - The block to execute. Cannot be NULL. +- (void)performAsCurrentScheduler:(void (^)(void))block; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler.h new file mode 100644 index 0000000..bd1b536 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler.h @@ -0,0 +1,148 @@ +// +// RACScheduler.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 4/16/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +/// The priority for the scheduler. +/// +/// RACSchedulerPriorityHigh - High priority. +/// RACSchedulerPriorityDefault - Default priority. +/// RACSchedulerPriorityLow - Low priority. +/// RACSchedulerPriorityBackground - Background priority. +typedef enum : long { + RACSchedulerPriorityHigh = DISPATCH_QUEUE_PRIORITY_HIGH, + RACSchedulerPriorityDefault = DISPATCH_QUEUE_PRIORITY_DEFAULT, + RACSchedulerPriorityLow = DISPATCH_QUEUE_PRIORITY_LOW, + RACSchedulerPriorityBackground = DISPATCH_QUEUE_PRIORITY_BACKGROUND, +} RACSchedulerPriority; + +/// Scheduled with -scheduleRecursiveBlock:, this type of block is passed a block +/// with which it can call itself recursively. +typedef void (^RACSchedulerRecursiveBlock)(void (^reschedule)(void)); + +@class RACDisposable; + +/// Schedulers are used to control when and where work is performed. +@interface RACScheduler : NSObject + +/// A singleton scheduler that immediately executes the blocks it is given. +/// +/// **Note:** Unlike most other schedulers, this does not set the current +/// scheduler. There may still be a valid +currentScheduler if this is used +/// within a block scheduled on a different scheduler. ++ (RACScheduler *)immediateScheduler; + +/// A singleton scheduler that executes blocks in the main thread. ++ (RACScheduler *)mainThreadScheduler; + +/// Creates and returns a new background scheduler with the given priority and +/// name. The name is for debug and instrumentation purposes only. +/// +/// Scheduler creation is cheap. It's unnecessary to save the result of this +/// method call unless you want to serialize some actions on the same background +/// scheduler. ++ (RACScheduler *)schedulerWithPriority:(RACSchedulerPriority)priority name:(NSString *)name; + +/// Invokes +schedulerWithPriority:name: with a default name. ++ (RACScheduler *)schedulerWithPriority:(RACSchedulerPriority)priority; + +/// Invokes +schedulerWithPriority: with RACSchedulerPriorityDefault. ++ (RACScheduler *)scheduler; + +/// The current scheduler. This will only be valid when used from within a +/// -[RACScheduler schedule:] block or when on the main thread. ++ (RACScheduler *)currentScheduler; + +/// Schedule the given block for execution on the scheduler. +/// +/// Scheduled blocks will be executed in the order in which they were scheduled. +/// +/// block - The block to schedule for execution. Cannot be nil. +/// +/// Returns a disposable which can be used to cancel the scheduled block before +/// it begins executing, or nil if cancellation is not supported. +- (RACDisposable *)schedule:(void (^)(void))block; + +/// Schedule the given block for execution on the scheduler at or after +/// a specific time. +/// +/// Note that blocks scheduled for a certain time will not preempt any other +/// scheduled work that is executing at the time. +/// +/// When invoked on the +immediateScheduler, the calling thread **will block** +/// until the specified time. +/// +/// date - The earliest time at which `block` should begin executing. The block +/// may not execute immediately at this time, whether due to system load +/// or another block on the scheduler currently being run. Cannot be nil. +/// block - The block to schedule for execution. Cannot be nil. +/// +/// Returns a disposable which can be used to cancel the scheduled block before +/// it begins executing, or nil if cancellation is not supported. +- (RACDisposable *)after:(NSDate *)date schedule:(void (^)(void))block; + +/// Schedule the given block for execution on the scheduler after the delay. +/// +/// Converts the delay into an NSDate, then invokes `-after:schedule:`. +- (RACDisposable *)afterDelay:(NSTimeInterval)delay schedule:(void (^)(void))block; + +/// Reschedule the given block at a particular interval, starting at a specific +/// time, and with a given leeway for deferral. +/// +/// Note that blocks scheduled for a certain time will not preempt any other +/// scheduled work that is executing at the time. +/// +/// Regardless of the value of `leeway`, the given block may not execute exactly +/// at `when` or exactly on successive intervals, whether due to system load or +/// because another block is currently being run on the scheduler. +/// +/// It is considered undefined behavior to invoke this method on the +/// +immediateScheduler. +/// +/// date - The earliest time at which `block` should begin executing. The +/// block may not execute immediately at this time, whether due to +/// system load or another block on the scheduler currently being +/// run. Cannot be nil. +/// interval - The interval at which the block should be rescheduled, starting +/// from `date`. This will use the system wall clock, to avoid +/// skew when the computer goes to sleep. +/// leeway - A hint to the system indicating the number of seconds that each +/// scheduling can be deferred. Note that this is just a hint, and +/// there may be some additional latency no matter what. +/// block - The block to repeatedly schedule for execution. Cannot be nil. +/// +/// Returns a disposable which can be used to cancel the automatic scheduling and +/// rescheduling, or nil if cancellation is not supported. +- (RACDisposable *)after:(NSDate *)date repeatingEvery:(NSTimeInterval)interval withLeeway:(NSTimeInterval)leeway schedule:(void (^)(void))block; + +/// Schedule the given recursive block for execution on the scheduler. The +/// scheduler will automatically flatten any recursive scheduling into iteration +/// instead, so this can be used without issue for blocks that may keep invoking +/// themselves forever. +/// +/// Scheduled blocks will be executed in the order in which they were scheduled. +/// +/// recursiveBlock - The block to schedule for execution. When invoked, the +/// recursive block will be passed a `void (^)(void)` block +/// which will reschedule the recursive block at the end of the +/// receiver's queue. This passed-in block will automatically +/// skip scheduling if the scheduling of the `recursiveBlock` +/// was disposed in the meantime. +/// +/// Returns a disposable which can be used to cancel the scheduled block before +/// it begins executing, or to stop it from rescheduling if it's already begun +/// execution. +- (RACDisposable *)scheduleRecursiveBlock:(RACSchedulerRecursiveBlock)recursiveBlock; + +@end + +@interface RACScheduler (Deprecated) + ++ (RACScheduler *)schedulerWithQueue:(dispatch_queue_t)queue name:(NSString *)name __attribute__((deprecated("Use -[RACTargetQueueScheduler initWithName:targetQueue:] instead."))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScopedDisposable.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScopedDisposable.h new file mode 100644 index 0000000..69c4a12 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScopedDisposable.h @@ -0,0 +1,18 @@ +// +// RACScopedDisposable.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/28/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACDisposable.h" + +/// A disposable that calls its own -dispose when it is dealloc'd. +@interface RACScopedDisposable : RACDisposable + +/// Creates a new scoped disposable that will also dispose of the given +/// disposable when it is dealloc'd. ++ (instancetype)scopedDisposableWithDisposable:(RACDisposable *)disposable; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSequence.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSequence.h new file mode 100644 index 0000000..a39f840 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSequence.h @@ -0,0 +1,154 @@ +// +// RACSequence.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-10-29. +// Copyright (c) 2012 GitHub. All rights reserved. +// + +#import +#import "RACStream.h" + +@class RACScheduler; +@class RACSignal; + +/// Represents an immutable sequence of values. Unless otherwise specified, the +/// sequences' values are evaluated lazily on demand. Like Cocoa collections, +/// sequences cannot contain nil. +/// +/// Most inherited RACStream methods that accept a block will execute the block +/// _at most_ once for each value that is evaluated in the returned sequence. +/// Side effects are subject to the behavior described in +/// +sequenceWithHeadBlock:tailBlock:. +/// +/// Implemented as a class cluster. A minimal implementation for a subclass +/// consists simply of -head and -tail. +@interface RACSequence : RACStream + +/// The first object in the sequence, or nil if the sequence is empty. +/// +/// Subclasses must provide an implementation of this method. +@property (nonatomic, strong, readonly) id head; + +/// All but the first object in the sequence, or nil if the sequence is empty. +/// +/// Subclasses must provide an implementation of this method. +@property (nonatomic, strong, readonly) RACSequence *tail; + +/// Evaluates the full sequence to produce an equivalently-sized array. +@property (nonatomic, copy, readonly) NSArray *array; + +/// Returns an enumerator of all objects in the sequence. +@property (nonatomic, copy, readonly) NSEnumerator *objectEnumerator; + +/// Converts a sequence into an eager sequence. +/// +/// An eager sequence fully evaluates all of its values immediately. Sequences +/// derived from an eager sequence will also be eager. +/// +/// Returns a new eager sequence, or the receiver if the sequence is already +/// eager. +@property (nonatomic, copy, readonly) RACSequence *eagerSequence; + +/// Converts a sequence into a lazy sequence. +/// +/// A lazy sequence evaluates its values on demand, as they are accessed. +/// Sequences derived from a lazy sequence will also be lazy. +/// +/// Returns a new lazy sequence, or the receiver if the sequence is already lazy. +@property (nonatomic, copy, readonly) RACSequence *lazySequence; + +/// Invokes -signalWithScheduler: with a new RACScheduler. +- (RACSignal *)signal; + +/// Evaluates the full sequence on the given scheduler. +/// +/// Each item is evaluated in its own scheduled block, such that control of the +/// scheduler is yielded between each value. +/// +/// Returns a signal which sends the receiver's values on the given scheduler as +/// they're evaluated. +- (RACSignal *)signalWithScheduler:(RACScheduler *)scheduler; + +/// Applies a left fold to the sequence. +/// +/// This is the same as iterating the sequence along with a provided start value. +/// This uses a constant amount of memory. A left fold is left-associative so in +/// the sequence [1,2,3] the block would applied in the following order: +/// reduce(reduce(reduce(start, 1), 2), 3) +/// +/// start - The starting value for the fold. Used as `accumulator` for the +/// first fold. +/// reduce - The block used to combine the accumulated value and the next value. +/// Cannot be nil. +/// +/// Returns a reduced value. +- (id)foldLeftWithStart:(id)start reduce:(id (^)(id accumulator, id value))reduce; + +/// Applies a right fold to the sequence. +/// +/// A right fold is equivalent to recursion on the list. The block is evaluated +/// from the right to the left in list. It is right associative so it's applied +/// to the rightmost elements first. For example, in the sequence [1,2,3] the +/// block is applied in the order: +/// reduce(1, reduce(2, reduce(3, start))) +/// +/// start - The starting value for the fold. +/// reduce - The block used to combine the accumulated value and the next head. +/// The block is given the accumulated value and the value of the rest +/// of the computation (result of the recursion). This is computed when +/// you retrieve its value using `rest.head`. This allows you to +/// prevent unnecessary computation by not accessing `rest.head` if you +/// don't need to. +/// +/// Returns a reduced value. +- (id)foldRightWithStart:(id)start reduce:(id (^)(id first, RACSequence *rest))reduce; + +/// Check if any value in sequence passes the block. +/// +/// block - The block predicate used to check each item. Cannot be nil. +/// +/// Returns a boolean indiciating if any value in the sequence passed. +- (BOOL)any:(BOOL (^)(id value))block; + +/// Check if all values in the sequence pass the block. +/// +/// block - The block predicate used to check each item. Cannot be nil. +/// +/// Returns a boolean indicating if all values in the sequence passed. +- (BOOL)all:(BOOL (^)(id value))block; + +/// Returns the first object that passes the block. +/// +/// block - The block predicate used to check each item. Cannot be nil. +/// +/// Returns an object that passes the block or nil if no objects passed. +- (id)objectPassingTest:(BOOL (^)(id value))block; + +/// Creates a sequence that dynamically generates its values. +/// +/// headBlock - Invoked the first time -head is accessed. +/// tailBlock - Invoked the first time -tail is accessed. +/// +/// The results from each block are memoized, so each block will be invoked at +/// most once, no matter how many times the head and tail properties of the +/// sequence are accessed. +/// +/// Any side effects in `headBlock` or `tailBlock` should be thread-safe, since +/// the sequence may be evaluated at any time from any thread. Not only that, but +/// -tail may be accessed before -head, or both may be accessed simultaneously. +/// As noted above, side effects will only be triggered the _first_ time -head or +/// -tail is invoked. +/// +/// Returns a sequence that lazily invokes the given blocks to provide head and +/// tail. `headBlock` must not be nil. ++ (RACSequence *)sequenceWithHeadBlock:(id (^)(void))headBlock tailBlock:(RACSequence *(^)(void))tailBlock; + +@end + +@interface RACSequence (Deprecated) + +- (id)foldLeftWithStart:(id)start combine:(id (^)(id accumulator, id value))combine __attribute__((deprecated("Renamed to -foldLeftWithStart:reduce:"))); +- (id)foldRightWithStart:(id)start combine:(id (^)(id first, RACSequence *rest))combine __attribute__((deprecated("Renamed to -foldRightWithStart:reduce:"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSerialDisposable.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSerialDisposable.h new file mode 100644 index 0000000..a3fc1d4 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSerialDisposable.h @@ -0,0 +1,43 @@ +// +// RACSerialDisposable.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2013-07-22. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import "RACDisposable.h" + +/// A disposable that contains exactly one other disposable and allows it to be +/// swapped out atomically. +@interface RACSerialDisposable : RACDisposable + +/// The inner disposable managed by the serial disposable. +/// +/// This property is thread-safe for reading and writing. However, if you want to +/// read the current value _and_ write a new one atomically, use +/// -swapInDisposable: instead. +/// +/// Disposing of the receiver will also dispose of the current disposable set for +/// this property, then set the property to nil. If any new disposable is set +/// after the receiver is disposed, it will be disposed immediately and this +/// property will remain set to nil. +@property (atomic, strong) RACDisposable *disposable; + +/// Creates a serial disposable which will wrap the given disposable. +/// +/// disposable - The value to set for `disposable`. This may be nil. +/// +/// Returns a RACSerialDisposable, or nil if an error occurs. ++ (instancetype)serialDisposableWithDisposable:(RACDisposable *)disposable; + +/// Atomically swaps the receiver's `disposable` for `newDisposable`. +/// +/// newDisposable - The new value for `disposable`. If the receiver has already +/// been disposed, this disposable will be too, and `disposable` +/// will remain set to nil. This argument may be nil. +/// +/// Returns the previous value for the `disposable` property. +- (RACDisposable *)swapInDisposable:(RACDisposable *)newDisposable; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal+Operations.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal+Operations.h new file mode 100644 index 0000000..07d395e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal+Operations.h @@ -0,0 +1,709 @@ +// +// RACSignal+Operations.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-09-06. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import +#import "RACSignal.h" + +/// The domain for errors originating in RACSignal operations. +extern NSString * const RACSignalErrorDomain; + +/// The error code used with -timeout:. +extern const NSInteger RACSignalErrorTimedOut; + +/// The error code used when a value passed into +switch:cases:default: does not +/// match any of the cases, and no default was given. +extern const NSInteger RACSignalErrorNoMatchingCase; + +@class RACCommand; +@class RACDisposable; +@class RACMulticastConnection; +@class RACScheduler; +@class RACSequence; +@class RACSubject; +@class RACTuple; +@protocol RACSubscriber; + +@interface RACSignal (Operations) + +/// Do the given block on `next`. This should be used to inject side effects into +/// the signal. +- (RACSignal *)doNext:(void (^)(id x))block; + +/// Do the given block on `error`. This should be used to inject side effects +/// into the signal. +- (RACSignal *)doError:(void (^)(NSError *error))block; + +/// Do the given block on `completed`. This should be used to inject side effects +/// into the signal. +- (RACSignal *)doCompleted:(void (^)(void))block; + +/// Sends `next`s only if we don't receive another `next` in `interval` seconds. +/// +/// If a `next` is received, and then another `next` is received before +/// `interval` seconds have passed, the first value is discarded. +/// +/// After `interval` seconds have passed since the most recent `next` was sent, +/// the most recent `next` is forwarded on the scheduler that the value was +/// originally received on. If +[RACScheduler currentScheduler] was nil at the +/// time, a private background scheduler is used. +/// +/// Returns a signal which sends throttled and delayed `next` events. Completion +/// and errors are always forwarded immediately. +- (RACSignal *)throttle:(NSTimeInterval)interval; + +/// Throttles `next`s for which `predicate` returns YES. +/// +/// When `predicate` returns YES for a `next`: +/// +/// 1. If another `next` is received before `interval` seconds have passed, the +/// prior value is discarded. This happens regardless of whether the new +/// value will be throttled. +/// 2. After `interval` seconds have passed since the value was originally +/// received, it will be forwarded on the scheduler that it was received +/// upon. If +[RACScheduler currentScheduler] was nil at the time, a private +/// background scheduler is used. +/// +/// When `predicate` returns NO for a `next`, it is forwarded immediately, +/// without any throttling. +/// +/// interval - The number of seconds for which to buffer the latest value that +/// passes `predicate`. +/// predicate - Passed each `next` from the receiver, this block returns +/// whether the given value should be throttled. This argument must +/// not be nil. +/// +/// Returns a signal which sends `next` events, throttled when `predicate` +/// returns YES. Completion and errors are always forwarded immediately. +- (RACSignal *)throttle:(NSTimeInterval)interval valuesPassingTest:(BOOL (^)(id next))predicate; + +/// Forwards `next` and `completed` events after delaying for `interval` seconds +/// on the current scheduler (on which the events were delivered). +/// +/// If +[RACScheduler currentScheduler] is nil when `next` or `completed` is +/// received, a private background scheduler is used. +/// +/// Returns a signal which sends delayed `next` and `completed` events. Errors +/// are always forwarded immediately. +- (RACSignal *)delay:(NSTimeInterval)interval; + +/// Resubscribes when the signal completes. +- (RACSignal *)repeat; + +/// Executes the given block each time a subscription is created. +/// +/// block - A block which defines the subscription side effects. Cannot be `nil`. +/// +/// Example: +/// +/// // Write new file, with backup. +/// [[[[fileManager +/// rac_createFileAtPath:path contents:data] +/// initially:^{ +/// // 2. Second, backup current file +/// [fileManager moveItemAtPath:path toPath:backupPath error:nil]; +/// }] +/// initially:^{ +/// // 1. First, acquire write lock. +/// [writeLock lock]; +/// }] +/// finally:^{ +/// [writeLock unlock]; +/// }]; +/// +/// Returns a signal that passes through all events of the receiver, plus +/// introduces side effects which occur prior to any subscription side effects +/// of the receiver. +- (RACSignal *)initially:(void (^)(void))block; + +/// Executes the given block when the signal completes or errors. +- (RACSignal *)finally:(void (^)(void))block; + +/// Divides the receiver's `next`s into buffers which deliver every `interval` +/// seconds. +/// +/// interval - The interval in which values are grouped into one buffer. +/// scheduler - The scheduler upon which the returned signal will deliver its +/// values. This must not be nil or +[RACScheduler +/// immediateScheduler]. +/// +/// Returns a signal which sends RACTuples of the buffered values at each +/// interval on `scheduler`. When the receiver completes, any currently-buffered +/// values will be sent immediately. +- (RACSignal *)bufferWithTime:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler; + +/// Collects all receiver's `next`s into a NSArray. Nil values will be converted +/// to NSNull. +/// +/// This corresponds to the `ToArray` method in Rx. +/// +/// Returns a signal which sends a single NSArray when the receiver completes +/// successfully. +- (RACSignal *)collect; + +/// Takes the last `count` `next`s after the receiving signal completes. +- (RACSignal *)takeLast:(NSUInteger)count; + +/// Combines the latest values from the receiver and the given signal into +/// RACTuples, once both have sent at least one `next`. +/// +/// Any additional `next`s will result in a new RACTuple with the latest values +/// from both signals. +/// +/// signal - The signal to combine with. This argument must not be nil. +/// +/// Returns a signal which sends RACTuples of the combined values, forwards any +/// `error` events, and completes when both input signals complete. +- (RACSignal *)combineLatestWith:(RACSignal *)signal; + +/// Combines the latest values from the given signals into RACTuples, once all +/// the signals have sent at least one `next`. +/// +/// Any additional `next`s will result in a new RACTuple with the latest values +/// from all signals. +/// +/// signals - The signals to combine. If this collection is empty, the returned +/// signal will immediately complete upon subscription. +/// +/// Returns a signal which sends RACTuples of the combined values, forwards any +/// `error` events, and completes when all input signals complete. ++ (RACSignal *)combineLatest:(id)signals; + +/// Combines signals using +combineLatest:, then reduces the resulting tuples +/// into a single value using -reduceEach:. +/// +/// signals - The signals to combine. If this collection is empty, the +/// returned signal will immediately complete upon subscription. +/// reduceBlock - The block which reduces the latest values from all the +/// signals into one value. It must take as many arguments as the +/// number of signals given. Each argument will be an object +/// argument. The return value must be an object. This argument +/// must not be nil. +/// +/// Example: +/// +/// [RACSignal combineLatest:@[ stringSignal, intSignal ] reduce:^(NSString *string, NSNumber *number) { +/// return [NSString stringWithFormat:@"%@: %@", string, number]; +/// }]; +/// +/// Returns a signal which sends the results from each invocation of +/// `reduceBlock`. ++ (RACSignal *)combineLatest:(id)signals reduce:(id (^)())reduceBlock; + +/// Merges the receiver and the given signal with `+merge:` and returns the +/// resulting signal. +- (RACSignal *)merge:(RACSignal *)signal; + +/// Sends the latest `next` from any of the signals. +/// +/// Returns a signal that passes through values from each of the given signals, +/// and sends `completed` when all of them complete. If any signal sends an error, +/// the returned signal sends `error` immediately. ++ (RACSignal *)merge:(id)signals; + +/// Merges the signals sent by the receiver into a flattened signal, but only +/// subscribes to `maxConcurrent` number of signals at a time. New signals are +/// queued and subscribed to as other signals complete. +/// +/// If an error occurs on any of the signals, it is sent on the returned signal. +/// It completes only after the receiver and all sent signals have completed. +/// +/// This corresponds to `Merge(IObservable>, Int32)` +/// in Rx. +/// +/// maxConcurrent - the maximum number of signals to subscribe to at a +/// time. If 0, it subscribes to an unlimited number of +/// signals. +- (RACSignal *)flatten:(NSUInteger)maxConcurrent; + +/// Ignores all `next`s from the receiver, waits for the receiver to complete, +/// then subscribes to a new signal. +/// +/// block - A block which will create or obtain a new signal to subscribe to, +/// executed only after the receiver completes. This block must not be +/// nil, and it must not return a nil signal. +/// +/// Returns a signal which will pass through the events of the signal created in +/// `block`. If the receiver errors out, the returned signal will error as well. +- (RACSignal *)then:(RACSignal * (^)(void))block; + +/// Concats the inner signals of a signal of signals. +- (RACSignal *)concat; + +/// Aggregates the `next` values of the receiver into a single combined value. +/// +/// The algorithm proceeds as follows: +/// +/// 1. `start` is passed into the block as the `running` value, and the first +/// element of the receiver is passed into the block as the `next` value. +/// 2. The result of the invocation (`running`) and the next element of the +/// receiver (`next`) is passed into `reduceBlock`. +/// 3. Steps 2 and 3 are repeated until all values have been processed. +/// 4. The last result of `reduceBlock` is sent on the returned signal. +/// +/// This method is similar to -scanWithStart:reduce:, except that only the +/// final result is sent on the returned signal. +/// +/// start - The value to be combined with the first element of the +/// receiver. This value may be `nil`. +/// reduceBlock - The block that describes how to combine values of the +/// receiver. If the receiver is empty, this block will never be +/// invoked. Cannot be nil. +/// +/// Returns a signal that will send the aggregated value when the receiver +/// completes, then itself complete. If the receiver never sends any values, +/// `start` will be sent instead. +- (RACSignal *)aggregateWithStart:(id)start reduce:(id (^)(id running, id next))reduceBlock; + +/// Aggregates the `next` values of the receiver into a single combined value. +/// This is indexed version of -aggregateWithStart:reduce:. +/// +/// start - The value to be combined with the first element of the +/// receiver. This value may be `nil`. +/// reduceBlock - The block that describes how to combine values of the +/// receiver. This block takes zero-based index value as the last +/// parameter. If the receiver is empty, this block will never be +/// invoked. Cannot be nil. +/// +/// Returns a signal that will send the aggregated value when the receiver +/// completes, then itself complete. If the receiver never sends any values, +/// `start` will be sent instead. +- (RACSignal *)aggregateWithStart:(id)start reduceWithIndex:(id (^)(id running, id next, NSUInteger index))reduceBlock; + +/// Aggregates the `next` values of the receiver into a single combined value. +/// +/// This invokes `startFactory` block on each subscription, then calls +/// -aggregateWithStart:reduce: with the return value of the block as start value. +/// +/// startFactory - The block that returns start value which will be combined +/// with the first element of the receiver. Cannot be nil. +/// reduceBlock - The block that describes how to combine values of the +/// receiver. If the receiver is empty, this block will never be +/// invoked. Cannot be nil. +/// +/// Returns a signal that will send the aggregated value when the receiver +/// completes, then itself complete. If the receiver never sends any values, +/// the return value of `startFactory` will be sent instead. +- (RACSignal *)aggregateWithStartFactory:(id (^)(void))startFactory reduce:(id (^)(id running, id next))reduceBlock; + +/// Invokes -setKeyPath:onObject:nilValue: with `nil` for the nil value. +/// +/// WARNING: Under certain conditions, this method is known to be thread-unsafe. +/// See the description in -setKeyPath:onObject:nilValue:. +- (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object; + +/// Binds the receiver to an object, automatically setting the given key path on +/// every `next`. When the signal completes, the binding is automatically +/// disposed of. +/// +/// WARNING: Under certain conditions, this method is known to be thread-unsafe. +/// A crash can result if `object` is deallocated concurrently on +/// another thread within a window of time between a value being sent +/// on this signal and immediately prior to the invocation of +/// -setValue:forKeyPath:, which sets the property. To prevent this, +/// ensure `object` is deallocated on the same thread the receiver +/// sends on, or ensure that the returned disposable is disposed of +/// before `object` deallocates. +/// See https://github.com/ReactiveCocoa/ReactiveCocoa/pull/1184 +/// +/// Sending an error on the signal is considered undefined behavior, and will +/// generate an assertion failure in Debug builds. +/// +/// A given key on an object should only have one active signal bound to it at any +/// given time. Binding more than one signal to the same property is considered +/// undefined behavior. +/// +/// keyPath - The key path to update with `next`s from the receiver. +/// object - The object that `keyPath` is relative to. +/// nilValue - The value to set at the key path whenever `nil` is sent by the +/// receiver. This may be nil when binding to object properties, but +/// an NSValue should be used for primitive properties, to avoid an +/// exception if `nil` is sent (which might occur if an intermediate +/// object is set to `nil`). +/// +/// Returns a disposable which can be used to terminate the binding. +- (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object nilValue:(id)nilValue; + +/// Sends NSDate.date every `interval` seconds. +/// +/// interval - The time interval in seconds at which the current time is sent. +/// scheduler - The scheduler upon which the current NSDate should be sent. This +/// must not be nil or +[RACScheduler immediateScheduler]. +/// +/// Returns a signal that sends the current date/time every `interval` on +/// `scheduler`. ++ (RACSignal *)interval:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler; + +/// Sends NSDate.date at intervals of at least `interval` seconds, up to +/// approximately `interval` + `leeway` seconds. +/// +/// The created signal will defer sending each `next` for at least `interval` +/// seconds, and for an additional amount of time up to `leeway` seconds in the +/// interest of performance or power consumption. Note that some additional +/// latency is to be expected, even when specifying a `leeway` of 0. +/// +/// interval - The base interval between `next`s. +/// scheduler - The scheduler upon which the current NSDate should be sent. This +/// must not be nil or +[RACScheduler immediateScheduler]. +/// leeway - The maximum amount of additional time the `next` can be deferred. +/// +/// Returns a signal that sends the current date/time at intervals of at least +/// `interval seconds` up to approximately `interval` + `leeway` seconds on +/// `scheduler`. ++ (RACSignal *)interval:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler withLeeway:(NSTimeInterval)leeway; + +/// Takes `next`s until the `signalTrigger` sends `next` or `completed`. +/// +/// Returns a signal which passes through all events from the receiver until +/// `signalTrigger` sends `next` or `completed`, at which point the returned signal +/// will send `completed`. +- (RACSignal *)takeUntil:(RACSignal *)signalTrigger; + +/// Takes `next`s until the `replacement` sends an event. +/// +/// replacement - The signal which replaces the receiver as soon as it sends an +/// event. +/// +/// Returns a signal which passes through `next`s and `error` from the receiver +/// until `replacement` sends an event, at which point the returned signal will +/// send that event and switch to passing through events from `replacement` +/// instead, regardless of whether the receiver has sent events already. +- (RACSignal *)takeUntilReplacement:(RACSignal *)replacement; + +/// Subscribes to the returned signal when an error occurs. +- (RACSignal *)catch:(RACSignal * (^)(NSError *error))catchBlock; + +/// Subscribes to the given signal when an error occurs. +- (RACSignal *)catchTo:(RACSignal *)signal; + +/// Runs `tryBlock` against each of the receiver's values, passing values +/// until `tryBlock` returns NO, or the receiver completes. +/// +/// tryBlock - An action to run against each of the receiver's values. +/// The block should return YES to indicate that the action was +/// successful. This block must not be nil. +/// +/// Example: +/// +/// // The returned signal will send an error if data values cannot be +/// // written to `someFileURL`. +/// [signal try:^(NSData *data, NSError **errorPtr) { +/// return [data writeToURL:someFileURL options:NSDataWritingAtomic error:errorPtr]; +/// }]; +/// +/// Returns a signal which passes through all the values of the receiver. If +/// `tryBlock` fails for any value, the returned signal will error using the +/// `NSError` passed out from the block. +- (RACSignal *)try:(BOOL (^)(id value, NSError **errorPtr))tryBlock; + +/// Runs `mapBlock` against each of the receiver's values, mapping values until +/// `mapBlock` returns nil, or the receiver completes. +/// +/// mapBlock - An action to map each of the receiver's values. The block should +/// return a non-nil value to indicate that the action was successful. +/// This block must not be nil. +/// +/// Example: +/// +/// // The returned signal will send an error if data cannot be read from +/// // `fileURL`. +/// [signal tryMap:^(NSURL *fileURL, NSError **errorPtr) { +/// return [NSData dataWithContentsOfURL:fileURL options:0 error:errorPtr]; +/// }]; +/// +/// Returns a signal which transforms all the values of the receiver. If +/// `mapBlock` returns nil for any value, the returned signal will error using +/// the `NSError` passed out from the block. +- (RACSignal *)tryMap:(id (^)(id value, NSError **errorPtr))mapBlock; + +/// Returns the first `next`. Note that this is a blocking call. +- (id)first; + +/// Returns the first `next` or `defaultValue` if the signal completes or errors +/// without sending a `next`. Note that this is a blocking call. +- (id)firstOrDefault:(id)defaultValue; + +/// Returns the first `next` or `defaultValue` if the signal completes or errors +/// without sending a `next`. If an error occurs success will be NO and error +/// will be populated. Note that this is a blocking call. +/// +/// Both success and error may be NULL. +- (id)firstOrDefault:(id)defaultValue success:(BOOL *)success error:(NSError **)error; + +/// Blocks the caller and waits for the signal to complete. +/// +/// error - If not NULL, set to any error that occurs. +/// +/// Returns whether the signal completed successfully. If NO, `error` will be set +/// to the error that occurred. +- (BOOL)waitUntilCompleted:(NSError **)error; + +/// Defers creation of a signal until the signal's actually subscribed to. +/// +/// This can be used to effectively turn a hot signal into a cold signal. ++ (RACSignal *)defer:(RACSignal * (^)(void))block; + +/// Every time the receiver sends a new RACSignal, subscribes and sends `next`s and +/// `error`s only for that signal. +/// +/// The receiver must be a signal of signals. +/// +/// Returns a signal which passes through `next`s and `error`s from the latest +/// signal sent by the receiver, and sends `completed` when both the receiver and +/// the last sent signal complete. +- (RACSignal *)switchToLatest; + +/// Switches between the signals in `cases` as well as `defaultSignal` based on +/// the latest value sent by `signal`. +/// +/// signal - A signal of objects used as keys in the `cases` dictionary. +/// This argument must not be nil. +/// cases - A dictionary that has signals as values. This argument must +/// not be nil. A RACTupleNil key in this dictionary will match +/// nil `next` events that are received on `signal`. +/// defaultSignal - The signal to pass through after `signal` sends a value for +/// which `cases` does not contain a signal. If nil, any +/// unmatched values will result in +/// a RACSignalErrorNoMatchingCase error. +/// +/// Returns a signal which passes through `next`s and `error`s from one of the +/// the signals in `cases` or `defaultSignal`, and sends `completed` when both +/// `signal` and the last used signal complete. If no `defaultSignal` is given, +/// an unmatched `next` will result in an error on the returned signal. ++ (RACSignal *)switch:(RACSignal *)signal cases:(NSDictionary *)cases default:(RACSignal *)defaultSignal; + +/// Switches between `trueSignal` and `falseSignal` based on the latest value +/// sent by `boolSignal`. +/// +/// boolSignal - A signal of BOOLs determining whether `trueSignal` or +/// `falseSignal` should be active. This argument must not be nil. +/// trueSignal - The signal to pass through after `boolSignal` has sent YES. +/// This argument must not be nil. +/// falseSignal - The signal to pass through after `boolSignal` has sent NO. This +/// argument must not be nil. +/// +/// Returns a signal which passes through `next`s and `error`s from `trueSignal` +/// and/or `falseSignal`, and sends `completed` when both `boolSignal` and the +/// last switched signal complete. ++ (RACSignal *)if:(RACSignal *)boolSignal then:(RACSignal *)trueSignal else:(RACSignal *)falseSignal; + +/// Adds every `next` to an array. Nils are represented by NSNulls. Note that +/// this is a blocking call. +/// +/// **This is not the same as the `ToArray` method in Rx.** See -collect for +/// that behavior instead. +/// +/// Returns the array of `next` values, or nil if an error occurs. +- (NSArray *)toArray; + +/// Adds every `next` to a sequence. Nils are represented by NSNulls. +/// +/// This corresponds to the `ToEnumerable` method in Rx. +/// +/// Returns a sequence which provides values from the signal as they're sent. +/// Trying to retrieve a value from the sequence which has not yet been sent will +/// block. +@property (nonatomic, strong, readonly) RACSequence *sequence; + +/// Creates and returns a multicast connection. This allows you to share a single +/// subscription to the underlying signal. +- (RACMulticastConnection *)publish; + +/// Creates and returns a multicast connection that pushes values into the given +/// subject. This allows you to share a single subscription to the underlying +/// signal. +- (RACMulticastConnection *)multicast:(RACSubject *)subject; + +/// Multicasts the signal to a RACReplaySubject of unlimited capacity, and +/// immediately connects to the resulting RACMulticastConnection. +/// +/// Returns the connected, multicasted signal. +- (RACSignal *)replay; + +/// Multicasts the signal to a RACReplaySubject of capacity 1, and immediately +/// connects to the resulting RACMulticastConnection. +/// +/// Returns the connected, multicasted signal. +- (RACSignal *)replayLast; + +/// Multicasts the signal to a RACReplaySubject of unlimited capacity, and +/// lazily connects to the resulting RACMulticastConnection. +/// +/// This means the returned signal will subscribe to the multicasted signal only +/// when the former receives its first subscription. +/// +/// Returns the lazily connected, multicasted signal. +- (RACSignal *)replayLazily; + +/// Sends an error after `interval` seconds if the source doesn't complete +/// before then. +/// +/// The error will be in the RACSignalErrorDomain and have a code of +/// RACSignalErrorTimedOut. +/// +/// interval - The number of seconds after which the signal should error out. +/// scheduler - The scheduler upon which any timeout error should be sent. This +/// must not be nil or +[RACScheduler immediateScheduler]. +/// +/// Returns a signal that passes through the receiver's events, until the stream +/// finishes or times out, at which point an error will be sent on `scheduler`. +- (RACSignal *)timeout:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler; + +/// Creates and returns a signal that delivers its events on the given scheduler. +/// Any side effects of the receiver will still be performed on the original +/// thread. +/// +/// This is ideal when the signal already performs its work on the desired +/// thread, but you want to handle its events elsewhere. +/// +/// This corresponds to the `ObserveOn` method in Rx. +- (RACSignal *)deliverOn:(RACScheduler *)scheduler; + +/// Creates and returns a signal that executes its side effects and delivers its +/// events on the given scheduler. +/// +/// Use of this operator should be avoided whenever possible, because the +/// receiver's side effects may not be safe to run on another thread. If you just +/// want to receive the signal's events on `scheduler`, use -deliverOn: instead. +- (RACSignal *)subscribeOn:(RACScheduler *)scheduler; + +/// Creates and returns a signal that delivers its events on the main thread. +/// If events are already being sent on the main thread, they may be passed on +/// without delay. An event will instead be queued for later delivery on the main +/// thread if sent on another thread, or if a previous event is already being +/// processed, or has been queued. +/// +/// Any side effects of the receiver will still be performed on the original +/// thread. +/// +/// This can be used when a signal will cause UI updates, to avoid potential +/// flicker caused by delayed delivery of events, such as the first event from +/// a RACObserve at view instantiation. +- (RACSignal *)deliverOnMainThread; + +/// Groups each received object into a group, as determined by calling `keyBlock` +/// with that object. The object sent is transformed by calling `transformBlock` +/// with the object. If `transformBlock` is nil, it sends the original object. +/// +/// The returned signal is a signal of RACGroupedSignal. +- (RACSignal *)groupBy:(id (^)(id object))keyBlock transform:(id (^)(id object))transformBlock; + +/// Calls -[RACSignal groupBy:keyBlock transform:nil]. +- (RACSignal *)groupBy:(id (^)(id object))keyBlock; + +/// Sends an [NSNumber numberWithBool:YES] if the receiving signal sends any +/// objects. +- (RACSignal *)any; + +/// Sends an [NSNumber numberWithBool:YES] if the receiving signal sends any +/// objects that pass `predicateBlock`. +/// +/// predicateBlock - cannot be nil. +- (RACSignal *)any:(BOOL (^)(id object))predicateBlock; + +/// Sends an [NSNumber numberWithBool:YES] if all the objects the receiving +/// signal sends pass `predicateBlock`. +/// +/// predicateBlock - cannot be nil. +- (RACSignal *)all:(BOOL (^)(id object))predicateBlock; + +/// Resubscribes to the receiving signal if an error occurs, up until it has +/// retried the given number of times. +/// +/// retryCount - if 0, it keeps retrying until it completes. +- (RACSignal *)retry:(NSInteger)retryCount; + +/// Resubscribes to the receiving signal if an error occurs. +- (RACSignal *)retry; + +/// Sends the latest value from the receiver only when `sampler` sends a value. +/// The returned signal could repeat values if `sampler` fires more often than +/// the receiver. Values from `sampler` are ignored before the receiver sends +/// its first value. +/// +/// sampler - The signal that controls when the latest value from the receiver +/// is sent. Cannot be nil. +- (RACSignal *)sample:(RACSignal *)sampler; + +/// Ignores all `next`s from the receiver. +/// +/// Returns a signal which only passes through `error` or `completed` events from +/// the receiver. +- (RACSignal *)ignoreValues; + +/// Converts each of the receiver's events into a RACEvent object. +/// +/// Returns a signal which sends the receiver's events as RACEvents, and +/// completes after the receiver sends `completed` or `error`. +- (RACSignal *)materialize; + +/// Converts each RACEvent in the receiver back into "real" RACSignal events. +/// +/// Returns a signal which sends `next` for each value RACEvent, `error` for each +/// error RACEvent, and `completed` for each completed RACEvent. +- (RACSignal *)dematerialize; + +/// Inverts each NSNumber-wrapped BOOL sent by the receiver. It will assert if +/// the receiver sends anything other than NSNumbers. +/// +/// Returns a signal of inverted NSNumber-wrapped BOOLs. +- (RACSignal *)not; + +/// Performs a boolean AND on all of the RACTuple of NSNumbers in sent by the receiver. +/// +/// Asserts if the receiver sends anything other than a RACTuple of one or more NSNumbers. +/// +/// Returns a signal that applies AND to each NSNumber in the tuple. +- (RACSignal *)and; + +/// Performs a boolean OR on all of the RACTuple of NSNumbers in sent by the receiver. +/// +/// Asserts if the receiver sends anything other than a RACTuple of one or more NSNumbers. +/// +/// Returns a signal that applies OR to each NSNumber in the tuple. +- (RACSignal *)or; + +/// Sends the result of calling the block with arguments as packed in each RACTuple +/// sent by the receiver. +/// +/// The receiver must send tuple values, where the first element of the tuple is +/// a block, taking a number of parameters equal to the count of the remaining +/// elements of the tuple, and returning an object. Each block must take at least +/// one argument, so each tuple must contain at least 2 elements. +/// +/// Example: +/// +/// RACSignal *adder = [RACSignal return:^(NSNumber *a, NSNumber *b) { +/// return @(a.intValue + b.intValue); +/// }]; +/// RACSignal *sums = [[RACSignal +/// combineLatest:@[ adder, as, bs ]] +/// reduceApply]; +/// +/// Returns a signal of the result of applying the first element of each tuple +/// to the remaining elements. +- (RACSignal *)reduceApply; + +@end + +@interface RACSignal (OperationsDeprecated) + +- (RACSignal *)windowWithStart:(RACSignal *)openSignal close:(RACSignal * (^)(RACSignal *start))closeBlock __attribute__((deprecated("See https://github.com/ReactiveCocoa/ReactiveCocoa/issues/587"))); +- (RACSignal *)buffer:(NSUInteger)bufferCount __attribute__((deprecated("See https://github.com/ReactiveCocoa/ReactiveCocoa/issues/587"))); +- (RACSignal *)let:(RACSignal * (^)(RACSignal *sharedSignal))letBlock __attribute__((deprecated("Use -publish instead"))); ++ (RACSignal *)interval:(NSTimeInterval)interval __attribute__((deprecated("Use +interval:onScheduler: instead"))); ++ (RACSignal *)interval:(NSTimeInterval)interval withLeeway:(NSTimeInterval)leeway __attribute__((deprecated("Use +interval:onScheduler:withLeeway: instead"))); +- (RACSignal *)bufferWithTime:(NSTimeInterval)interval __attribute__((deprecated("Use -bufferWithTime:onScheduler: instead"))); +- (RACSignal *)timeout:(NSTimeInterval)interval __attribute__((deprecated("Use -timeout:onScheduler: instead"))); +- (RACDisposable *)toProperty:(NSString *)keyPath onObject:(NSObject *)object __attribute__((deprecated("Renamed to -setKeyPath:onObject:"))); +- (RACSignal *)ignoreElements __attribute__((deprecated("Renamed to -ignoreValues"))); +- (RACSignal *)sequenceNext:(RACSignal * (^)(void))block __attribute__((deprecated("Renamed to -then:"))); +- (RACSignal *)aggregateWithStart:(id)start combine:(id (^)(id running, id next))combineBlock __attribute__((deprecated("Renamed to -aggregateWithStart:reduce:"))); +- (RACSignal *)aggregateWithStartFactory:(id (^)(void))startFactory combine:(id (^)(id running, id next))combineBlock __attribute__((deprecated("Renamed to -aggregateWithStartFactory:reduce:"))); +- (RACDisposable *)executeCommand:(RACCommand *)command __attribute__((deprecated("Use -flattenMap: or -subscribeNext: instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal.h new file mode 100644 index 0000000..ed644cf --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal.h @@ -0,0 +1,219 @@ +// +// RACSignal.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/1/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import +#import "RACStream.h" + +@class RACDisposable; +@class RACScheduler; +@class RACSubject; +@protocol RACSubscriber; + +@interface RACSignal : RACStream + +/// Creates a new signal. This is the preferred way to create a new signal +/// operation or behavior. +/// +/// Events can be sent to new subscribers immediately in the `didSubscribe` +/// block, but the subscriber will not be able to dispose of the signal until +/// a RACDisposable is returned from `didSubscribe`. In the case of infinite +/// signals, this won't _ever_ happen if events are sent immediately. +/// +/// To ensure that the signal is disposable, events can be scheduled on the +/// +[RACScheduler currentScheduler] (so that they're deferred, not sent +/// immediately), or they can be sent in the background. The RACDisposable +/// returned by the `didSubscribe` block should cancel any such scheduling or +/// asynchronous work. +/// +/// didSubscribe - Called when the signal is subscribed to. The new subscriber is +/// passed in. You can then manually control the by +/// sending it -sendNext:, -sendError:, and -sendCompleted, +/// as defined by the operation you're implementing. This block +/// should return a RACDisposable which cancels any ongoing work +/// triggered by the subscription, and cleans up any resources or +/// disposables created as part of it. When the disposable is +/// disposed of, the signal must not send any more events to the +/// `subscriber`. If no cleanup is necessary, return nil. +/// +/// **Note:** The `didSubscribe` block is called every time a new subscriber +/// subscribes. Any side effects within the block will thus execute once for each +/// subscription, not necessarily on one thread, and possibly even +/// simultaneously! ++ (RACSignal *)createSignal:(RACDisposable * (^)(id subscriber))didSubscribe; + +/// Returns a signal that immediately sends the given error. ++ (RACSignal *)error:(NSError *)error; + +/// Returns a signal that never completes. ++ (RACSignal *)never; + +/// Immediately schedules the given block on the given scheduler. The block is +/// given a subscriber to which it can send events. +/// +/// scheduler - The scheduler on which `block` will be scheduled and results +/// delivered. Cannot be nil. +/// block - The block to invoke. Cannot be NULL. +/// +/// Returns a signal which will send all events sent on the subscriber given to +/// `block`. All events will be sent on `scheduler` and it will replay any missed +/// events to new subscribers. ++ (RACSignal *)startEagerlyWithScheduler:(RACScheduler *)scheduler block:(void (^)(id subscriber))block; + +/// Invokes the given block only on the first subscription. The block is given a +/// subscriber to which it can send events. +/// +/// Note that disposing of the subscription to the returned signal will *not* +/// dispose of the underlying subscription. If you need that behavior, see +/// -[RACMulticastConnection autoconnect]. The underlying subscription will never +/// be disposed of. Because of this, `block` should never return an infinite +/// signal since there would be no way of ending it. +/// +/// scheduler - The scheduler on which the block should be scheduled. Note that +/// if given +[RACScheduler immediateScheduler], the block will be +/// invoked synchronously on the first subscription. Cannot be nil. +/// block - The block to invoke on the first subscription. Cannot be NULL. +/// +/// Returns a signal which will pass through the events sent to the subscriber +/// given to `block` and replay any missed events to new subscribers. ++ (RACSignal *)startLazilyWithScheduler:(RACScheduler *)scheduler block:(void (^)(id subscriber))block; + +@end + +@interface RACSignal (RACStream) + +/// Returns a signal that immediately sends the given value and then completes. ++ (RACSignal *)return:(id)value; + +/// Returns a signal that immediately completes. ++ (RACSignal *)empty; + +/// Subscribes to `signal` when the source signal completes. +- (RACSignal *)concat:(RACSignal *)signal; + +/// Zips the values in the receiver with those of the given signal to create +/// RACTuples. +/// +/// The first `next` of each stream will be combined, then the second `next`, and +/// so forth, until either signal completes or errors. +/// +/// signal - The signal to zip with. This must not be `nil`. +/// +/// Returns a new signal of RACTuples, representing the combined values of the +/// two signals. Any error from one of the original signals will be forwarded on +/// the returned signal. +- (RACSignal *)zipWith:(RACSignal *)signal; + +@end + +@interface RACSignal (Subscription) + +/// Subscribes `subscriber` to changes on the receiver. The receiver defines which +/// events it actually sends and in what situations the events are sent. +/// +/// Subscription will always happen on a valid RACScheduler. If the +/// +[RACScheduler currentScheduler] cannot be determined at the time of +/// subscription (e.g., because the calling code is running on a GCD queue or +/// NSOperationQueue), subscription will occur on a private background scheduler. +/// On the main thread, subscriptions will always occur immediately, with a +/// +[RACScheduler currentScheduler] of +[RACScheduler mainThreadScheduler]. +/// +/// This method must be overridden by any subclasses. +/// +/// Returns nil or a disposable. You can call -[RACDisposable dispose] if you +/// need to end your subscription before it would "naturally" end, either by +/// completing or erroring. Once the disposable has been disposed, the subscriber +/// won't receive any more events from the subscription. +- (RACDisposable *)subscribe:(id)subscriber; + +/// Convenience method to subscribe to the `next` event. +/// +/// This corresponds to `IObserver.OnNext` in Rx. +- (RACDisposable *)subscribeNext:(void (^)(id x))nextBlock; + +/// Convenience method to subscribe to the `next` and `completed` events. +- (RACDisposable *)subscribeNext:(void (^)(id x))nextBlock completed:(void (^)(void))completedBlock; + +/// Convenience method to subscribe to the `next`, `completed`, and `error` events. +- (RACDisposable *)subscribeNext:(void (^)(id x))nextBlock error:(void (^)(NSError *error))errorBlock completed:(void (^)(void))completedBlock; + +/// Convenience method to subscribe to `error` events. +/// +/// This corresponds to the `IObserver.OnError` in Rx. +- (RACDisposable *)subscribeError:(void (^)(NSError *error))errorBlock; + +/// Convenience method to subscribe to `completed` events. +/// +/// This corresponds to the `IObserver.OnCompleted` in Rx. +- (RACDisposable *)subscribeCompleted:(void (^)(void))completedBlock; + +/// Convenience method to subscribe to `next` and `error` events. +- (RACDisposable *)subscribeNext:(void (^)(id x))nextBlock error:(void (^)(NSError *error))errorBlock; + +/// Convenience method to subscribe to `error` and `completed` events. +- (RACDisposable *)subscribeError:(void (^)(NSError *error))errorBlock completed:(void (^)(void))completedBlock; + +@end + +/// Additional methods to assist with debugging. +@interface RACSignal (Debugging) + +/// Logs all events that the receiver sends. +- (RACSignal *)logAll; + +/// Logs each `next` that the receiver sends. +- (RACSignal *)logNext; + +/// Logs any error that the receiver sends. +- (RACSignal *)logError; + +/// Logs any `completed` event that the receiver sends. +- (RACSignal *)logCompleted; + +@end + +/// Additional methods to assist with unit testing. +/// +/// **These methods should never ship in production code.** +@interface RACSignal (Testing) + +/// Spins the main run loop for a short while, waiting for the receiver to send a `next`. +/// +/// **Because this method executes the run loop recursively, it should only be used +/// on the main thread, and only from a unit test.** +/// +/// defaultValue - Returned if the receiver completes or errors before sending +/// a `next`, or if the method times out. This argument may be +/// nil. +/// success - If not NULL, set to whether the receiver completed +/// successfully. +/// error - If not NULL, set to any error that occurred. +/// +/// Returns the first value received, or `defaultValue` if no value is received +/// before the signal finishes or the method times out. +- (id)asynchronousFirstOrDefault:(id)defaultValue success:(BOOL *)success error:(NSError **)error; + +/// Spins the main run loop for a short while, waiting for the receiver to complete. +/// +/// **Because this method executes the run loop recursively, it should only be used +/// on the main thread, and only from a unit test.** +/// +/// error - If not NULL, set to any error that occurs. +/// +/// Returns whether the signal completed successfully before timing out. If NO, +/// `error` will be set to any error that occurred. +- (BOOL)asynchronouslyWaitUntilCompleted:(NSError **)error; + +@end + +@interface RACSignal (Deprecated) + ++ (RACSignal *)start:(id (^)(BOOL *success, NSError **error))block __attribute__((deprecated("Use +startEagerlyWithScheduler:block: instead"))); ++ (RACSignal *)startWithScheduler:(RACScheduler *)scheduler subjectBlock:(void (^)(RACSubject *subject))block __attribute__((deprecated("Use +startEagerlyWithScheduler:block: instead"))); ++ (RACSignal *)startWithScheduler:(RACScheduler *)scheduler block:(id (^)(BOOL *success, NSError **error))block __attribute__((deprecated("Use +startEagerlyWithScheduler:block: instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACStream.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACStream.h new file mode 100644 index 0000000..ab0060f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACStream.h @@ -0,0 +1,335 @@ +// +// RACStream.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2012-10-31. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACStream; + +/// A block which accepts a value from a RACStream and returns a new instance +/// of the same stream class. +/// +/// Setting `stop` to `YES` will cause the bind to terminate after the returned +/// value. Returning `nil` will result in immediate termination. +typedef RACStream * (^RACStreamBindBlock)(id value, BOOL *stop); + +/// An abstract class representing any stream of values. +/// +/// This class represents a monad, upon which many stream-based operations can +/// be built. +/// +/// When subclassing RACStream, only the methods in the main @interface body need +/// to be overridden. +@interface RACStream : NSObject + +/// Returns an empty stream. ++ (instancetype)empty; + +/// Lifts `value` into the stream monad. +/// +/// Returns a stream containing only the given value. ++ (instancetype)return:(id)value; + +/// Lazily binds a block to the values in the receiver. +/// +/// This should only be used if you need to terminate the bind early, or close +/// over some state. -flattenMap: is more appropriate for all other cases. +/// +/// block - A block returning a RACStreamBindBlock. This block will be invoked +/// each time the bound stream is re-evaluated. This block must not be +/// nil or return nil. +/// +/// Returns a new stream which represents the combined result of all lazy +/// applications of `block`. +- (instancetype)bind:(RACStreamBindBlock (^)(void))block; + +/// Appends the values of `stream` to the values in the receiver. +/// +/// stream - A stream to concatenate. This must be an instance of the same +/// concrete class as the receiver, and should not be `nil`. +/// +/// Returns a new stream representing the receiver followed by `stream`. +- (instancetype)concat:(RACStream *)stream; + +/// Zips the values in the receiver with those of the given stream to create +/// RACTuples. +/// +/// The first value of each stream will be combined, then the second value, and +/// so forth, until at least one of the streams is exhausted. +/// +/// stream - The stream to zip with. This must be an instance of the same +/// concrete class as the receiver, and should not be `nil`. +/// +/// Returns a new stream of RACTuples, representing the zipped values of the +/// two streams. +- (instancetype)zipWith:(RACStream *)stream; + +@end + +/// This extension contains functionality to support naming streams for +/// debugging. +/// +/// Subclasses do not need to override the methods here. +@interface RACStream () + +/// The name of the stream. This is for debugging/human purposes only. +@property (copy) NSString *name; + +/// Sets the name of the receiver to the given format string. +/// +/// This is for debugging purposes only, and won't do anything unless the +/// RAC_DEBUG_SIGNAL_NAMES environment variable is set. +/// +/// Returns the receiver, for easy method chaining. +- (instancetype)setNameWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2); + +@end + +/// Operations built on the RACStream primitives. +/// +/// These methods do not need to be overridden, although subclasses may +/// occasionally gain better performance from doing so. +@interface RACStream (Operations) + +/// Maps `block` across the values in the receiver and flattens the result. +/// +/// Note that operators applied _after_ -flattenMap: behave differently from +/// operators _within_ -flattenMap:. See the Examples section below. +/// +/// This corresponds to the `SelectMany` method in Rx. +/// +/// block - A block which accepts the values in the receiver and returns a new +/// instance of the receiver's class. Returning `nil` from this block is +/// equivalent to returning an empty signal. +/// +/// Examples +/// +/// [signal flattenMap:^(id x) { +/// // Logs each time a returned signal completes. +/// return [[RACSignal return:x] logCompleted]; +/// }]; +/// +/// [[signal +/// flattenMap:^(id x) { +/// return [RACSignal return:x]; +/// }] +/// // Logs only once, when all of the signals complete. +/// logCompleted]; +/// +/// Returns a new stream which represents the combined streams resulting from +/// mapping `block`. +- (instancetype)flattenMap:(RACStream * (^)(id value))block; + +/// Flattens a stream of streams. +/// +/// This corresponds to the `Merge` method in Rx. +/// +/// Returns a stream consisting of the combined streams obtained from the +/// receiver. +- (instancetype)flatten; + +/// Maps `block` across the values in the receiver. +/// +/// This corresponds to the `Select` method in Rx. +/// +/// Returns a new stream with the mapped values. +- (instancetype)map:(id (^)(id value))block; + +/// Replaces each value in the receiver with the given object. +/// +/// Returns a new stream which includes the given object once for each value in +/// the receiver. +- (instancetype)mapReplace:(id)object; + +/// Filters out values in the receiver that don't pass the given test. +/// +/// This corresponds to the `Where` method in Rx. +/// +/// Returns a new stream with only those values that passed. +- (instancetype)filter:(BOOL (^)(id value))block; + +/// Filters out values in the receiver that equal (via -isEqual:) the provided value. +/// +/// value - The value can be `nil`, in which case it ignores `nil` values. +/// +/// Returns a new stream containing only the values which did not compare equal +/// to `value`. +- (instancetype)ignore:(id)value; + +/// Unpacks each RACTuple in the receiver and maps the values to a new value. +/// +/// reduceBlock - The block which reduces each RACTuple's values into one value. +/// It must take as many arguments as the number of tuple elements +/// to process. Each argument will be an object argument. The +/// return value must be an object. This argument cannot be nil. +/// +/// Returns a new stream of reduced tuple values. +- (instancetype)reduceEach:(id (^)())reduceBlock; + +/// Returns a stream consisting of `value`, followed by the values in the +/// receiver. +- (instancetype)startWith:(id)value; + +/// Skips the first `skipCount` values in the receiver. +/// +/// Returns the receiver after skipping the first `skipCount` values. If +/// `skipCount` is greater than the number of values in the stream, an empty +/// stream is returned. +- (instancetype)skip:(NSUInteger)skipCount; + +/// Returns a stream of the first `count` values in the receiver. If `count` is +/// greater than or equal to the number of values in the stream, a stream +/// equivalent to the receiver is returned. +- (instancetype)take:(NSUInteger)count; + +/// Zips the values in the given streams to create RACTuples. +/// +/// The first value of each stream will be combined, then the second value, and +/// so forth, until at least one of the streams is exhausted. +/// +/// streams - The streams to combine. These must all be instances of the same +/// concrete class implementing the protocol. If this collection is +/// empty, the returned stream will be empty. +/// +/// Returns a new stream containing RACTuples of the zipped values from the +/// streams. ++ (instancetype)zip:(id)streams; + +/// Zips streams using +zip:, then reduces the resulting tuples into a single +/// value using -reduceEach: +/// +/// streams - The streams to combine. These must all be instances of the +/// same concrete class implementing the protocol. If this +/// collection is empty, the returned stream will be empty. +/// reduceBlock - The block which reduces the values from all the streams +/// into one value. It must take as many arguments as the +/// number of streams given. Each argument will be an object +/// argument. The return value must be an object. This argument +/// must not be nil. +/// +/// Example: +/// +/// [RACStream zip:@[ stringSignal, intSignal ] reduce:^(NSString *string, NSNumber *number) { +/// return [NSString stringWithFormat:@"%@: %@", string, number]; +/// }]; +/// +/// Returns a new stream containing the results from each invocation of +/// `reduceBlock`. ++ (instancetype)zip:(id)streams reduce:(id (^)())reduceBlock; + +/// Returns a stream obtained by concatenating `streams` in order. ++ (instancetype)concat:(id)streams; + +/// Combines values in the receiver from left to right using the given block. +/// +/// The algorithm proceeds as follows: +/// +/// 1. `startingValue` is passed into the block as the `running` value, and the +/// first element of the receiver is passed into the block as the `next` value. +/// 2. The result of the invocation is added to the returned stream. +/// 3. The result of the invocation (`running`) and the next element of the +/// receiver (`next`) is passed into `block`. +/// 4. Steps 2 and 3 are repeated until all values have been processed. +/// +/// startingValue - The value to be combined with the first element of the +/// receiver. This value may be `nil`. +/// reduceBlock - The block that describes how to combine values of the +/// receiver. If the receiver is empty, this block will never be +/// invoked. Cannot be nil. +/// +/// Examples +/// +/// RACSequence *numbers = @[ @1, @2, @3, @4 ].rac_sequence; +/// +/// // Contains 1, 3, 6, 10 +/// RACSequence *sums = [numbers scanWithStart:@0 reduce:^(NSNumber *sum, NSNumber *next) { +/// return @(sum.integerValue + next.integerValue); +/// }]; +/// +/// Returns a new stream that consists of each application of `reduceBlock`. If the +/// receiver is empty, an empty stream is returned. +- (instancetype)scanWithStart:(id)startingValue reduce:(id (^)(id running, id next))reduceBlock; + +/// Combines values in the receiver from left to right using the given block +/// which also takes zero-based index of the values. +/// +/// startingValue - The value to be combined with the first element of the +/// receiver. This value may be `nil`. +/// reduceBlock - The block that describes how to combine values of the +/// receiver. This block takes zero-based index value as the last +/// parameter. If the receiver is empty, this block will never +/// be invoked. Cannot be nil. +/// +/// Returns a new stream that consists of each application of `reduceBlock`. If the +/// receiver is empty, an empty stream is returned. +- (instancetype)scanWithStart:(id)startingValue reduceWithIndex:(id (^)(id running, id next, NSUInteger index))reduceBlock; + +/// Combines each previous and current value into one object. +/// +/// This method is similar to -scanWithStart:reduce:, but only ever operates on +/// the previous and current values (instead of the whole stream), and does not +/// pass the return value of `reduceBlock` into the next invocation of it. +/// +/// start - The value passed into `reduceBlock` as `previous` for the +/// first value. +/// reduceBlock - The block that combines the previous value and the current +/// value to create the reduced value. Cannot be nil. +/// +/// Examples +/// +/// RACSequence *numbers = @[ @1, @2, @3, @4 ].rac_sequence; +/// +/// // Contains 1, 3, 5, 7 +/// RACSequence *sums = [numbers combinePreviousWithStart:@0 reduce:^(NSNumber *previous, NSNumber *next) { +/// return @(previous.integerValue + next.integerValue); +/// }]; +/// +/// Returns a new stream consisting of the return values from each application of +/// `reduceBlock`. +- (instancetype)combinePreviousWithStart:(id)start reduce:(id (^)(id previous, id current))reduceBlock; + +/// Takes values until the given block returns `YES`. +/// +/// Returns a stream of the initial values in the receiver that fail `predicate`. +/// If `predicate` never returns `YES`, a stream equivalent to the receiver is +/// returned. +- (instancetype)takeUntilBlock:(BOOL (^)(id x))predicate; + +/// Takes values until the given block returns `NO`. +/// +/// Returns a stream of the initial values in the receiver that pass `predicate`. +/// If `predicate` never returns `NO`, a stream equivalent to the receiver is +/// returned. +- (instancetype)takeWhileBlock:(BOOL (^)(id x))predicate; + +/// Skips values until the given block returns `YES`. +/// +/// Returns a stream containing the values of the receiver that follow any +/// initial values failing `predicate`. If `predicate` never returns `YES`, +/// an empty stream is returned. +- (instancetype)skipUntilBlock:(BOOL (^)(id x))predicate; + +/// Skips values until the given block returns `NO`. +/// +/// Returns a stream containing the values of the receiver that follow any +/// initial values passing `predicate`. If `predicate` never returns `NO`, an +/// empty stream is returned. +- (instancetype)skipWhileBlock:(BOOL (^)(id x))predicate; + +/// Returns a stream of values for which -isEqual: returns NO when compared to the +/// previous value. +- (instancetype)distinctUntilChanged; + +@end + +@interface RACStream (Deprecated) + +- (instancetype)sequenceMany:(RACStream * (^)(void))block __attribute__((deprecated("Use -flattenMap: instead"))); +- (instancetype)scanWithStart:(id)startingValue combine:(id (^)(id running, id next))block __attribute__((deprecated("Renamed to -scanWithStart:reduce:"))); +- (instancetype)mapPreviousWithStart:(id)start reduce:(id (^)(id previous, id current))combineBlock __attribute__((deprecated("Renamed to -combinePreviousWithStart:reduce:"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubject.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubject.h new file mode 100644 index 0000000..30c100b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubject.h @@ -0,0 +1,22 @@ +// +// RACSubject.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/9/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import "RACSignal.h" +#import "RACSubscriber.h" + +/// A subject can be thought of as a signal that you can manually control by +/// sending next, completed, and error. +/// +/// They're most helpful in bridging the non-RAC world to RAC, since they let you +/// manually control the sending of events. +@interface RACSubject : RACSignal + +/// Returns a new subject. ++ (instancetype)subject; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriber.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriber.h new file mode 100644 index 0000000..b62ea35 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriber.h @@ -0,0 +1,51 @@ +// +// RACSubscriber.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/1/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +@class RACCompoundDisposable; + +/// Represents any object which can directly receive values from a RACSignal. +/// +/// You generally shouldn't need to implement this protocol. +[RACSignal +/// createSignal:], RACSignal's subscription methods, or RACSubject should work +/// for most uses. +/// +/// Implementors of this protocol may receive messages and values from multiple +/// threads simultaneously, and so should be thread-safe. Subscribers will also +/// be weakly referenced so implementations must allow that. +@protocol RACSubscriber +@required + +/// Sends the next value to subscribers. +/// +/// value - The value to send. This can be `nil`. +- (void)sendNext:(id)value; + +/// Sends the error to subscribers. +/// +/// error - The error to send. This can be `nil`. +/// +/// This terminates the subscription, and invalidates the subscriber (such that +/// it cannot subscribe to anything else in the future). +- (void)sendError:(NSError *)error; + +/// Sends completed to subscribers. +/// +/// This terminates the subscription, and invalidates the subscriber (such that +/// it cannot subscribe to anything else in the future). +- (void)sendCompleted; + +/// Sends the subscriber a disposable that represents one of its subscriptions. +/// +/// A subscriber may receive multiple disposables if it gets subscribed to +/// multiple signals; however, any error or completed events must terminate _all_ +/// subscriptions. +- (void)didSubscribeWithDisposable:(RACCompoundDisposable *)disposable; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriptingAssignmentTrampoline.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriptingAssignmentTrampoline.h new file mode 100644 index 0000000..07ec9e7 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriptingAssignmentTrampoline.h @@ -0,0 +1,54 @@ +// +// RACSubscriptingAssignmentTrampoline.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 9/24/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import +#import "EXTKeyPathCoding.h" + +@class RACSignal; + +/// Assigns a signal to an object property, automatically setting the given key +/// path on every `next`. When the signal completes, the binding is automatically +/// disposed of. +/// +/// There are two different versions of this macro: +/// +/// - RAC(TARGET, KEYPATH, NILVALUE) will bind the `KEYPATH` of `TARGET` to the +/// given signal. If the signal ever sends a `nil` value, the property will be +/// set to `NILVALUE` instead. `NILVALUE` may itself be `nil` for object +/// properties, but an NSValue should be used for primitive properties, to +/// avoid an exception if `nil` is sent (which might occur if an intermediate +/// object is set to `nil`). +/// - RAC(TARGET, KEYPATH) is the same as the above, but `NILVALUE` defaults to +/// `nil`. +/// +/// See -[RACSignal setKeyPath:onObject:nilValue:] for more information about the +/// binding's semantics. +/// +/// Examples +/// +/// RAC(self, objectProperty) = objectSignal; +/// RAC(self, stringProperty, @"foobar") = stringSignal; +/// RAC(self, integerProperty, @42) = integerSignal; +/// +/// WARNING: Under certain conditions, use of this macro can be thread-unsafe. +/// See the documentation of -setKeyPath:onObject:nilValue:. +#define RAC(TARGET, ...) \ + metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__)) \ + (RAC_(TARGET, __VA_ARGS__, nil)) \ + (RAC_(TARGET, __VA_ARGS__)) + +/// Do not use this directly. Use the RAC macro above. +#define RAC_(TARGET, KEYPATH, NILVALUE) \ + [[RACSubscriptingAssignmentTrampoline alloc] initWithTarget:(TARGET) nilValue:(NILVALUE)][@keypath(TARGET, KEYPATH)] + +@interface RACSubscriptingAssignmentTrampoline : NSObject + +- (id)initWithTarget:(id)target nilValue:(id)nilValue; +- (void)setObject:(RACSignal *)signal forKeyedSubscript:(NSString *)keyPath; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTargetQueueScheduler.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTargetQueueScheduler.h new file mode 100644 index 0000000..429e595 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTargetQueueScheduler.h @@ -0,0 +1,24 @@ +// +// RACTargetQueueScheduler.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 6/6/13. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import "RACQueueScheduler.h" + +/// A scheduler that enqueues blocks on a private serial queue, targeting an +/// arbitrary GCD queue. +@interface RACTargetQueueScheduler : RACQueueScheduler + +/// Initializes the receiver with a serial queue that will target the given +/// `targetQueue`. +/// +/// name - The name of the scheduler. If nil, a default name will be used. +/// targetQueue - The queue to target. Cannot be NULL. +/// +/// Returns the initialized object. +- (id)initWithName:(NSString *)name targetQueue:(dispatch_queue_t)targetQueue; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTestScheduler.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTestScheduler.h new file mode 100644 index 0000000..a790f5b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTestScheduler.h @@ -0,0 +1,42 @@ +// +// RACTestScheduler.h +// ReactiveCocoa +// +// Created by Justin Spahr-Summers on 2013-07-06. +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// + +#import "RACScheduler.h" + +/// A special kind of scheduler that steps through virtualized time. +/// +/// This scheduler class can be used in unit tests to verify asynchronous +/// behaviors without spending significant time waiting. +/// +/// This class can be used from multiple threads, but only one thread can `step` +/// through the enqueued actions at a time. Other threads will wait while the +/// scheduled blocks are being executed. +@interface RACTestScheduler : RACScheduler + +/// Initializes a new test scheduler. +- (instancetype)init; + +/// Executes the next scheduled block, if any. +/// +/// This method will block until the scheduled action has completed. +- (void)step; + +/// Executes up to the next `ticks` scheduled blocks. +/// +/// This method will block until the scheduled actions have completed. +/// +/// ticks - The number of scheduled blocks to execute. If there aren't this many +/// blocks enqueued, all scheduled blocks are executed. +- (void)step:(NSUInteger)ticks; + +/// Executes all of the scheduled blocks on the receiver. +/// +/// This method will block until the scheduled actions have completed. +- (void)stepAll; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTuple.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTuple.h new file mode 100644 index 0000000..647b42c --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTuple.h @@ -0,0 +1,159 @@ +// +// RACTuple.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 4/12/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import +#import "metamacros.h" + +@class RACSequence; + +/// Creates a new tuple with the given values. At least one value must be given. +/// Values can be nil. +#define RACTuplePack(...) \ + RACTuplePack_(__VA_ARGS__) + +/// Declares new object variables and unpacks a RACTuple into them. +/// +/// This macro should be used on the left side of an assignment, with the +/// tuple on the right side. Nothing else should appear on the same line, and the +/// macro should not be the only statement in a conditional or loop body. +/// +/// If the tuple has more values than there are variables listed, the excess +/// values are ignored. +/// +/// If the tuple has fewer values than there are variables listed, the excess +/// variables are initialized to nil. +/// +/// Examples +/// +/// RACTupleUnpack(NSString *string, NSNumber *num) = [RACTuple tupleWithObjects:@"foo", @5, nil]; +/// NSLog(@"string: %@", string); +/// NSLog(@"num: %@", num); +/// +/// /* The above is equivalent to: */ +/// RACTuple *t = [RACTuple tupleWithObjects:@"foo", @5, nil]; +/// NSString *string = t[0]; +/// NSNumber *num = t[1]; +/// NSLog(@"string: %@", string); +/// NSLog(@"num: %@", num); +#define RACTupleUnpack(...) \ + RACTupleUnpack_(__VA_ARGS__) + +/// A sentinel object that represents nils in the tuple. +/// +/// It should never be necessary to create a tuple nil yourself. Just use +/// +tupleNil. +@interface RACTupleNil : NSObject +/// A singleton instance. ++ (RACTupleNil *)tupleNil; +@end + + +/// A tuple is an ordered collection of objects. It may contain nils, represented +/// by RACTupleNil. +@interface RACTuple : NSObject + +@property (nonatomic, readonly) NSUInteger count; + +/// These properties all return the object at that index or nil if the number of +/// objects is less than the index. +@property (nonatomic, readonly) id first; +@property (nonatomic, readonly) id second; +@property (nonatomic, readonly) id third; +@property (nonatomic, readonly) id fourth; +@property (nonatomic, readonly) id fifth; +@property (nonatomic, readonly) id last; + +/// Creates a new tuple out of the array. Does not convert nulls to nils. ++ (instancetype)tupleWithObjectsFromArray:(NSArray *)array; + +/// Creates a new tuple out of the array. If `convert` is YES, it also converts +/// every NSNull to RACTupleNil. ++ (instancetype)tupleWithObjectsFromArray:(NSArray *)array convertNullsToNils:(BOOL)convert; + +/// Creates a new tuple with the given objects. Use RACTupleNil to represent +/// nils. ++ (instancetype)tupleWithObjects:(id)object, ... NS_REQUIRES_NIL_TERMINATION; + +/// Returns the object at `index` or nil if the object is a RACTupleNil. Unlike +/// NSArray and friends, it's perfectly fine to ask for the object at an index +/// past the tuple's count - 1. It will simply return nil. +- (id)objectAtIndex:(NSUInteger)index; + +/// Returns an array of all the objects. RACTupleNils are converted to NSNulls. +- (NSArray *)allObjects; + +/// Appends `obj` to the receiver. +/// +/// obj - The object to add to the tuple. This argument may be nil. +/// +/// Returns a new tuple. +- (instancetype)tupleByAddingObject:(id)obj; + +@end + +@interface RACTuple (RACSequenceAdditions) + +/// Returns a sequence of all the objects. RACTupleNils are converted to NSNulls. +@property (nonatomic, copy, readonly) RACSequence *rac_sequence; + +@end + +@interface RACTuple (ObjectSubscripting) +/// Returns the object at that index or nil if the number of objects is less +/// than the index. +- (id)objectAtIndexedSubscript:(NSUInteger)idx; +@end + +/// This and everything below is for internal use only. +/// +/// See RACTuplePack() and RACTupleUnpack() instead. +#define RACTuplePack_(...) \ + ([RACTuple tupleWithObjectsFromArray:@[ metamacro_foreach(RACTuplePack_object_or_ractuplenil,, __VA_ARGS__) ]]) + +#define RACTuplePack_object_or_ractuplenil(INDEX, ARG) \ + (ARG) ?: RACTupleNil.tupleNil, + +#define RACTupleUnpack_(...) \ + metamacro_foreach(RACTupleUnpack_decl,, __VA_ARGS__) \ + \ + int RACTupleUnpack_state = 0; \ + \ + RACTupleUnpack_after: \ + ; \ + metamacro_foreach(RACTupleUnpack_assign,, __VA_ARGS__) \ + if (RACTupleUnpack_state != 0) RACTupleUnpack_state = 2; \ + \ + while (RACTupleUnpack_state != 2) \ + if (RACTupleUnpack_state == 1) { \ + goto RACTupleUnpack_after; \ + } else \ + for (; RACTupleUnpack_state != 1; RACTupleUnpack_state = 1) \ + [RACTupleUnpackingTrampoline trampoline][ @[ metamacro_foreach(RACTupleUnpack_value,, __VA_ARGS__) ] ] + +#define RACTupleUnpack_state metamacro_concat(RACTupleUnpack_state, __LINE__) +#define RACTupleUnpack_after metamacro_concat(RACTupleUnpack_after, __LINE__) +#define RACTupleUnpack_loop metamacro_concat(RACTupleUnpack_loop, __LINE__) + +#define RACTupleUnpack_decl_name(INDEX) \ + metamacro_concat(metamacro_concat(RACTupleUnpack, __LINE__), metamacro_concat(_var, INDEX)) + +#define RACTupleUnpack_decl(INDEX, ARG) \ + __strong id RACTupleUnpack_decl_name(INDEX); + +#define RACTupleUnpack_assign(INDEX, ARG) \ + __strong ARG = RACTupleUnpack_decl_name(INDEX); + +#define RACTupleUnpack_value(INDEX, ARG) \ + [NSValue valueWithPointer:&RACTupleUnpack_decl_name(INDEX)], + +@interface RACTupleUnpackingTrampoline : NSObject + ++ (instancetype)trampoline; +- (void)setObject:(RACTuple *)tuple forKeyedSubscript:(NSArray *)variables; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACUnit.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACUnit.h new file mode 100644 index 0000000..a04e2b1 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACUnit.h @@ -0,0 +1,19 @@ +// +// RACUnit.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/27/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +/// A unit represents an empty value. +/// +/// It should never be necessary to create a unit yourself. Just use +defaultUnit. +@interface RACUnit : NSObject + +/// A singleton instance. ++ (RACUnit *)defaultUnit; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/ReactiveCocoa.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/ReactiveCocoa.h new file mode 100644 index 0000000..164b4a9 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/ReactiveCocoa.h @@ -0,0 +1,89 @@ +// +// ReactiveCocoa.h +// ReactiveCocoa +// +// Created by Josh Abernathy on 3/5/12. +// Copyright (c) 2012 GitHub, Inc. All rights reserved. +// + +#import + +//! Project version number for ReactiveCocoa. +FOUNDATION_EXPORT double ReactiveCocoaVersionNumber; + +//! Project version string for ReactiveCocoa. +FOUNDATION_EXPORT const unsigned char ReactiveCocoaVersionString[]; + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import + #import +#elif TARGET_OS_MAC + #import + #import + #import + #import +#endif diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/metamacros.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/metamacros.h new file mode 100644 index 0000000..77a77b5 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/metamacros.h @@ -0,0 +1,666 @@ +/** + * Macros for metaprogramming + * ExtendedC + * + * Copyright (C) 2012 Justin Spahr-Summers + * Released under the MIT license + */ + +#ifndef EXTC_METAMACROS_H +#define EXTC_METAMACROS_H + +/** + * Executes one or more expressions (which may have a void type, such as a call + * to a function that returns no value) and always returns true. + */ +#define metamacro_exprify(...) \ + ((__VA_ARGS__), true) + +/** + * Returns a string representation of VALUE after full macro expansion. + */ +#define metamacro_stringify(VALUE) \ + metamacro_stringify_(VALUE) + +/** + * Returns A and B concatenated after full macro expansion. + */ +#define metamacro_concat(A, B) \ + metamacro_concat_(A, B) + +/** + * Returns the Nth variadic argument (starting from zero). At least + * N + 1 variadic arguments must be given. N must be between zero and twenty, + * inclusive. + */ +#define metamacro_at(N, ...) \ + metamacro_concat(metamacro_at, N)(__VA_ARGS__) + +/** + * Returns the number of arguments (up to twenty) provided to the macro. At + * least one argument must be provided. + * + * Inspired by P99: http://p99.gforge.inria.fr + */ +#define metamacro_argcount(...) \ + metamacro_at(20, __VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) + +/** + * Identical to #metamacro_foreach_cxt, except that no CONTEXT argument is + * given. Only the index and current argument will thus be passed to MACRO. + */ +#define metamacro_foreach(MACRO, SEP, ...) \ + metamacro_foreach_cxt(metamacro_foreach_iter, SEP, MACRO, __VA_ARGS__) + +/** + * For each consecutive variadic argument (up to twenty), MACRO is passed the + * zero-based index of the current argument, CONTEXT, and then the argument + * itself. The results of adjoining invocations of MACRO are then separated by + * SEP. + * + * Inspired by P99: http://p99.gforge.inria.fr + */ +#define metamacro_foreach_cxt(MACRO, SEP, CONTEXT, ...) \ + metamacro_concat(metamacro_foreach_cxt, metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__) + +/** + * Identical to #metamacro_foreach_cxt. This can be used when the former would + * fail due to recursive macro expansion. + */ +#define metamacro_foreach_cxt_recursive(MACRO, SEP, CONTEXT, ...) \ + metamacro_concat(metamacro_foreach_cxt_recursive, metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__) + +/** + * In consecutive order, appends each variadic argument (up to twenty) onto + * BASE. The resulting concatenations are then separated by SEP. + * + * This is primarily useful to manipulate a list of macro invocations into instead + * invoking a different, possibly related macro. + */ +#define metamacro_foreach_concat(BASE, SEP, ...) \ + metamacro_foreach_cxt(metamacro_foreach_concat_iter, SEP, BASE, __VA_ARGS__) + +/** + * Iterates COUNT times, each time invoking MACRO with the current index + * (starting at zero) and CONTEXT. The results of adjoining invocations of MACRO + * are then separated by SEP. + * + * COUNT must be an integer between zero and twenty, inclusive. + */ +#define metamacro_for_cxt(COUNT, MACRO, SEP, CONTEXT) \ + metamacro_concat(metamacro_for_cxt, COUNT)(MACRO, SEP, CONTEXT) + +/** + * Returns the first argument given. At least one argument must be provided. + * + * This is useful when implementing a variadic macro, where you may have only + * one variadic argument, but no way to retrieve it (for example, because \c ... + * always needs to match at least one argument). + * + * @code + +#define varmacro(...) \ + metamacro_head(__VA_ARGS__) + + * @endcode + */ +#define metamacro_head(...) \ + metamacro_head_(__VA_ARGS__, 0) + +/** + * Returns every argument except the first. At least two arguments must be + * provided. + */ +#define metamacro_tail(...) \ + metamacro_tail_(__VA_ARGS__) + +/** + * Returns the first N (up to twenty) variadic arguments as a new argument list. + * At least N variadic arguments must be provided. + */ +#define metamacro_take(N, ...) \ + metamacro_concat(metamacro_take, N)(__VA_ARGS__) + +/** + * Removes the first N (up to twenty) variadic arguments from the given argument + * list. At least N variadic arguments must be provided. + */ +#define metamacro_drop(N, ...) \ + metamacro_concat(metamacro_drop, N)(__VA_ARGS__) + +/** + * Decrements VAL, which must be a number between zero and twenty, inclusive. + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_dec(VAL) \ + metamacro_at(VAL, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19) + +/** + * Increments VAL, which must be a number between zero and twenty, inclusive. + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_inc(VAL) \ + metamacro_at(VAL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21) + +/** + * If A is equal to B, the next argument list is expanded; otherwise, the + * argument list after that is expanded. A and B must be numbers between zero + * and twenty, inclusive. Additionally, B must be greater than or equal to A. + * + * @code + +// expands to true +metamacro_if_eq(0, 0)(true)(false) + +// expands to false +metamacro_if_eq(0, 1)(true)(false) + + * @endcode + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_if_eq(A, B) \ + metamacro_concat(metamacro_if_eq, A)(B) + +/** + * Identical to #metamacro_if_eq. This can be used when the former would fail + * due to recursive macro expansion. + */ +#define metamacro_if_eq_recursive(A, B) \ + metamacro_concat(metamacro_if_eq_recursive, A)(B) + +/** + * Returns 1 if N is an even number, or 0 otherwise. N must be between zero and + * twenty, inclusive. + * + * For the purposes of this test, zero is considered even. + */ +#define metamacro_is_even(N) \ + metamacro_at(N, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1) + +/** + * Returns the logical NOT of B, which must be the number zero or one. + */ +#define metamacro_not(B) \ + metamacro_at(B, 1, 0) + +// IMPLEMENTATION DETAILS FOLLOW! +// Do not write code that depends on anything below this line. +#define metamacro_stringify_(VALUE) # VALUE +#define metamacro_concat_(A, B) A ## B +#define metamacro_foreach_iter(INDEX, MACRO, ARG) MACRO(INDEX, ARG) +#define metamacro_head_(FIRST, ...) FIRST +#define metamacro_tail_(FIRST, ...) __VA_ARGS__ +#define metamacro_consume_(...) +#define metamacro_expand_(...) __VA_ARGS__ + +// implemented from scratch so that metamacro_concat() doesn't end up nesting +#define metamacro_foreach_concat_iter(INDEX, BASE, ARG) metamacro_foreach_concat_iter_(BASE, ARG) +#define metamacro_foreach_concat_iter_(BASE, ARG) BASE ## ARG + +// metamacro_at expansions +#define metamacro_at0(...) metamacro_head(__VA_ARGS__) +#define metamacro_at1(_0, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at2(_0, _1, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at3(_0, _1, _2, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at4(_0, _1, _2, _3, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at5(_0, _1, _2, _3, _4, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at6(_0, _1, _2, _3, _4, _5, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at7(_0, _1, _2, _3, _4, _5, _6, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at8(_0, _1, _2, _3, _4, _5, _6, _7, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at9(_0, _1, _2, _3, _4, _5, _6, _7, _8, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at10(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at11(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at12(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at13(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at14(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at15(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at17(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at18(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at19(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at20(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, ...) metamacro_head(__VA_ARGS__) + +// metamacro_foreach_cxt expansions +#define metamacro_foreach_cxt0(MACRO, SEP, CONTEXT) +#define metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0) + +#define metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \ + metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) \ + SEP \ + MACRO(1, CONTEXT, _1) + +#define metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \ + SEP \ + MACRO(2, CONTEXT, _2) + +#define metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + SEP \ + MACRO(3, CONTEXT, _3) + +#define metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + SEP \ + MACRO(4, CONTEXT, _4) + +#define metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + SEP \ + MACRO(5, CONTEXT, _5) + +#define metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + SEP \ + MACRO(6, CONTEXT, _6) + +#define metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + SEP \ + MACRO(7, CONTEXT, _7) + +#define metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + SEP \ + MACRO(8, CONTEXT, _8) + +#define metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + SEP \ + MACRO(9, CONTEXT, _9) + +#define metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + SEP \ + MACRO(10, CONTEXT, _10) + +#define metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + SEP \ + MACRO(11, CONTEXT, _11) + +#define metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + SEP \ + MACRO(12, CONTEXT, _12) + +#define metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + SEP \ + MACRO(13, CONTEXT, _13) + +#define metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + SEP \ + MACRO(14, CONTEXT, _14) + +#define metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + SEP \ + MACRO(15, CONTEXT, _15) + +#define metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + SEP \ + MACRO(16, CONTEXT, _16) + +#define metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + SEP \ + MACRO(17, CONTEXT, _17) + +#define metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + SEP \ + MACRO(18, CONTEXT, _18) + +#define metamacro_foreach_cxt20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \ + metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + SEP \ + MACRO(19, CONTEXT, _19) + +// metamacro_foreach_cxt_recursive expansions +#define metamacro_foreach_cxt_recursive0(MACRO, SEP, CONTEXT) +#define metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0) + +#define metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \ + metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) \ + SEP \ + MACRO(1, CONTEXT, _1) + +#define metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \ + SEP \ + MACRO(2, CONTEXT, _2) + +#define metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + SEP \ + MACRO(3, CONTEXT, _3) + +#define metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + SEP \ + MACRO(4, CONTEXT, _4) + +#define metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + SEP \ + MACRO(5, CONTEXT, _5) + +#define metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + SEP \ + MACRO(6, CONTEXT, _6) + +#define metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + SEP \ + MACRO(7, CONTEXT, _7) + +#define metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + SEP \ + MACRO(8, CONTEXT, _8) + +#define metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + SEP \ + MACRO(9, CONTEXT, _9) + +#define metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + SEP \ + MACRO(10, CONTEXT, _10) + +#define metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + SEP \ + MACRO(11, CONTEXT, _11) + +#define metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + SEP \ + MACRO(12, CONTEXT, _12) + +#define metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + SEP \ + MACRO(13, CONTEXT, _13) + +#define metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + SEP \ + MACRO(14, CONTEXT, _14) + +#define metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + SEP \ + MACRO(15, CONTEXT, _15) + +#define metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + SEP \ + MACRO(16, CONTEXT, _16) + +#define metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + SEP \ + MACRO(17, CONTEXT, _17) + +#define metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + SEP \ + MACRO(18, CONTEXT, _18) + +#define metamacro_foreach_cxt_recursive20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \ + metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + SEP \ + MACRO(19, CONTEXT, _19) + +// metamacro_for_cxt expansions +#define metamacro_for_cxt0(MACRO, SEP, CONTEXT) +#define metamacro_for_cxt1(MACRO, SEP, CONTEXT) MACRO(0, CONTEXT) + +#define metamacro_for_cxt2(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt1(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(1, CONTEXT) + +#define metamacro_for_cxt3(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt2(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(2, CONTEXT) + +#define metamacro_for_cxt4(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt3(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(3, CONTEXT) + +#define metamacro_for_cxt5(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt4(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(4, CONTEXT) + +#define metamacro_for_cxt6(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt5(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(5, CONTEXT) + +#define metamacro_for_cxt7(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt6(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(6, CONTEXT) + +#define metamacro_for_cxt8(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt7(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(7, CONTEXT) + +#define metamacro_for_cxt9(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt8(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(8, CONTEXT) + +#define metamacro_for_cxt10(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt9(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(9, CONTEXT) + +#define metamacro_for_cxt11(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt10(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(10, CONTEXT) + +#define metamacro_for_cxt12(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt11(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(11, CONTEXT) + +#define metamacro_for_cxt13(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt12(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(12, CONTEXT) + +#define metamacro_for_cxt14(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt13(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(13, CONTEXT) + +#define metamacro_for_cxt15(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt14(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(14, CONTEXT) + +#define metamacro_for_cxt16(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt15(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(15, CONTEXT) + +#define metamacro_for_cxt17(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt16(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(16, CONTEXT) + +#define metamacro_for_cxt18(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt17(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(17, CONTEXT) + +#define metamacro_for_cxt19(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt18(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(18, CONTEXT) + +#define metamacro_for_cxt20(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt19(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(19, CONTEXT) + +// metamacro_if_eq expansions +#define metamacro_if_eq0(VALUE) \ + metamacro_concat(metamacro_if_eq0_, VALUE) + +#define metamacro_if_eq0_0(...) __VA_ARGS__ metamacro_consume_ +#define metamacro_if_eq0_1(...) metamacro_expand_ +#define metamacro_if_eq0_2(...) metamacro_expand_ +#define metamacro_if_eq0_3(...) metamacro_expand_ +#define metamacro_if_eq0_4(...) metamacro_expand_ +#define metamacro_if_eq0_5(...) metamacro_expand_ +#define metamacro_if_eq0_6(...) metamacro_expand_ +#define metamacro_if_eq0_7(...) metamacro_expand_ +#define metamacro_if_eq0_8(...) metamacro_expand_ +#define metamacro_if_eq0_9(...) metamacro_expand_ +#define metamacro_if_eq0_10(...) metamacro_expand_ +#define metamacro_if_eq0_11(...) metamacro_expand_ +#define metamacro_if_eq0_12(...) metamacro_expand_ +#define metamacro_if_eq0_13(...) metamacro_expand_ +#define metamacro_if_eq0_14(...) metamacro_expand_ +#define metamacro_if_eq0_15(...) metamacro_expand_ +#define metamacro_if_eq0_16(...) metamacro_expand_ +#define metamacro_if_eq0_17(...) metamacro_expand_ +#define metamacro_if_eq0_18(...) metamacro_expand_ +#define metamacro_if_eq0_19(...) metamacro_expand_ +#define metamacro_if_eq0_20(...) metamacro_expand_ + +#define metamacro_if_eq1(VALUE) metamacro_if_eq0(metamacro_dec(VALUE)) +#define metamacro_if_eq2(VALUE) metamacro_if_eq1(metamacro_dec(VALUE)) +#define metamacro_if_eq3(VALUE) metamacro_if_eq2(metamacro_dec(VALUE)) +#define metamacro_if_eq4(VALUE) metamacro_if_eq3(metamacro_dec(VALUE)) +#define metamacro_if_eq5(VALUE) metamacro_if_eq4(metamacro_dec(VALUE)) +#define metamacro_if_eq6(VALUE) metamacro_if_eq5(metamacro_dec(VALUE)) +#define metamacro_if_eq7(VALUE) metamacro_if_eq6(metamacro_dec(VALUE)) +#define metamacro_if_eq8(VALUE) metamacro_if_eq7(metamacro_dec(VALUE)) +#define metamacro_if_eq9(VALUE) metamacro_if_eq8(metamacro_dec(VALUE)) +#define metamacro_if_eq10(VALUE) metamacro_if_eq9(metamacro_dec(VALUE)) +#define metamacro_if_eq11(VALUE) metamacro_if_eq10(metamacro_dec(VALUE)) +#define metamacro_if_eq12(VALUE) metamacro_if_eq11(metamacro_dec(VALUE)) +#define metamacro_if_eq13(VALUE) metamacro_if_eq12(metamacro_dec(VALUE)) +#define metamacro_if_eq14(VALUE) metamacro_if_eq13(metamacro_dec(VALUE)) +#define metamacro_if_eq15(VALUE) metamacro_if_eq14(metamacro_dec(VALUE)) +#define metamacro_if_eq16(VALUE) metamacro_if_eq15(metamacro_dec(VALUE)) +#define metamacro_if_eq17(VALUE) metamacro_if_eq16(metamacro_dec(VALUE)) +#define metamacro_if_eq18(VALUE) metamacro_if_eq17(metamacro_dec(VALUE)) +#define metamacro_if_eq19(VALUE) metamacro_if_eq18(metamacro_dec(VALUE)) +#define metamacro_if_eq20(VALUE) metamacro_if_eq19(metamacro_dec(VALUE)) + +// metamacro_if_eq_recursive expansions +#define metamacro_if_eq_recursive0(VALUE) \ + metamacro_concat(metamacro_if_eq_recursive0_, VALUE) + +#define metamacro_if_eq_recursive0_0(...) __VA_ARGS__ metamacro_consume_ +#define metamacro_if_eq_recursive0_1(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_2(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_3(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_4(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_5(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_6(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_7(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_8(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_9(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_10(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_11(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_12(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_13(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_14(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_15(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_16(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_17(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_18(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_19(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_20(...) metamacro_expand_ + +#define metamacro_if_eq_recursive1(VALUE) metamacro_if_eq_recursive0(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive2(VALUE) metamacro_if_eq_recursive1(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive3(VALUE) metamacro_if_eq_recursive2(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive4(VALUE) metamacro_if_eq_recursive3(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive5(VALUE) metamacro_if_eq_recursive4(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive6(VALUE) metamacro_if_eq_recursive5(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive7(VALUE) metamacro_if_eq_recursive6(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive8(VALUE) metamacro_if_eq_recursive7(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive9(VALUE) metamacro_if_eq_recursive8(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive10(VALUE) metamacro_if_eq_recursive9(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive11(VALUE) metamacro_if_eq_recursive10(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive12(VALUE) metamacro_if_eq_recursive11(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive13(VALUE) metamacro_if_eq_recursive12(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive14(VALUE) metamacro_if_eq_recursive13(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive15(VALUE) metamacro_if_eq_recursive14(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive16(VALUE) metamacro_if_eq_recursive15(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive17(VALUE) metamacro_if_eq_recursive16(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive18(VALUE) metamacro_if_eq_recursive17(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive19(VALUE) metamacro_if_eq_recursive18(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive20(VALUE) metamacro_if_eq_recursive19(metamacro_dec(VALUE)) + +// metamacro_take expansions +#define metamacro_take0(...) +#define metamacro_take1(...) metamacro_head(__VA_ARGS__) +#define metamacro_take2(...) metamacro_head(__VA_ARGS__), metamacro_take1(metamacro_tail(__VA_ARGS__)) +#define metamacro_take3(...) metamacro_head(__VA_ARGS__), metamacro_take2(metamacro_tail(__VA_ARGS__)) +#define metamacro_take4(...) metamacro_head(__VA_ARGS__), metamacro_take3(metamacro_tail(__VA_ARGS__)) +#define metamacro_take5(...) metamacro_head(__VA_ARGS__), metamacro_take4(metamacro_tail(__VA_ARGS__)) +#define metamacro_take6(...) metamacro_head(__VA_ARGS__), metamacro_take5(metamacro_tail(__VA_ARGS__)) +#define metamacro_take7(...) metamacro_head(__VA_ARGS__), metamacro_take6(metamacro_tail(__VA_ARGS__)) +#define metamacro_take8(...) metamacro_head(__VA_ARGS__), metamacro_take7(metamacro_tail(__VA_ARGS__)) +#define metamacro_take9(...) metamacro_head(__VA_ARGS__), metamacro_take8(metamacro_tail(__VA_ARGS__)) +#define metamacro_take10(...) metamacro_head(__VA_ARGS__), metamacro_take9(metamacro_tail(__VA_ARGS__)) +#define metamacro_take11(...) metamacro_head(__VA_ARGS__), metamacro_take10(metamacro_tail(__VA_ARGS__)) +#define metamacro_take12(...) metamacro_head(__VA_ARGS__), metamacro_take11(metamacro_tail(__VA_ARGS__)) +#define metamacro_take13(...) metamacro_head(__VA_ARGS__), metamacro_take12(metamacro_tail(__VA_ARGS__)) +#define metamacro_take14(...) metamacro_head(__VA_ARGS__), metamacro_take13(metamacro_tail(__VA_ARGS__)) +#define metamacro_take15(...) metamacro_head(__VA_ARGS__), metamacro_take14(metamacro_tail(__VA_ARGS__)) +#define metamacro_take16(...) metamacro_head(__VA_ARGS__), metamacro_take15(metamacro_tail(__VA_ARGS__)) +#define metamacro_take17(...) metamacro_head(__VA_ARGS__), metamacro_take16(metamacro_tail(__VA_ARGS__)) +#define metamacro_take18(...) metamacro_head(__VA_ARGS__), metamacro_take17(metamacro_tail(__VA_ARGS__)) +#define metamacro_take19(...) metamacro_head(__VA_ARGS__), metamacro_take18(metamacro_tail(__VA_ARGS__)) +#define metamacro_take20(...) metamacro_head(__VA_ARGS__), metamacro_take19(metamacro_tail(__VA_ARGS__)) + +// metamacro_drop expansions +#define metamacro_drop0(...) __VA_ARGS__ +#define metamacro_drop1(...) metamacro_tail(__VA_ARGS__) +#define metamacro_drop2(...) metamacro_drop1(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop3(...) metamacro_drop2(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop4(...) metamacro_drop3(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop5(...) metamacro_drop4(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop6(...) metamacro_drop5(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop7(...) metamacro_drop6(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop8(...) metamacro_drop7(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop9(...) metamacro_drop8(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop10(...) metamacro_drop9(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop11(...) metamacro_drop10(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop12(...) metamacro_drop11(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop13(...) metamacro_drop12(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop14(...) metamacro_drop13(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop15(...) metamacro_drop14(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop16(...) metamacro_drop15(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop17(...) metamacro_drop16(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop18(...) metamacro_drop17(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop19(...) metamacro_drop18(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop20(...) metamacro_drop19(metamacro_tail(__VA_ARGS__)) + +#endif diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Modules/module.modulemap b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..9f957de --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module ReactiveCocoa { + umbrella header "ReactiveCocoa.h" + + export * + module * { export * } +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ReactiveCocoa b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ReactiveCocoa new file mode 100755 index 0000000..d7c140d Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ReactiveCocoa differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Resources/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..4060f0a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,47 @@ + + + + + BuildMachineOSBuild + 14C1514 + CFBundleDevelopmentRegion + en + CFBundleExecutable + ReactiveCocoa + CFBundleIdentifier + org.reactivecocoa.ReactiveCocoa + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ReactiveCocoa + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6C131e + DTPlatformVersion + GM + DTSDKBuild + 14A383 + DTSDKName + macosx10.10 + DTXcode + 0620 + DTXcodeBuild + 6C131e + NSHumanReadableCopyright + Copyright © 2014 GitHub. All rights reserved. + UIDeviceFamily + + 1 + 2 + + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/Info.plist new file mode 100644 index 0000000..2e95b44 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/Info.plist @@ -0,0 +1,30 @@ + + + + + BuildMachineOSBuild + 14B25 + CFBundleDisplayName + Electron Helper EH + CFBundleExecutable + Electron Helper EH + CFBundleIdentifier + com.github.electron.helper.EH + CFBundleName + Electron Helper EH + CFBundlePackageType + APPL + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0640 + DTXcodeBuild + 6E35b + LSUIElement + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/MacOS/Sensitive Helper EH b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/MacOS/Sensitive Helper EH new file mode 100755 index 0000000..cbe94f9 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/MacOS/Sensitive Helper EH differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/PkgInfo b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper EH.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/Info.plist new file mode 100644 index 0000000..7423b4d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/Info.plist @@ -0,0 +1,30 @@ + + + + + BuildMachineOSBuild + 14B25 + CFBundleDisplayName + Electron Helper NP + CFBundleExecutable + Electron Helper NP + CFBundleIdentifier + com.github.electron.helper.NP + CFBundleName + Electron Helper NP + CFBundlePackageType + APPL + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0640 + DTXcodeBuild + 6E35b + LSUIElement + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/MacOS/Sensitive Helper NP b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/MacOS/Sensitive Helper NP new file mode 100755 index 0000000..4aec5d0 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/MacOS/Sensitive Helper NP differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/PkgInfo b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper NP.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/Info.plist new file mode 100644 index 0000000..839e314 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/Info.plist @@ -0,0 +1,26 @@ + + + + + BuildMachineOSBuild + 14B25 + CFBundleIdentifier + com.electron.sensitive.helper + CFBundleName + Sensitive + CFBundlePackageType + APPL + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0640 + DTXcodeBuild + 6E35b + LSUIElement + + NSSupportsAutomaticGraphicsSwitching + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/MacOS/Sensitive Helper b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/MacOS/Sensitive Helper new file mode 100755 index 0000000..cbe94f9 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/MacOS/Sensitive Helper differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/PkgInfo b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Sensitive Helper.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Headers b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Modules b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Resources b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Squirrel b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Squirrel new file mode 120000 index 0000000..af91e72 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Squirrel @@ -0,0 +1 @@ +Versions/Current/Squirrel \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSBundle+SQRLVersionExtensions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSBundle+SQRLVersionExtensions.h new file mode 100644 index 0000000..be7e466 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSBundle+SQRLVersionExtensions.h @@ -0,0 +1,20 @@ +// +// NSBundle+SQRLVersionExtensions.h +// Squirrel +// +// Created by Justin Spahr-Summers on 2013-09-25. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import + +@interface NSBundle (SQRLVersionExtensions) + +// The value associated with the `CFBundleVersion` key in the receiver's +// Info.plist, or nil if the key is not present. +@property (nonatomic, copy, readonly) NSString *sqrl_bundleVersion; + +/// The value of the `kCFBundleExecutableKey` key. +@property (nonatomic, copy, readonly) NSString *sqrl_executableName; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSProcessInfo+SQRLVersionExtensions.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSProcessInfo+SQRLVersionExtensions.h new file mode 100644 index 0000000..7c419c3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSProcessInfo+SQRLVersionExtensions.h @@ -0,0 +1,16 @@ +// +// NSProcessInfo+SQRLVersionExtensions.h +// Squirrel +// +// Created by Justin Spahr-Summers on 2013-09-16. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import + +@interface NSProcessInfo (SQRLVersionExtensions) + +// The short version string (e.g. `10.8.5`) for the running version of OS X. +@property (nonatomic, copy, readonly) NSString *sqrl_operatingSystemShortVersionString; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLDownloadedUpdate.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLDownloadedUpdate.h new file mode 100644 index 0000000..22f86a1 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLDownloadedUpdate.h @@ -0,0 +1,31 @@ +// +// SQRLDownloadedUpdate.h +// Squirrel +// +// Created by Justin Spahr-Summers on 2013-09-25. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import + +@class SQRLUpdate; + +// A SQRLUpdate that has been successfully downloaded to disk. +@interface SQRLDownloadedUpdate : MTLModel + +// The application bundle representing the downloaded and unarchived update. +@property (nonatomic, strong, readonly) NSBundle *bundle; + +// The update information sent by the server. +// +// This may be a `SQRLUpdate` subclass if `SQRLUpdater.updateClass` was changed. +@property (nonatomic, copy, readonly) SQRLUpdate *update; + +// Initializes the receiver with update metadata and the downloaded and +// unarchived bundle. +// +// update - The update information sent by the server. This must not be nil. +// bundle - The application bundle representing the update. This must not be nil. +- (id)initWithUpdate:(SQRLUpdate *)update bundle:(NSBundle *)bundle; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdate.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdate.h new file mode 100644 index 0000000..9e98f0e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdate.h @@ -0,0 +1,31 @@ +// +// SQRLUpdate.h +// Squirrel +// +// Created by Keith Duncan on 18/09/2013. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import +#import + +// An update parsed from a response to the `SQRLUpdater.updateRequest`. +// +// This can be subclassed, and `SQRLUpdater.updateClass` set, to preserve +// additional JSON data. Any subclasses must be immutable, and should inherit +// their superclass' property key and transformer behaviors. +@interface SQRLUpdate : MTLModel + +// The release notes for the update. +@property (readonly, copy, nonatomic) NSString *releaseNotes; + +// The release name for the update. +@property (readonly, copy, nonatomic) NSString *releaseName; + +// The release date for the update. +@property (readonly, copy, nonatomic) NSDate *releaseDate; + +// The URL to the update package that should be downloaded for installation. +@property (readonly, copy, nonatomic) NSURL *updateURL; + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdater.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdater.h new file mode 100644 index 0000000..4917f41 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdater.h @@ -0,0 +1,145 @@ +// +// SQRLUpdater.h +// Squirrel +// +// Created by Justin Spahr-Summers on 2013-07-21. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import +#import + +// Represents the current state of the updater. +// +// SQRLUpdaterStateIdle - Doing absolutely diddly squat. +// SQRLUpdaterStateCheckingForUpdate - Checking for any updates from the server. +// SQRLUpdaterStateDownloadingUpdate - Update found, downloading the archive. +// SQRLUpdaterStateAwaitingRelaunch - Awaiting a relaunch to install +// the update. +typedef enum : NSUInteger { + SQRLUpdaterStateIdle, + SQRLUpdaterStateCheckingForUpdate, + SQRLUpdaterStateDownloadingUpdate, + SQRLUpdaterStateAwaitingRelaunch, +} SQRLUpdaterState; + +// The domain for errors originating within SQRLUpdater. +extern NSString * const SQRLUpdaterErrorDomain; + +// The downloaded update does not contain an app bundle, or it was deleted on +// disk before we could get to it. +extern const NSInteger SQRLUpdaterErrorMissingUpdateBundle; + +// An error occurred in the out-of-process updater while it was setting up. +extern const NSInteger SQRLUpdaterErrorPreparingUpdateJob; + +// The code signing requirement for the running application could not be +// retrieved. +extern const NSInteger SQRLUpdaterErrorRetrievingCodeSigningRequirement; + +// The server sent a response that we didn't understand. +// +// Includes `SQRLUpdaterServerDataErrorKey` in the error's `userInfo`. +extern const NSInteger SQRLUpdaterErrorInvalidServerResponse; + +// The server sent a response body that we didn't understand. +// +// Includes `SQRLUpdaterServerDataErrorKey` in the error's `userInfo`. +extern const NSInteger SQRLUpdaterErrorInvalidServerBody; + +// The server sent update JSON that we didn't understand. +// +// Includes `SQRLUpdaterJSONObjectErrorKey` in the error's `userInfo`. +extern const NSInteger SQRLUpdaterErrorInvalidJSON; + +// Associated with the `NSData` received from the server when an error with code +// `SQRLUpdaterErrorInvalidServerResponse` is generated. +extern NSString * const SQRLUpdaterServerDataErrorKey; + +// Associated with the JSON object that was received from the server when an +// error with code `SQRLUpdaterErrorInvalidJSON` is generated. +extern NSString * const SQRLUpdaterJSONObjectErrorKey; + +@class RACCommand; +@class RACDisposable; +@class RACSignal; + +// Checks for, downloads, and installs updates. +@interface SQRLUpdater : NSObject + +// Kicks off a check for updates. +// +// If an update is available, it will be sent on `updates` once downloaded. +@property (nonatomic, strong, readonly) RACCommand *checkForUpdatesCommand; + +// The current state of the manager. +// +// This property is KVO-compliant. +@property (atomic, readonly) SQRLUpdaterState state; + +// Sends an `SQRLDownloadedUpdate` object on the main thread whenever a new +// update is available. +// +// This signal is actually just `checkForUpdatesCommand.executionSignals`, +// flattened for convenience. +@property (nonatomic, strong, readonly) RACSignal *updates; + +// The request that will be sent to check for updates. +// +// The default value is the argument that was originally passed to +// -initWithUpdateRequest:. +// +// This property must never be set to nil. +@property (atomic, copy) NSURLRequest *updateRequest; + +// The `SQRLUpdate` subclass to instantiate with the server's response. +// +// By default, this is `SQRLUpdate` itself, but it can be set to a custom +// subclass in order to preserve additional JSON data. See the `SQRLUpdate` +// documentation for more information. +@property (atomic, strong) Class updateClass; + +// Initializes an updater that will send the given request to check for updates. +// +// This is the designated initializer for this class. +// +// updateRequest - A request to send to check for updates. This request can be +// customized as desired, like by including an `Authorization` +// header to authenticate with a private update server, or +// pointing to a local URL for testing. This must not be nil. +// +// Returns the initialized `SQRLUpdater`. +- (id)initWithUpdateRequest:(NSURLRequest *)updateRequest; + +// Executes `checkForUpdatesCommand` (if enabled) every `interval` seconds. +// +// The first check will not occur until `interval` seconds have passed. +// +// interval - The interval, in seconds, between each check. +// +// Returns a disposable which can be used to cancel the automatic update +// checking. +- (RACDisposable *)startAutomaticChecksWithInterval:(NSTimeInterval)interval; + +// Terminates the running application to install any available update, then +// automatically relaunches the app after updating. +// +// This method is only useful if you want the application to automatically +// relaunch. Otherwise, you can simply use `-[NSApplication terminate:]` or any +// other exit mechanism. +// +// After invoking this method, the receiver is responsible for terminating the +// application upon success. The app must not be terminated in any other way +// unless an error occurs. +// +// Returns a signal that will error on the main scheduler if anything goes +// wrong before termination. The signal will never complete. +- (RACSignal *)relaunchToInstallUpdate; + +@end + +@interface SQRLUpdater (Unavailable) + +- (id)init __attribute__((unavailable("Use -initWithUpdateRequest: instead"))); + +@end diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/Squirrel.h b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/Squirrel.h new file mode 100644 index 0000000..23dc330 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/Squirrel.h @@ -0,0 +1,21 @@ +// +// Squirrel.h +// Squirrel +// +// Created by Justin Spahr-Summers on 2013-07-21. +// Copyright (c) 2013 GitHub. All rights reserved. +// + +#import + +//! Project version number for Squirrel. +FOUNDATION_EXPORT double SquirrelVersionNumber; + +//! Project version string for Squirrel. +FOUNDATION_EXPORT const unsigned char SquirrelVersionString[]; + +#import +#import +#import +#import +#import diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Modules/module.modulemap b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..b31af5f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Squirrel { + umbrella header "Squirrel.h" + + export * + module * { export * } +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..e102637 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,42 @@ + + + + + BuildMachineOSBuild + 14F27 + CFBundleDevelopmentRegion + English + CFBundleExecutable + Squirrel + CFBundleIdentifier + com.github.Squirrel + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Squirrel + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6E35b + DTPlatformVersion + GM + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0640 + DTXcodeBuild + 6E35b + NSHumanReadableCopyright + Copyright © 2013 GitHub. All rights reserved. + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt new file mode 100755 index 0000000..b74f760 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel new file mode 100755 index 0000000..957242d Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/Current b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Frameworks/Squirrel.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Info.plist b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Info.plist new file mode 100644 index 0000000..326303e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Info.plist @@ -0,0 +1,48 @@ + + + + + BuildMachineOSBuild + 14B25 + CFBundleDisplayName + Sensitive + CFBundleExecutable + Electron + CFBundleIconFile + atom.icns + CFBundleIdentifier + com.electron.sensitive + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Sensitive + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.36.7 + CFBundleVersion + 0.36.7 + DTSDKBuild + 14D125 + DTSDKName + macosx10.10 + DTXcode + 0640 + DTXcodeBuild + 6E35b + LSApplicationCategoryType + public.app-category.developer-tools + LSMinimumSystemVersion + 10.9.0 + NSHighResolutionCapable + + NSMainNibFile + MainMenu + NSPrincipalClass + AtomApplication + NSSupportsAutomaticGraphicsSwitching + + CFBundleURLTypes + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/MacOS/Electron b/release/Sensitive-darwin-x64/Sensitive.app/Contents/MacOS/Electron new file mode 100755 index 0000000..dda96a4 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/MacOS/Electron differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/PkgInfo b/release/Sensitive-darwin-x64/Sensitive.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.gitignore b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/.name b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/.name new file mode 100644 index 0000000..fa84bb9 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/.name @@ -0,0 +1 @@ +electron-quick-start \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/compiler.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/compiler.xml new file mode 100644 index 0000000..9a8b7e5 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/copyright/profiles_settings.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/electron-quick-start.iml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/electron-quick-start.iml new file mode 100644 index 0000000..3fdae98 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/electron-quick-start.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/encodings.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/encodings.xml new file mode 100644 index 0000000..245608a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/encodings.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/jsLibraryMappings.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..43d6594 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/lessc/lessc.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/lessc/lessc.xml new file mode 100644 index 0000000..12edae6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/lessc/lessc.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/libraries/electron_quick_start_node_modules.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/libraries/electron_quick_start_node_modules.xml new file mode 100644 index 0000000..bacab35 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/libraries/electron_quick_start_node_modules.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/misc.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/misc.xml new file mode 100644 index 0000000..3833155 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/misc.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + 1.8 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/modules.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/modules.xml new file mode 100644 index 0000000..83d62f2 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/scopes/scope_settings.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/uiDesigner.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/vcs.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/workspace.xml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/workspace.xml new file mode 100644 index 0000000..3fb4f4f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/.idea/workspace.xml @@ -0,0 +1,1129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1455010573633 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + 1.8 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/LICENSE b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/LICENSE @@ -0,0 +1,201 @@ + 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 {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/LICENSE.md b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/LICENSE.md new file mode 100644 index 0000000..b823bcc --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/LICENSE.md @@ -0,0 +1,39 @@ +CC0 1.0 Universal +================== + +Statement of Purpose +--------------------- + +The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. +-------------------------------- +A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: + +i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; +ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; +iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; +v. rights protecting the extraction, dissemination, use and reuse of data in a Work; +vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and +vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. + +2. Waiver. +----------- +To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. +---------------------------- +Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. + +4. Limitations and Disclaimers. +-------------------------------- + +a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. +b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. +c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. +d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/README.md b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/README.md new file mode 100644 index 0000000..d03686b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/README.md @@ -0,0 +1,2 @@ +# sensitive +A native version of the kibana sense plugin diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/main.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/main.js new file mode 100644 index 0000000..a533fcb --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/main.js @@ -0,0 +1,60 @@ +'use strict'; + +const path = require('path'); +const electron = require('electron'); +// Module to control application life. +const app = electron.app; +// Module to create native browser window. +const BrowserWindow = electron.BrowserWindow; + +// Keep a global reference of the window object, if you don't, the window will +// be closed automatically when the JavaScript object is garbage collected. +let mainWindow; + +function createWindow () { + + setTimeout(function() { + + app.dock.setIcon(electron.nativeImage.createFromPath(path.resolve('./sense/installedPlugins/sense/public/logo128.png'))); + + // Create the browser window. + mainWindow = new BrowserWindow({ + width: 1300, + height: 800 + }); + + // and load the index.html of the app. + mainWindow.loadURL('file://' + __dirname + '/sense/index.html'); + + // Open the DevTools. + //mainWindow.webContents.openDevTools(); + + // Emitted when the window is closed. + mainWindow.on('closed', function() { + // Dereference the window object, usually you would store windows + // in an array if your app supports multi windows, this is the time + // when you should delete the corresponding element. + mainWindow = null; + }); + + }, 0); +} + +// This method will be called when Electron has finished +// initialization and is ready to create browser windows. +app.on('ready', createWindow); + +// Quit when all windows are closed. +app.on('window-all-closed', function () { + // On OS X it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + app.quit(); +}); + +app.on('activate', function () { + // On OS X it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (mainWindow === null) { + createWindow(); + } +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/package.json b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/package.json new file mode 100644 index 0000000..1fecee1 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/package.json @@ -0,0 +1,25 @@ +{ + "name": "Sensitive", + "version": "0.1.0", + "description": "A native version of the kibana sense plugin", + "main": "main.js", + "scripts": { + "start": "electron main.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/gillyb/sensitive" + }, + "keywords": [ + "kibana", + "elasticsearch", + "sense", + "Electron" + ], + "author": "Gilly Barr", + "license": "Apache 2.0", + "homepage": "https://github.com/gillyb/sensitive", + "devDependencies": { + "electron-prebuilt": "^0.36.0" + } +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/LICENSE.txt b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/LICENSE.txt new file mode 100644 index 0000000..6b5dcb7 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/LICENSE.txt @@ -0,0 +1,8 @@ + +Copyright 2012–2014 Elasticsearch BV + +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. diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/README.txt b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/README.txt new file mode 100644 index 0000000..c569973 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/README.txt @@ -0,0 +1,64 @@ + + +Kibana 4.4.0 +============ + +Build Status + +Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elasticsearch. + + +Requirements +============ + Elasticsearch version 2.2.0 or later + Kibana binary package + + +Installation +============ + Download: http://www.elastic.co/downloads/kibana + Extract the files + Run bin/kibana on unix, or bin\kibana.bat on Windows. + Visit http://localhost:5601 + + +Upgrade from previous version +============================= + Move any custom configurations in your old kibana.yml to your new one + Reinstall plugins + Start or restart Kibana + + +Quick Start +=========== + +You're up and running! Fantastic! Kibana is now running on port 5601, so point your browser at http://YOURDOMAIN.com:5601. + +The first screen you arrive at will ask you to configure an index pattern. An index pattern describes to Kibana how to access your data. We make the guess that you're working with log data, and we hope (because it's awesome) that you're working with Logstash. By default, we fill in logstash-* as your index pattern, thus the only thing you need to do is select which field contains the timestamp you'd like to use. Kibana reads your Elasticsearch mapping to find your time fields - select one from the list and hit Create. + +Congratulations, you have an index pattern! You should now be looking at a paginated list of the fields in your index or indices, as well as some informative data about them. Kibana has automatically set this new index pattern as your default index pattern. If you'd like to know more about index patterns, pop into to the Settings section of the documentation. + +Did you know: Both indices and indexes are acceptable plural forms of the word index. Knowledge is power. + +Now that you've configured an index pattern, you're ready to hop over to the Discover screen and try out a few searches. Click on Discover in the navigation bar at the top of the screen. + + +Documentation +============= + +Visit Elastic.co for the full Kibana documentation. + + +Snapshot Builds +=============== + +For the daring, snapshot builds are available. These builds are created after each commit to the master branch, and therefore are not something you should run in production. + +platform + +OSX tar zip +Linux x64 tar zip +Linux x86 tar zip +Windows tar zip + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/config/kibana.yml b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/config/kibana.yml new file mode 100644 index 0000000..5ad6fa2 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/config/kibana.yml @@ -0,0 +1,79 @@ +# Kibana is served by a back end server. This controls which port to use. +# server.port: 5601 + +# The host to bind the server to. +# server.host: "0.0.0.0" + +# If you are running kibana behind a proxy, and want to mount it at a path, +# specify that path here. The basePath can't end in a slash. +# server.basePath: "" + +# The maximum payload size in bytes on incoming server requests. +# server.maxPayloadBytes: 1048576 + +# The Elasticsearch instance to use for all your queries. +# elasticsearch.url: "http://localhost:9200" + +# preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, +# then the host you use to connect to *this* Kibana instance will be sent. +# elasticsearch.preserveHost: true + +# Kibana uses an index in Elasticsearch to store saved searches, visualizations +# and dashboards. It will create a new index if it doesn't already exist. +# kibana.index: ".kibana" + +# The default application to load. +# kibana.defaultAppId: "discover" + +# If your Elasticsearch is protected with basic auth, these are the user credentials +# used by the Kibana server to perform maintenance on the kibana_index at startup. Your Kibana +# users will still need to authenticate with Elasticsearch (which is proxied through +# the Kibana server) +# elasticsearch.username: "user" +# elasticsearch.password: "pass" + +# SSL for outgoing requests from the Kibana Server to the browser (PEM formatted) +# server.ssl.cert: /path/to/your/server.crt +# server.ssl.key: /path/to/your/server.key + +# Optional setting to validate that your Elasticsearch backend uses the same key files (PEM formatted) +# elasticsearch.ssl.cert: /path/to/your/client.crt +# elasticsearch.ssl.key: /path/to/your/client.key + +# If you need to provide a CA certificate for your Elasticsearch instance, put +# the path of the pem file here. +# elasticsearch.ssl.ca: /path/to/your/CA.pem + +# Set to false to have a complete disregard for the validity of the SSL +# certificate. +# elasticsearch.ssl.verify: true + +# Time in milliseconds to wait for elasticsearch to respond to pings, defaults to +# request_timeout setting +# elasticsearch.pingTimeout: 1500 + +# Time in milliseconds to wait for responses from the back end or elasticsearch. +# This must be > 0 +# elasticsearch.requestTimeout: 300000 + +# Time in milliseconds for Elasticsearch to wait for responses from shards. +# Set to 0 to disable. +# elasticsearch.shardTimeout: 0 + +# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying +# elasticsearch.startupTimeout: 5000 + +# Set the path to where you would like the process id file to be created. +# pid.file: /var/run/kibana.pid + +# If you would like to send the log output to a file you can set the path below. +# logging.dest: stdout + +# Set this to true to suppress all logging output. +# logging.silent: false + +# Set this to true to suppress all logging output except for error messages. +# logging.quiet: false + +# Set this to true to log all events, including system usage information and all requests. +# logging.verbose: false diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/index.html b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/index.html new file mode 100644 index 0000000..1b3e760 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/index.html @@ -0,0 +1,63 @@ +Kibana

Kibana is loading. Give me a moment here. I'm loading a whole bunch of code. Don't worry, all this good stuff will be cached up for next time! +

\ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/LICENSE.md b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/LICENSE.md new file mode 100644 index 0000000..71dbe81 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2012–2014 Elasticsearch BV + +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. diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/README.md b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/README.md new file mode 100644 index 0000000..f3d2e9d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/README.md @@ -0,0 +1,92 @@ +Sense +===== + +A JSON aware developer's interface to Elasticsearch. Comes with handy machinery such as syntax highlighting, API suggestions, +formatting and code folding. + +Installation +----- + +Sense is a Kibana app. To get up and running you will first need to download Kibana and install as instructed [here](https://www.elastic.co/downloads/kibana). +Once Kibana is installed, you can simply install Sense running the following command from your Kibana folder: + +``` +$ ./bin/kibana plugin --install elastic/sense +``` + +Now start your Kibana server by running: + +``` +$ ./bin/kibana +``` + +Sense should be available on `localhost:5601/app/sense` (assuming Kibana defaults). + +For more information and advanced setting please see the [documentation](https://www.elastic.co/guide/en/sense/current/installing.html). + + +Screenshots +----- + + +### Handy API suggestions + +Sense offers handy contextual suggestion to the Elasticsearch API. + + + +### Format validation + +Sometimes it is hard to find that little missing comma. Sense automatically highlights and explains invalid input. + + + +### Scope collapsing + +Working on a big JSON query can be distracting. Using the mouse or via a handy keyboard shortcut (Ctrl/Cmd+Option+0) +, Sense allows you to focus on a sub section and fold others away. + + + +### Auto formatting + +Type your commands however you want and let Sense format them for you. + + + +### Submit multiple requests at once + +When testing or trying things out you frequently need to repeat the same sequence of commands. +Just write them all in Sense, select and submit multiple requests to Elasticsearch. + + + +### Copy and Paste cURL commands + +Once done, you can copy one or more requests as cURL commands (and of course paste them back) + + + +Results in: + +``` +# Delete all data in the `website` index +curl -XDELETE "http://localhost:9200/website" + +# Create a document with ID 123 +curl -XPUT "http://localhost:9200/website/blog/123" -d' +{ + "title": "My first blog entry", + "text": "Just trying this out...", + "date": "2014/01/01" +}' +``` + + + +Documentation +-------- + +Visit [elastic.co](https://www.elastic.co/guide/en/sense/current/index.html) for the full documentation. + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/api.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/api.js new file mode 100644 index 0000000..7b1f4f2 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/api.js @@ -0,0 +1,45 @@ +const _ = require("lodash"); + +'use strict'; + +/** + * + * @param name + */ +function Api(name) { + this.globalRules = {}; + this.endpoints = {}; + this.name = name; +} + +(function (cls) { + cls.addGlobalAutocompleteRules = function (parentNode, rules) { + this.globalRules[parentNode] = rules; + }; + + cls.addEndpointDescription = function (endpoint, description) { + if (this.endpoints[endpoint]) { + throw new Error("endpoint [" + endpoint + "] is already registered"); + } + + var copiedDescription = {}; + _.extend(copiedDescription, description || {}); + _.defaults(copiedDescription, { + id: endpoint, + patterns: [endpoint], + methods: ['GET'] + }); + this.endpoints[endpoint] = copiedDescription; + }; + + cls.asJson = function () { + return { + "name": this.name, + "globals": this.globalRules, + "endpoints": this.endpoints + } + }; + +}(Api.prototype)); + +module.exports = Api; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0.js new file mode 100644 index 0000000..53d9f3e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0.js @@ -0,0 +1,56 @@ +let _ = require("lodash"); +let Api = require('./api'); + +let parts = [ + require('./es_1_0/aliases'), + require('./es_1_0/aggregations'), + require('./es_1_0/cat'), + require('./es_1_0/cluster'), + require('./es_1_0/count'), + require('./es_1_0/document'), + require('./es_1_0/facets'), + require('./es_1_0/filter'), + require('./es_1_0/nodes'), + require('./es_1_0/globals'), + require('./es_1_0/indices'), + require('./es_1_0/mappings'), + require('./es_1_0/percolator'), + require('./es_1_0/query'), + require('./es_1_0/snapshot_restore'), + require('./es_1_0/search'), + require('./es_1_0/settings'), + require('./es_1_0/templates'), + require('./es_1_0/warmers') +]; + +function ES_1_0() { + Api.call(this, "es_1_0"); + _.each(parts, function (apiSection) { + apiSection(this); + }, this); +} + +ES_1_0.prototype = _.create(Api.prototype, {'constructor': ES_1_0}); + +(function (cls) { + cls.addEndpointDescription = function (endpoint, description) { + if (description) { + var url_params_def = {}; + _.each(description.patterns || [], function (p) { + if (p.indexOf("{indices}") >= 0) { + url_params_def["ignore_unavailable"] = "__flag__"; + url_params_def["allow_no_indices"] = "__flag__"; + url_params_def["expand_wildcards"] = ["open", "closed"]; + } + }); + + if (url_params_def) { + description.url_params = description.url_params || {}; + _.defaults(description.url_params, url_params_def); + } + } + Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description); + }; +})(ES_1_0.prototype); + +module.exports = new ES_1_0(); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/aggregations.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/aggregations.js new file mode 100644 index 0000000..cc4a84b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/aggregations.js @@ -0,0 +1,323 @@ +var simple_metric = { + __template: {field: ""}, + field: "{field}", + script: "", + params: {}, + lang: "groovy" +}, field_metric = { + __template: {field: ""}, + field: "{field}" +}; +var rules = { + "*": { + "aggs": { + __template: { + "NAME": { + "AGG_TYPE": {} + } + } + }, + "min": simple_metric, + "max": simple_metric, + "avg": simple_metric, + "stats": simple_metric, + "extended_stats": simple_metric, + "value_count": { + __template: { + "field": "" + }, + "field": "{field}", + "script": "_value", + "script_id": "", + "params": {}, + "lang": "groovy" + }, + "global": {}, + "filter": {}, + "missing": field_metric, + "nested": { + __template: { + "path": "" + }, + "path": "" + }, + "reverse_nested": { + __template: { + "path": "" + }, + "path": "" + }, + "terms": { + __template: { + "field": "", + "size": 10 + }, + "field": "{field}", + "size": 10, + "shard_size": 10, + "order": { + __template: { + "_term": "asc" + }, + "_term": {__one_of: ["asc", "desc"]}, + "_count": {__one_of: ["asc", "desc"]}, + "*": {__one_of: ["asc", "desc"]} + }, + "min_doc_count": 10, + "script": "_value", + "script_id": "", + "params": {}, + "lang": "groovy", + // TODO: these also support regex - extend! + "include": "*", + "exclude": "*", + "execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash", "global_ordinals_low_cardinality"]}, + "show_term_doc_count_error": {__one_of: [true, false]}, + "collect_mode": {__one_of: ["depth_first", "breadth_first"]} + }, + "significant_terms": { + __template: { + "field": "" + }, + "field": "{field}", + "size": 10, + "shard_size": 10, + "shard_min_doc_count": 10, + "min_doc_count": 10, + "include": {__one_of: ["*", {pattern: "", flags: ""}]}, + "exclude": {__one_of: ["*", {pattern: "", flags: ""}]}, + "execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash"]}, + "background_filter": { + __scope_link: "GLOBAL.filter" + }, + "mutual_information": { + "include_negatives": {__one_of: [true, false]} + }, + "chi_square": { + "include_negatives": {__one_of: [true, false]}, + "background_is_superset": {__one_of: [true, false]} + }, + "gnd": { + "background_is_superset": {__one_of: [true, false]} + } + }, + "range": { + __template: { + "field": "", + "ranges": [ + {"from": 50, "to": 100}, + ] + }, + "field": "{field}", + "ranges": [ + {"to": 50, "from": 100, "key": ""} + ], + "keyed": {__one_of: [true, false]}, + "script": "_value", + "script_id": "", + "params": {}, + "lang": "groovy" + }, + "date_range": { + __template: { + "field": "", + "ranges": [ + {"from": "now-10d/d", "to": "now"}, + ] + }, + "field": "{field}", + "format": "MM-yyy", + "ranges": [ + {"to": "", "from": "", "key": ""} + ], + "keyed": {__one_of: [true, false]}, + "script": "_value", + "script_id": "", + "params": {}, + "lang": "groovy" + }, + "ip_range": { + __template: { + "field": "", + "ranges": [ + {"from": "10.0.0.5", "to": "10.0.0.10"}, + ] + }, + "field": "{field}", + "format": "MM-yyy", + "ranges": [ + {"to": "", "from": "", "key": "", "mask": "10.0.0.127/25"} + ], + "keyed": {__one_of: [true, false]}, + "script": "_value", + "script_id": "", + "params": {}, + "lang": "groovy" + }, + "histogram": { + __template: { + "field": "price", + "interval": 50 + }, + "field": "{field}", + "interval": 50, + "min_doc_count": 0, + "order": { + __template: { + "_key": "asc" + }, + "_key": {__one_of: ["asc", "desc"]}, + "_count": {__one_of: ["asc", "desc"]}, + "*": {__one_of: ["asc", "desc"]} + }, + "keyed": {__one_of: [true, false]} + + }, + "date_histogram": { + __template: { + "field": "date", + "interval": "month" + }, + "field": "{field}", + "interval": {__one_of: ["year", "quarter", "week", "day", "hour", "minute", "second"]}, + "min_doc_count": 0, + "order": { + __template: { + "_key": "asc" + }, + "_key": {__one_of: ["asc", "desc"]}, + "_count": {__one_of: ["asc", "desc"]}, + "*": {__one_of: ["asc", "desc"]} + }, + "keyed": {__one_of: [true, false]}, + "pre_zone": "-01:00", + "post_zone": "-01:00", + "pre_zone_adjust_large_interval": {__one_of: [true, false]}, + "factor": 1000, + "pre_offset": "1d", + "post_offset": "1d", + "format": "yyyy-MM-dd", + "time_zone": "00:00" + }, + "geo_distance": { + __template: { + "field": "location", + "origin": {"lat": 52.3760, "lon": 4.894}, + "ranges": [ + {"from": 100, "to": 300}, + ] + }, + "field": "{field}", + "origin": {"lat": 0.0, "lon": 0.0}, + "unit": {__one_of: ["mi", "km", "in", "yd", "m", "cm", "mm"]}, + "ranges": [ + {"from": 50, "to": 100} + ], + "distance_type": {__one_of: ["arc", "sloppy_arc", "plane"]} + + }, + "geohash_grid": { + __template: { + "field": "", + "precision": 3 + }, + "field": "{field}", + "precision": {__one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}, + "size": 10, + "shard_size": 10 + }, + "percentiles": { + __template: { + "field": "", + "percents": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0] + }, + "field": "{field}", + "percents": { + __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0], + // mark type as list + __any_of: [] + }, + "script": "_value", + "script_id": "", + "params": {}, + "lang": "groovy", + "compression": 100 + }, + "cardinality": { + __template: { + "field": "" + }, + "precision_threshold": 100, + "rehash": true, + "script": "_value", + "script_id": "", + "params": {}, + "lang": "groovy" + }, + "scripted_metric": { + __template: { + "init_script": "", + "map_script": "", + "combine_script": "", + "reduce_script": "" + }, + "init_script": "", + "map_script": "", + "combine_script": "", + "reduce_script": "", + "lang": "groovy", + "params": {}, + "reduce_params": {}, + "init_script_file": "", + "init_script_id": "", + "map_script_file": "", + "map_script_id": "", + "combine_script_file": "", + "combine_script_id": "", + "reduce_script_file": "", + "reduce_script_id": "" + }, + "geo_bounds": { + __template: { + field: "" + }, + field: "{field}", + wrap_longitude: {__one_of: [true, false]} + }, + "top_hits": { + __template: { + size: 10 + }, + from: 0, + size: 10, + sort: { + __template: [], + __scope_link: "_search.sort" + }, + highlight: {}, + explain: {__one_of: [true, false]}, + _source: { + __template: "", + __scope_link: "_search._source" + }, + script_fields: { + __scope_link: "_search.script_fields" + }, + fielddata_fields: ["{field}"], + version: {__one_of: [true, false]} + }, + "percentile_ranks": { + __template: { + field: "", + values: [10, 15] + }, + field: "{field}", + values: [] + } + } +}; +module.exports = function (api) { + + api.addGlobalAutocompleteRules('aggregations', rules); + api.addGlobalAutocompleteRules('aggs', rules); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/aliases.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/aliases.js new file mode 100644 index 0000000..832a1ed --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/aliases.js @@ -0,0 +1,71 @@ +module.exports = function (api) { + api.addEndpointDescription('_post_aliases', { + methods: ['POST'], + patterns: [ + "_aliases", + ], + data_autocomplete_rules: { + 'actions': { + __template: [ + {'add': {'index': 'test1', 'alias': 'alias1'}} + ], + __any_of: [ + { + add: { + index: '{index}', + alias: '', + filter: {}, + routing: '1', + search_routing: '1,2', + index_routing: '1' + }, + remove: { + index: '', + alias: '' + } + } + ] + } + } + }); + api.addEndpointDescription('_get_aliases', { + methods: ['GET'], + patterns: [ + "_aliases", + ] + }); + + var aliasRules = { + filter: {}, + routing: '1', + search_routing: '1,2', + index_routing: '1' + }; + + api.addEndpointDescription('_post_alias', { + methods: ["POST", "PUT"], + patterns: [ + "{indices}/_alias/{name}" + ], + data_autocomplete_rules: aliasRules + }); + api.addEndpointDescription('_delete_alias', { + methods: ["DELETE"], + patterns: [ + "{indices}/_alias/{name}" + ] + }); + api.addEndpointDescription('_get_alias', { + methods: ["GET"], + patterns: [ + "_alias", + "{indices}/_alias", + "{indices}/_alias/{name}", + "_alias/{name}" + ] + }); + + api.addGlobalAutocompleteRules('aliases', { + '*': aliasRules + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/cat.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/cat.js new file mode 100644 index 0000000..3b36086 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/cat.js @@ -0,0 +1,41 @@ +let _ = require("lodash"); + +function addSimpleCat(endpoint, api, params, patterns) { + var url_params = {"help": "__flag__", "v": "__flag__", "bytes": ["b"]}; + _.each(params || [], function (p) { + if (_.isString(p)) { + url_params[p] = "__flag__"; + } + else { + var k = Object.keys(p)[0]; + url_params[k] = p[k]; + } + }); + api.addEndpointDescription(endpoint, { + match: endpoint, + url_params: url_params, + patterns: patterns || [endpoint] + }); +} + +module.exports = function (api) { + addSimpleCat('_cat/aliases', api); + addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']); + addSimpleCat('_cat/count', api); + addSimpleCat('_cat/health', api, [ + {"ts": ["false", "true"]} + ]); + addSimpleCat('_cat/indices', api, [ + {h: []}, + "pri", + ], + ['_cat/indices', '_cat/indices/{indices}']); + addSimpleCat('_cat/master', api); + addSimpleCat('_cat/nodes', api); + addSimpleCat('_cat/pending_tasks', api); + addSimpleCat('_cat/recovery', api); + addSimpleCat('_cat/thread_pool', api); + addSimpleCat('_cat/shards', api); + addSimpleCat('_cat/plugins', api); + addSimpleCat('_cat/segments', api); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/cluster.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/cluster.js new file mode 100644 index 0000000..9628293 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/cluster.js @@ -0,0 +1,142 @@ +module.exports = function (api) { + api.addEndpointDescription('_cluster/nodes/stats'); + api.addEndpointDescription('_cluster/state', { + patterns: [ + "_cluster/state", + "_cluster/state/{metrics}", + "_cluster/state/{metrics}/{indices}" + ], + url_components: { + "metrics": ["version", "master_node", "nodes", "routing_table", "metadata", "blocks"] + } + }); + api.addEndpointDescription('_cluster/health', { + url_params: { + "local": "__flag__", + "level": ["indices", "shards"], + "master_timeout": "30s", + "timeout": "30s", + "wait_for_status": ["yellow", "green"], + "wait_for_relocating_shards": 0, + "wait_for_active_shards": 0, + "wait_for_nodes": 0 + } + }); + api.addEndpointDescription('_cluster/pending_tasks'); + api.addEndpointDescription('get_cluster/settings', { + patterns: [ + '_cluster/settings' + ] + }); + + api.addEndpointDescription('put_cluster/settings', { + methods: ['PUT'], + patterns: [ + '_cluster/settings' + ], + data_autocomplete_rules: { + persistent: { + cluster: { + routing: { + 'allocation.enable': {__one_of: ["all", "primaries", "new_primaries", "none"]}, + 'allocation.disk.threshold_enabled': {__one_of: [false, true]}, + 'allocation.disk.watermark.low': '85%', + 'allocation.disk.watermark.high': '90%', + 'allocation.disk.include_relocations': {__one_of: [true, false]}, + 'allocation.disk.reroute_interval': '60s', + 'allocation.exclude': { + '_ip': "", + '_name': "", + '_host': "", + '_id': "" + }, + 'allocation.include': { + '_ip': "", + '_name': "", + '_host': "", + '_id': "" + }, + 'allocation.require': { + '_ip': "", + '_name': "", + '_host': "", + '_id': "" + }, + 'allocation.awareness.attributes': [], + 'allocation.awareness.force': { + '*': { + 'values': [] + } + }, + 'allocation.allow_rebalance': {__one_of: ['always', 'indices_primaries_active', 'indices_all_active']}, + 'allocation.cluster_concurrent_rebalance': 2, + 'allocation.node_initial_primaries_recoveries': 4, + 'allocation.node_concurrent_recoveries': 2, + 'allocation.same_shard.host': {__one_of: [false, true]} + } + }, + indices: { + breaker: { + "total.limit": "70%", + "fielddata.limit": "60%", + "fielddata.overhead": 1.03, + "request.limit": "40%", + "request.overhead": 1.0 + } + } + }, + transient: { + __scope_link: '.persistent' + } + } + }); + + api.addEndpointDescription('_cluster/reroute', { + methods: ['POST'], + url_params: { + explain: "__flag__", + dry_run: "__flag__" + }, + data_autocomplete_rules: { + commands: [ + { + move: { + __template: { + index: "", + shard: 0, + from_node: "", + to_node: "" + }, + index: "{index}", + shard: 0, + from_node: "{node}", + to_node: "{node}" + }, + cancel: { + __template: { + index: "", + shard: 0, + node: "" + }, + index: "{index}", + shard: 0, + node: "{node}", + allow_primary: {__one_of: [true, false]} + }, + allocate: { + __template: { + index: "", + shard: 0, + node: "" + }, + index: "{index}", + shard: 0, + node: "{node}", + allow_primary: {__one_of: [true, false]} + } + } + ], + dry_run: {__one_of: [true, false]} + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/count.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/count.js new file mode 100644 index 0000000..fe2c453 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/count.js @@ -0,0 +1,22 @@ +module.exports = function (api) { + api.addEndpointDescription('_count', { + methods: ['GET', 'POST'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/{types}/_count", + "{indices}/_count", + "_count" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + min_score: 1.0, + terminate_after: 10, + }, + data_autocomplete_rules: { + query: { + // populated by a global rule + }, + } + }) +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/document.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/document.js new file mode 100644 index 0000000..f553763 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/document.js @@ -0,0 +1,221 @@ +module.exports = function (api) { + api.addEndpointDescription('_get_doc', { + methods: ['GET'], + patterns: [ + "{index}/{type}/{id}" + ], + url_params: { + "version": 1, + "routing": "", + "parent": "", + "_source": "", + "_source_exclude": "", + "_source_include": "" + } + }); + api.addEndpointDescription('_get_doc_source', { + methods: ['GET'], + patterns: [ + "{index}/{type}/{id}/_source" + ], + url_params: { + "version": 1, + "routing": "", + "parent": "", + "_source_exclude": "", + "_source_include": "" + } + }); + api.addEndpointDescription('_delete_doc', { + methods: ['DELETE'], + patterns: [ + "{index}/{type}/{id}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "routing": "", + "parent": "" + } + }); + api.addEndpointDescription('index_doc', { + methods: ['PUT', 'POST'], + patterns: [ + "{index}/{type}/{id}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "op_type": ["create"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "replication": ["sync", "async"], + "refresh": "__flag__", + "timeout": "1m" + } + }); + api.addEndpointDescription('create_doc', { + methods: ['PUT', 'POST'], + patterns: [ + "{index}/{type}/{id}/_create" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "replication": ["sync", "async"], + "refresh": "__flag__", + "timeout": "1m" + } + }); + api.addEndpointDescription('index_doc_no_id', { + methods: ['POST'], + patterns: [ + "{index}/{type}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "replication": ["sync", "async"], + "refresh": "__flag__", + "timeout": "1m" + } + }); + + api.addEndpointDescription('_update', { + methods: ['POST'], + patterns: [ + "{index}/{type}/{id}/_update" + ], + url_params: { + "version": 1, + "version_type": ["force", "internal"], + "routing": "", + "parent": "", + "timestamp": "", + "consistency": ["qurom", "one", "all"], + "replication": ["sync", "async"], + "refresh": "__flag__", + "timeout": "1m", + "retry_on_conflict": 3, + "fields": "" + }, + data_autocomplete_rules: { + "script": "", + "script_id": "", + "lang": "groovy", + "params": {}, + "doc": {}, + "upsert": {}, + "scripted_upsert": {__one_of: [true, false]} + } + + }); + + api.addEndpointDescription('_put_script', { + methods: ['POST', 'PUT'], + patterns: [ + "_scripts/{lang}/{id}", + "_scripts/{lang}/{id}/_create" + ], + url_components: { + "lang": [ + "groovy", + "expressions" + ] + }, + data_autocomplete_rules: { + "script": "" + } + }); + + api.addEndpointDescription('_termvectors', { + methods: ['GET', 'POST'], + patterns: [ + "{index}/{type}/_termvectors" + ], + priority: 10, // collides with get doc by id + url_params: { + "fields": "", + "offsets": "__flag__", + "payloads": "__flag__", + "positions": "__flag__", + "term_statistics": "__flag__", + "field_statistics": "__flag__", + "routing": "", + "version": 1, + "version_type": ["external", "external_gt", "external_gte", "force", "internal"], + "parent": "", + "preference": "" + }, + data_autocomplete_rules: { + fields: [ + "{field}" + ], + offsets: {__one_of: [false, true]}, + payloads: {__one_of: [false, true]}, + positions: {__one_of: [false, true]}, + term_statistics: {__one_of: [true, false]}, + field_statistics: {__one_of: [false, true]}, + per_field_analyzer: { + __template: {"FIELD": ""}, + "{field}": "" + }, + routing: "", + version: 1, + version_type: ["external", "external_gt", "external_gte", "force", "internal"], + doc: {} + } + }); + + api.addEndpointDescription('_termvectors_id', { + methods: ['GET', 'POST'], + patterns: [ + "{index}/{type}/{id}/_termvectors" + ], + url_params: { + "fields": "", + "offsets": "__flag__", + "payloads": "__flag__", + "positions": "__flag__", + "term_statistics": "__flag__", + "field_statistics": "__flag__", + "routing": "", + "version": 1, + "version_type": ["external", "external_gt", "external_gte", "force", "internal"], + "parent": "", + "preference": "" + }, + data_autocomplete_rules: { + fields: [ + "{field}" + ], + "offsets": {__one_of: [false, true]}, + "payloads": {__one_of: [false, true]}, + "positions": {__one_of: [false, true]}, + "term_statistics": {__one_of: [true, false]}, + "field_statistics": {__one_of: [false, true]}, + "dfs": {__one_of: [true, false]}, + "per_field_analyzer": { + __template: {"FIELD": ""}, + "{field}": "" + }, + "routing": "", + "version": 1, + "version_type": ["external", "external_gt", "external_gte", "force", "internal"] + } + }); + +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/facets.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/facets.js new file mode 100644 index 0000000..f8dc05e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/facets.js @@ -0,0 +1,114 @@ +module.exports = function (api) { + api.addGlobalAutocompleteRules('facets', { + '*': { + terms: { + __template: { + field: 'FIELD', + size: 10 + }, + field: '{field}', + fields: ['{field}'], + size: 10, + script: '', + script_field: '', + order: { + __one_of: ['count', 'term', 'reverse_count', 'reverse_term'] + }, + all_terms: { + __one_of: [false, true] + }, + exclude: ['TERM'], + regex: '', + regex_flags: '' + }, + range: { + __template: { + field: 'FIELD', + ranges: [ + { + 'to': 50 + }, + { + 'from': 20, + 'to': 70 + }, + { + 'from': 70, + 'to': 120 + }, + { + 'from': 150 + } + ] + }, + field: '{field}', + ranges: [ + { + to: 10, + from: 20 + } + ] + }, + histogram: { + __template: { + field: 'FIELD', + interval: 100 + }, + field: '{field}', + interval: 100, + time_interval: '1.5h', + key_field: '{field}', + value_field: '{field}', + key_script: '', + value_script: '', + params: {} + }, + date_histogram: { + __template: { + field: 'FIELD', + 'interval': 'day' + }, + field: '{field}', + interval: { + __one_of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', '1h', '1d', '1w'] + }, + post_zone: -1, + pre_zone: -1, + factor: 1000, + pre_offset: '1d', + post_offset: '1d', + key_field: '{field}', + value_field: '{field}', + value_script: '' + }, + filter: {}, + query: {}, + facet_filter: { + __scope_link: 'GLOBAL.filter' + }, + statistical: { + __template: { + field: 'FIELD' + }, + field: '{field}', + fields: ['{field}'], + script: '' + }, + terms_stats: { + __template: { + key_field: 'FIELD', + value_field: 'FIELD' + }, + key_field: '{field}', + value_field: '{field}', + value_script: '', + size: 10, + order: { + __one_of: ['count', 'term', 'reverse_term', 'reverse_count', 'total', 'reverse_total', + 'min', 'reverse_min', 'max', 'reverse_max', 'mean', 'reverse_mean' + ] + } + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/filter.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/filter.js new file mode 100644 index 0000000..7adb9c9 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/filter.js @@ -0,0 +1,405 @@ +var filters = {}; + +filters.and = { + __template: { + filters: [ + {} + ] + }, + filters: [ + { + __scope_link: '.' + } + ], + _cache: { + __one_of: [false, true] + } +}; + + +filters.bool = { + must: [ + { + __scope_link: '.' + } + ], + must_not: [ + { + __scope_link: '.' + } + ], + should: [ + { + __scope_link: '.' + } + ], + _cache: { + __one_of: [false, true] + } +}; + + +filters.exists = { + __template: { + 'field': 'FIELD_NAME' + }, + 'field': '{field}' +}; + + +filters.ids = { + __template: { + 'values': ['ID'] + }, + 'type': '{type}', + 'values': [''] +}; + + +filters.limit = { + __template: { + value: 100 + }, + value: 100 +}; + + +filters.type = { + __template: { + value: 'TYPE' + }, + value: '{type}' +}; + + +filters.geo_bounding_box = { + __template: { + 'FIELD': { + 'top_left': { + 'lat': 40.73, + 'lon': -74.1 + }, + 'bottom_right': { + 'lat': 40.717, + 'lon': -73.99 + } + } + }, + + '{field}': { + top_left: { + lat: 40.73, + lon: -74.1 + }, + bottom_right: { + lat: 40.73, + lon: -74.1 + } + }, + type: { + __one_of: ['memory', 'indexed'] + }, + _cache: { + __one_of: [false, true] + } +}; + + +filters.geo_distance = { + __template: { + distance: 100, + distance_unit: 'km', + 'FIELD': { + lat: 40.73, + lon: -74.1 + } + }, + distance: 100, + distance_unit: { + __one_of: ['km', 'miles'] + }, + distance_type: { + __one_of: ['arc', 'plane'] + }, + optimize_bbox: { + __one_of: ['memory', 'indexed', 'none'] + }, + '{field}': { + lat: 40.73, + lon: -74.1 + }, + _cache: { + __one_of: [false, true] + } +}; + + +filters.geo_distance_range = { + __template: { + from: 100, + to: 200, + distance_unit: 'km', + 'FIELD': { + lat: 40.73, + lon: -74.1 + } + }, + from: 100, + to: 200, + + distance_unit: { + __one_of: ['km', 'miles'] + }, + distance_type: { + __one_of: ['arc', 'plane'] + }, + include_lower: { + __one_of: [true, false] + }, + include_upper: { + __one_of: [true, false] + }, + + '{field}': { + lat: 40.73, + lon: -74.1 + }, + _cache: { + __one_of: [false, true] + } +}; + + +filters.geo_polygon = { + __template: { + 'FIELD': { + 'points': [ + { + lat: 40.73, + lon: -74.1 + }, + { + lat: 40.83, + lon: -75.1 + } + ] + } + }, + '{field}': { + points: [ + { + lat: 40.73, + lon: -74.1 + } + ] + }, + _cache: { + __one_of: [false, true] + } +}; + + +filters.geo_shape = { + __template: { + 'FIELD': { + shape: { + type: 'envelope', + coordinates: [ + [-45, 45], + [45, -45] + ] + }, + 'relation': 'within' + } + }, + '{field}': { + shape: { + type: '', + coordinates: [] + }, + indexed_shape: { + id: '', + index: '{index}', + type: '{type}', + shape_field_name: 'shape' + }, + relation: { + __one_of: ['within', 'intersects', 'disjoint'] + } + } +}; + + +filters.has_child = { + __template: { + type: 'TYPE', + filter: {} + }, + type: '{type}', + query: {}, + filter: {}, + _scope: '', + min_children: 1, + max_children: 10 +}; + + +filters.has_parent = { + __template: { + parent_type: 'TYPE', + filter: {} + }, + parent_type: '{type}', + query: {}, + filter: {}, + _scope: '' +}; + + +filters.m = filters.missing = { + __template: { + field: 'FIELD' + }, + existence: { + __one_of: [true, false] + }, + null_value: { + __one_of: [true, false] + }, + field: '{field}' +}; + + +filters.not = { + __template: { + filter: {} + }, + filter: {}, + _cache: { + __one_of: [true, false] + } +}; + + +filters.range = { + __template: { + 'FIELD': { + gte: 10, + lte: 20 + } + }, + "{field}": { + gte: 1, + gt: 1, + lte: 20, + lt: 20, + time_zone: "+1:00", + execution: {__one_of: ["index", "fielddata"]} + }, + _cache: { + __one_of: [false, true] + }, + _cache_key: "" +}; + + +filters.or = { + __template: { + filters: [ + {} + ] + }, + filters: [ + { + __scope_link: '.' + } + ], + _cache: { + __one_of: [false, true] + } +}; + + +filters.prefix = { + __template: { + 'FIELD': 'VALUE' + }, + '{field}': '', + _cache: { + __one_of: [true, false] + } +}; + + +filters.query = { + // global query +}; + + +filters.fquery = { + __template: { + query: {}, + _cache: true + }, + query: { + //global query + }, + _cache: { + __one_of: [true, false] + } +}; + +filters.script = { + __template: { + script: 'SCRIPT', + params: {} + }, + script: '', + params: {}, + _cache: { + __one_of: [true, false] + } +}; + + +filters.term = { + __template: { + 'FIELD': 'VALUE' + }, + '{field}': '', + _cache: { + __one_of: [false, true] + } +}; + + +filters.terms = { + __template: { + 'FIELD': ['VALUE1', 'VALUE2'] + }, + field: ['{field}'], + execution: { + __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache'] + }, + _cache: { + __one_of: [false, true] + } +}; + + +filters.nested = { + __template: { + path: 'path_to_nested_doc', + query: {} + }, + query: {}, + path: '', + _cache: { + __one_of: [true, false] + }, + _name: '' +}; + +module.exports = function (api) { + api.addGlobalAutocompleteRules('filter', filters); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/globals.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/globals.js new file mode 100644 index 0000000..435c756 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/globals.js @@ -0,0 +1,21 @@ +module.exports = function (api) { + api.addGlobalAutocompleteRules('highlight', { + pre_tags: {}, + post_tags: {}, + tags_schema: {}, + fields: { + '{field}': { + fragment_size: 20, + number_of_fragments: 3 + } + } + }); + + // only used with scope links as there is no common name for scripts + api.addGlobalAutocompleteRules('SCRIPT_ENV', { + __template: {'script': ''}, + script: '', + lang: '', + params: {} + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/indices.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/indices.js new file mode 100644 index 0000000..a4c7abf --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/indices.js @@ -0,0 +1,208 @@ +module.exports = function (api) { + + api.addEndpointDescription('_refresh', { + methods: ['POST'], + patterns: [ + "_refresh", + "{indices}/_refresh" + ], + }); + + api.addEndpointDescription('_flush', { + methods: ['POST'], + patterns: [ + "_flush", + "{indices}/_flush" + ], + url_params: { + wait_if_ongoing: [true, false], + force: [true, false] + } + }); + + api.addEndpointDescription('_flush_synced', { + methods: ['POST'], + patterns: [ + "_flush/synced", + "{indices}/_flush/synced" + ] + }); + + api.addEndpointDescription('_stats', { + patterns: [ + "_stats", + "_stats/{metrics}", + "{indices}/_stats", + "{indices}/_stats/{metrics}", + ], + url_components: { + "metrics": [ + "docs", + "store", + "indexing", + "search", + "get", + "merge", + "refresh", + "flush", + "warmer", + "filter_cache", + "id_cache", + "percolate", + "segments", + "fielddata", + "completion", + "translog", + "query_cache", + "commit", + "_all" + ] + }, + url_params: { + "fields": [], + "types": [], + "completion_fields": [], + "fielddata_fields": [], + "level": ["cluster", "indices", "shards"] + } + + }); + + api.addEndpointDescription('_segments', { + patterns: [ + "{indices}/_segments", + "_segments" + ] + }); + + api.addEndpointDescription('_recovery', { + patterns: [ + "{indices}/_recovery", + "_recovery" + ], + url_params: { + detailed: "__flag__", + active_only: "__flag__", + human: "__flag__" + } + }); + + api.addEndpointDescription('_analyze', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/_analyze", + "_analyze" + ], + url_params: { + "analyzer": "", + "char_filters": [], + "field": "", + "filters": [], + "text": "", + "tokenizer": "" + } + }); + + api.addEndpointDescription('_validate_query', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/_validate/query", + "_validate/query" + ], + url_params: { + explain: "__flag__", + rewrite: "__flag__" + }, + data_autocomplete_rules: { + query: { + // populated by a global rule + } + } + }); + + api.addEndpointDescription('__create_index__', { + methods: ['PUT'], + patterns: [ + "{index}" + ], + data_autocomplete_rules: { + mappings: { + __scope_link: '_put_mapping' + }, + settings: { + __scope_link: '_put_settings' + }, + aliases: { + __template: { + "NAME": {} + } + } + } + }); + + api.addEndpointDescription('__delete_indices__', { + methods: ['DELETE'], + patterns: [ + "{indices}" + ] + }); + + api.addEndpointDescription('_get_index_settings', { + methods: ['GET',], + patterns: [ + "{indices}/_settings", + ], + url_params: { + flat_settings: "__flag__" + } + }); + + api.addEndpointDescription('_get_index', { + methods: ['GET',], + patterns: [ + "{indices}", + "{indices}/{feature}" + ], + url_components: { + "feature": [ + "_mappings", + "_warmers", + "_aliases" + ] + } + }); + + api.addEndpointDescription('_cache/clear', { + patterns: [ + "_cache/clear", + "{indices}/_cache/clear" + ] + }); + + api.addEndpointDescription('_status', { + patterns: [ + "_status", + "{indices}/_status" + ] + }); + + api.addEndpointDescription('_upgrade', { + methods: ["POST"], + patterns: [ + "_upgrade", + "{indices}/_upgrade" + ], + url_params: { + wait_for_completion: "__flag__" + } + }); + + api.addEndpointDescription('_upgrade_status', { + methods: ["GET"], + patterns: [ + "_upgrade", + "{indices}/_upgrade" + ] + }); + +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/mappings.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/mappings.js new file mode 100644 index 0000000..2c594c7 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/mappings.js @@ -0,0 +1,265 @@ +var INDEX_SETTING = { + __one_of: ['analyzed', 'not_analyzed', 'no'] +}, BOOLEAN = { + __one_of: [true, false] +}; + +module.exports = function (api) { + api.addEndpointDescription('_get_mapping', { + methods: ['GET'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/_mapping", + "{indices}/_mapping/{types}", + "{indices}/{types}/_mapping", + "_mapping" + ] + }); + api.addEndpointDescription('_get_field_mapping', { + methods: ['GET'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/_mapping/field/{fields}", + "{indices}/_mapping/{type}/field/{fields}" + ], + url_params: { + "include_defaults": "__flag__" + } + }); + api.addEndpointDescription('_delete_mapping', { + methods: ['DELETE'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/_mapping", + "{indices}/_mapping/{types}", + "{indices}/{types}/_mapping", + "_mapping" + ] + }); + api.addEndpointDescription('_put_type_mapping', { + methods: ['PUT', 'POST'], + patterns: [ + "{indices}/{type}/_mapping", + "{indices}/_mapping/{type}" + ], + priority: 10, // collides with put doc by id + data_autocomplete_rules: { + __template: { + properties: { + 'FIELD': {} + } + }, + '_id': { + 'index': INDEX_SETTING, + 'store': BOOLEAN, + 'path': "" + }, + '_type': { + 'index': INDEX_SETTING, + 'store': BOOLEAN + }, + '_source': { + 'enabled': BOOLEAN + }, + '_all': { + 'enabled': BOOLEAN + }, + '_analyzer': { + 'path': "" + }, + '_field_names': { + 'index': INDEX_SETTING + }, + '_routing': { + 'required': BOOLEAN, + 'path': "" + }, + '_index': { + 'enabled': BOOLEAN + }, + '_size': { + 'enabled': BOOLEAN, + 'store': BOOLEAN + }, + '_parent': { + __template: { + 'type': '' + }, + 'type': '{type}' + }, + '_timestamp': { + 'enabled': BOOLEAN, + 'path': '', + 'format': 'YYYY-MM-dd', + 'default': "" + }, + 'index_analyzer': 'standard', + 'search_analyzer': 'standard', + 'analyzer': 'standard', + 'dynamic_date_formats': ['yyyy-MM-dd'], + 'date_detection': BOOLEAN, + 'numeric_detection': BOOLEAN, + 'transform': { + __template: { + script: "" + }, + __one_of: [ + { + script: "", + params: {}, + lang: "groovy" + }, + [ + { + script: "", + params: {}, + lang: "groovy" + } + ] + ] + + + }, + 'properties': { + '*': { + type: { + __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean', + 'binary', 'object', 'nested', "geo_point", "geo_shape" + ] + }, + + // strings + index_name: '', + store: BOOLEAN, + index: INDEX_SETTING, + term_vector: { + __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets'] + }, + boost: 1.0, + null_value: '', + omit_norms: { + __one_of: [true, false] + }, + index_options: { + __one_of: ['docs', 'freqs', 'positions'] + }, + analyzer: 'standard', + index_analyzer: 'standard', + search_analyzer: 'standard', + include_in_all: { + __one_of: [false, true] + }, + ignore_above: 10, + position_offset_gap: 0, + + // numeric + precision_step: 4, + ignore_malformed: BOOLEAN, + + // geo_point + lat_lon: { + __one_of: [true, false] + }, + geohash: { + __one_of: [true, false] + }, + geohash_precision: '1m', + geohash_prefix: { + __one_of: [true, false] + }, + validate: { + __one_of: [true, false] + }, + validate_lat: { + __one_of: [true, false] + }, + validate_lon: { + __one_of: [true, false] + }, + normalize: { + __one_of: [true, false] + }, + normalize_lat: { + __one_of: [true, false] + }, + normalize_lon: { + __one_of: [true, false] + }, + + // geo_shape + tree: { + __one_of: ['geohash', 'quadtree'] + }, + precision: '5km', + tree_levels: 12, + distance_error_pct: 0.025, + orientation: 'ccw', + + // dates + format: { + __one_of: ['basic_date', 'basic_date_time', 'basic_date_time_no_millis', + 'basic_ordinal_date', 'basic_ordinal_date_time', 'basic_ordinal_date_time_no_millis', + 'basic_time', 'basic_time_no_millis', 'basic_t_time', 'basic_t_time_no_millis', + 'basic_week_date', 'basic_week_date_time', 'basic_week_date_time_no_millis', + 'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction', + 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis', + 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis', + 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis', + 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year', + 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day' + ] + }, + + fielddata: { + filter: { + regex: '', + frequency: { + min: 0.001, + max: 0.1, + min_segment_size: 500 + } + } + }, + postings_format: { + __one_of: ['direct', 'memory', 'pulsing', 'bloom_default', 'bloom_pulsing', 'default'] + }, + similarity: { + __one_of: ['default', 'BM25'] + }, + + // objects + properties: { + __scope_link: '_put_mapping.{type}.properties' + }, + + // multi_field + path: { + __one_of: ['just_name', 'full'] + }, + fields: { + '*': { + __scope_link: '_put_mapping.type.properties.field' + } + }, + copy_to: {__one_of: ['{field}', ['{field}']]}, + + // nested + include_in_parent: BOOLEAN, + include_in_root: BOOLEAN + } + } + } + + }); + api.addEndpointDescription('_put_mapping', { + methods: ['PUT'], + patterns: [ + "{indices}/_mapping" + ], + data_autocomplete_rules: { + '{type}': { + __scope_link: '_put_type_mapping' + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/nodes.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/nodes.js new file mode 100644 index 0000000..0562d83 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/nodes.js @@ -0,0 +1,77 @@ +module.exports = function (api) { + api.addEndpointDescription('_nodes/hot_threads', { + methods: ['GET'], + patterns: [ + "_nodes/hot_threads", + "_nodes/{nodes}/hot_threads" + ] + }); + api.addEndpointDescription('_nodes/info', { + patterns: [ + "_nodes", + "_nodes/{metrics}", + "_nodes/{nodes}", + "_nodes/{nodes}/{metrics}", + "_nodes/{nodes}/info/{metrics}" + ], + url_components: { + "metrics": [ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "network", + "transport", + "http", + "plugins", + "_all" + ] + } + }); + api.addEndpointDescription('_nodes/stats', { + patterns: [ + "_nodes/stats", + "_nodes/stats/{metrics}", + "_nodes/stats/{metrics}/{index_metric}", + "_nodes/{nodes}/stats", + "_nodes/{nodes}/stats/{metrics}", + "_nodes/{nodes}/stats/{metrics}/{index_metric}" + ], + url_components: { + "metrics": [ + "os", + "jvm", + "thread_pool", + "network", + "fs", + "transport", + "http", + "indices", + "process", + "breaker", + "_all" + ], + "index_metric": [ + "store", + "indexing", + "get", + "search", + "merge", + "flush", + "refresh", + "filter_cache", + "id_cache", + "fielddata", + "docs", + "warmer", + "percolate", + "completion", + "segments", + "translog", + "query_cache", + "_all" + ] + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/percolator.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/percolator.js new file mode 100644 index 0000000..2e9ba62 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/percolator.js @@ -0,0 +1,91 @@ +module.exports = function (api) { + api.addEndpointDescription('_put_percolator', { + priority: 10, // to override doc + methods: ['PUT', 'POST'], + patterns: [ + "{index}/.percolator/{id}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "op_type": ["create"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "replication": ["sync", "async"], + "refresh": "__flag__", + "timeout": "1m" + }, + data_autocomplete_rules: { + query: {} + } + }); + api.addEndpointDescription('_percolate', { + methods: ['GET', 'POST'], + priority: 10, // to override doc + patterns: [ + "{indices}/{type}/_percolate" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + ignore_unavailable: ["true", "false"], + percolate_format: ["ids"] + }, + data_autocomplete_rules: { + doc: {}, + query: {}, + filter: {}, + size: 10, + track_scores: {__one_of: [true, false]}, + sort: "_score", + aggs: {}, + highlight: {} + } + }); + api.addEndpointDescription('_percolate_id', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/{type}/{id}/_percolate" + ], + url_params: { + routing: "", + ignore_unavailable: ["true", "false"], + percolate_format: ["ids"], + percolate_index: "{index}", + percolate_type: "{type}", + percolate_routing: "", + percolate_preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + version: 1, + version_type: ["external", "internal"] + }, + data_autocomplete_rules: { + query: {}, + filter: {}, + size: 10, + track_scores: {__one_of: [true, false]}, + sort: "_score", + aggs: {}, + highlight: {} + } + }); + api.addEndpointDescription('_percolate_count', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/{type}/_percolate/count" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + ignore_unavailable: ["true", "false"], + percolate_format: ["ids"] + }, + data_autocomplete_rules: { + doc: {}, + query: {}, + filter: {} + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/query.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/query.js new file mode 100644 index 0000000..dd1d9a9 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/query.js @@ -0,0 +1,589 @@ +let _ = require("lodash"); + +var SPAN_QUERIES = { + // TODO add one_of for objects + span_first: { + __scope_link: '.span_first' + }, + span_near: { + __scope_link: '.span_near' + }, + span_or: { + __scope_link: '.span_or' + }, + span_not: { + __scope_link: '.span_not' + }, + span_term: { + __scope_link: '.span_term' + } +}; + +var DECAY_FUNC_DESC = { + __template: { + "FIELD": { + "origin": "", + "scale": "" + } + }, + "{field}": { + "origin": "", + "scale": "", + "offset": "", + "decay": 0.5 + } + }, + SCORING_FUNCS = { + "script_score": { + __template: { + "script": "_score * doc['f'].value" + }, + "script": "", + "script_id": "", + "lang": "groovy", + "params": {} + }, + "boost_factor": 2.0, + "random_score": { + "seed": 314159265359 + }, + "linear": DECAY_FUNC_DESC, + "exp": DECAY_FUNC_DESC, + "gauss": DECAY_FUNC_DESC, + "field_value_factor": { + __template: { + "field": "" + }, + "field": "{field}", + "factor": 1.2, + "modifier": { + __one_of: ["none", "log", "log1p", "log2p", "ln", "ln1p", "ln2p", "square", "sqrt", "reciprocal"] + } + } + }; + +module.exports = function (api) { + api.addGlobalAutocompleteRules('query', { + match: { + __template: { + 'FIELD': 'TEXT' + }, + '{field}': { + 'query': '', + 'operator': { + __one_of: ['and', 'or'] + }, + 'type': { + __one_of: ['phrase', 'phrase_prefix', 'boolean'] + }, + 'max_expansions': 10, + 'analyzer': '', + 'fuzziness': 1.0, + 'prefix_length': 1 + } + }, + match_phrase: { + __template: { + 'FIELD': 'PHRASE' + }, + '{field}': { + query: '', + analyzer: '' + } + }, + match_phrase_prefix: { + __template: { + 'FIELD': 'PREFIX' + }, + '{field}': { + query: '', + analyzer: '', + max_expansions: 10, + prefix_length: 1, + fuzziness: 0.1 + } + }, + multi_match: { + __template: { + 'query': '', + 'fields': [] + }, + query: '', + fields: ['{field}'], + use_dis_max: { + __template: true, + __one_of: [true, false] + }, + tie_breaker: 0.0, + type: {__one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix']} + }, + bool: { + must: [ + { + __scope_link: '.' + } + ], + must_not: [ + { + __scope_link: '.' + } + ], + should: [ + { + __scope_link: '.' + } + ], + minimum_number_should_match: 1, + boost: 1.0 + }, + boosting: { + positive: { + __scope_link: '.' + }, + negative: { + __scope_link: '.' + }, + negative_boost: 0.2 + }, + ids: { + type: '', + values: [] + }, + constant_score: { + __template: { + filter: {}, + boost: 1.2 + }, + query: {}, + filter: {}, + boost: 1.2 + }, + dis_max: { + __template: { + tie_breaker: 0.7, + boost: 1.2, + queries: [] + }, + tie_breaker: 0.7, + boost: 1.2, + queries: [ + { + __scope_link: '.' + } + ] + }, + field: { + '{field}': { + query: '', + boost: 2.0, + enable_position_increments: { + __template: false, + __one_of: [true, false] + } + } + }, + filtered: { + __template: { + query: {}, + filter: {} + }, + query: {}, + filter: {} + }, + fuzzy_like_this: { + fields: [], + like_text: '', + max_query_terms: 12 + }, + flt: { + __scope_link: '.fuzzy_like_this' + }, + fuzzy: { + '{field}': { + 'value': '', + 'boost': 1.0, + 'min_similarity': 0.5, + 'prefix_length': 0 + } + }, + has_child: { + __template: { + type: 'TYPE', + query: {} + }, + 'type': '{type}', + 'score_mode': { + __one_of: ['none', 'max', 'sum', 'avg'] + }, + '_scope': '', + 'query': {}, + 'min_children': 1, + 'max_children': 10 + }, + has_parent: { + __template: { + parent_type: 'TYPE', + query: {} + }, + 'parent_type': '{type}', + 'score_mode': { + __one_of: ['none', 'score'] + }, + '_scope': '', + 'query': {} + }, + match_all: {}, + more_like_this: { + __template: { + 'fields': ['FIELD'], + 'like_text': 'text like this one', + 'min_term_freq': 1, + 'max_query_terms': 12 + }, + fields: ['{field}'], + like_text: '', + percent_terms_to_match: 0.3, + min_term_freq: 2, + max_query_terms: 25, + stop_words: [''], + min_doc_freq: 5, + max_doc_freq: 100, + min_word_len: 0, + max_word_len: 0, + boost_terms: 1, + boost: 1.0, + analyzer: '', + docs: [{ + _index: "{index}", + _type: "{type}", + _id: "" + }], + ids: [""] + }, + mlt: { + __template: { + 'fields': ['FIELD'], + 'like_text': 'text like this one', + 'min_term_freq': 1, + 'max_query_terms': 12 + }, + __scope_link: ".more_like_this" + }, + more_like_this_field: { + __template: { + 'FIELD': { + 'like_text': 'text like this one', + 'min_term_freq': 1, + 'max_query_terms': 12 + } + }, + '{field}': { + like_text: '', + percent_terms_to_match: 0.3, + min_term_freq: 2, + max_query_terms: 25, + stop_words: [''], + min_doc_freq: 5, + max_doc_freq: 100, + min_word_len: 0, + max_word_len: 0, + boost_terms: 1, + boost: 1.0, + analyzer: '' + } + }, + prefix: { + __template: { + 'FIELD': { + 'value': '' + } + }, + '{field}': { + value: '', + boost: 1.0 + } + }, + query_string: { + __template: { + 'default_field': 'FIELD', + 'query': 'this AND that OR thus' + }, + query: '', + default_field: '{field}', + fields: ['{field}'], + default_operator: { + __one_of: ['OR', 'AND'] + }, + analyzer: '', + allow_leading_wildcard: { + __one_of: [true, false] + }, + lowercase_expanded_terms: { + __one_of: [true, false] + }, + enable_position_increments: { + __one_of: [true, false] + }, + fuzzy_max_expansions: 50, + fuzzy_min_sim: 0.5, + fuzzy_prefix_length: 0, + phrase_slop: 0, + boost: 1.0, + analyze_wildcard: { + __one_of: [false, true] + }, + auto_generate_phrase_queries: { + __one_of: [false, true] + }, + minimum_should_match: '20%', + lenient: { + __one_of: [false, true] + }, + use_dis_max: { + __one_of: [true, false] + }, + tie_breaker: 0 + }, + simple_query_string: { + __template: { + query: "", + fields: [] + }, + query: "", + fields: ["{field}"], + default_operator: {__one_of: ["OR", "AND"]}, + analyzer: "", + flags: "OR|AND|PREFIX", + lowercase_expanded_terms: {__one_of: [true, false]}, + locale: "ROOT", + lenient: {__one_of: [true, false]} + }, + range: { + __template: { + 'FIELD': { + gte: 10, + lte: 20 + } + }, + '{field}': { + __template: { + gte: 10, + lte: 20 + }, + gte: 10, + gt: 10, + lte: 20, + lt: 20, + time_zone: "+1:00", + boost: 1.0 + } + }, + span_first: { + __template: { + 'match': { + 'span_term': { + 'FIELD': 'VALUE' + } + }, + 'end': 3 + }, + match: SPAN_QUERIES + }, + span_near: { + __template: { + 'clauses': [ + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + ], + slop: 12, + in_order: false + }, + clauses: [ + SPAN_QUERIES + ], + slop: 12, + in_order: { + __one_of: [false, true] + }, + collect_payloads: { + __one_of: [false, true] + } + }, + span_term: { + __template: { + 'FIELD': { + 'value': 'VALUE' + } + }, + '{field}': { + value: '', + boost: 2.0 + } + }, + span_not: { + __template: { + include: { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + }, + exclude: { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + }, + include: SPAN_QUERIES, + exclude: SPAN_QUERIES + }, + span_or: { + __template: { + clauses: [ + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + ] + }, + clauses: [ + SPAN_QUERIES + ] + }, + term: { + __template: { + 'FIELD': { + value: 'VALUE' + } + }, + '{field}': { + value: '', + boost: 2.0 + } + }, + terms: { + __template: { + 'FIELD': ['VALUE1', 'VALUE2'] + }, + '{field}': [''], + minimum_match: 1 + }, + top_children: { + __template: { + type: 'CHILD_TYPE', + query: {} + }, + type: '$CHILD_TYPE$', + query: {}, + score: { + __one_of: ['max', 'sum', 'avg'] + }, + factor: 5, + incremental_factor: 2 + }, + wildcard: { + __template: { + 'FIELD': { + value: 'VALUE' + } + }, + '{field}': { + value: '', + boost: 2.0 + } + }, + nested: { + __template: { + path: 'path_to_nested_doc', + query: {} + }, + path: '', + query: {}, + filter: {}, + score_mode: { + __one_of: ['avg', 'total', 'max', 'none'] + } + }, + custom_filters_score: { + __template: { + query: {}, + filters: [ + { + filter: {} + } + ] + }, + query: {}, + filters: [ + { + filter: {}, + boost: 2.0, + script: '' + } + ], + score_mode: { + __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply'] + }, + max_boost: 2.0, + params: {}, + lang: '' + }, + indices: { + __template: { + indices: ['INDEX1', 'INDEX2'], + query: {} + }, + indices: ['{index}'], + query: {}, + no_match_query: { + __scope_link: '.' + } + }, + geo_shape: { + __template: { + location: {}, + relation: 'within' + }, + __scope_link: '.filter.geo_shape' + }, + // js hint gets confused here + /* jshint -W015 */ + function_score: _.defaults({ + __template: { + query: {}, + functions: [ + {} + ] + }, + query: {}, + filter: {}, + functions: [ + _.defaults( + { + filter: {}, + weight: 1.0 + }, + SCORING_FUNCS + ) + ], + boost: 1.0, + boost_mode: {__one_of: ["multiply", "replace", "sum", "avg", "max", "min"]}, + score_mode: {__one_of: ["multiply", "sum", "first", "avg", "max", "min"]}, + max_boost: 10 + }, + SCORING_FUNCS + ) + + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/search.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/search.js new file mode 100644 index 0000000..d8d79af --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/search.js @@ -0,0 +1,238 @@ +module.exports = function (api) { + api.addEndpointDescription('_search', { + methods: ['GET', 'POST'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/{types}/_search", + "{indices}/_search", + "_search" + ], + url_params: { + q: "", + df: "", + analyzer: "", + default_operator: ["AND", "OR"], + explain: "__flag__", + _source: "", + _source_include: "", + _source_exclude: "", + fields: [], + sort: "", + track_scores: "__flag__", + timeout: 1, + from: 0, + size: 10, + search_type: ["dfs_query_then_fetch", "dfs_query_and_fetch", "query_then_fetch", "query_and_fetch", "count", "scan"], + terminate_after: 10, + lowercase_expanded_terms: ["true", "false"], + analyze_wildcard: "__flag__", + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + scroll: "5m", + scroll_id: "", + routing: "", + query_cache: ["true", "false"] + }, + data_autocomplete_rules: { + query: { + // populated by a global rule + }, + facets: { + __template: { + 'NAME': { + 'TYPE': {} + } + } + // populated by a global rule + }, + aggs: { + __template: { + "NAME": { + "AGG_TYPE": {} + } + } + }, + + post_filter: { + __scope_link: 'GLOBAL.filter' + }, + size: { + __template: 20 + }, + from: 0, + sort: { + __template: [ + { + 'FIELD': { + 'order': 'desc' + } + } + ], + __any_of: [ + { + '{field}': { + 'order': { + __one_of: ['desc', 'asc'] + }, + missing: { + __one_of: ['_last', '_first'] + }, + mode: { + __one_of: ['min', 'max', 'avg', 'sum'] + }, + nested_path: "", + nested_filter: { + __scope_link: "GLOBAL.filter" + } + } + }, + '{field}', + '_score', + { + '_geo_distance': { + __template: { + "FIELD": { + lat: 40, + lon: -70 + }, + order: "asc" + }, + "{field}": { + __one_of: [ + { + __template: { + lat: 40, + lon: -70 + }, + lat: 40, + lon: -70 + }, + [ + { + __template: { + lat: 40, + lon: -70 + }, + lat: 40, + lon: -70 + } + ], + [""], + "" + ] + }, + distance_type: {__one_of: ["sloppy_arc", "arc", "plane"]}, + sort_mode: {__one_of: ["min", "max", "avg"]}, + order: {__one_of: ["asc", "desc"]}, + unit: "km" + } + } + ] + }, + fields: ['{field}'], + fielddata_fields: ["{field}"], + script_fields: { + __template: { + 'FIELD': { + 'script': '' + } + }, + '*': { + __scope_link: 'GLOBAL.SCRIPT_ENV' + } + }, + partial_fields: { + __template: { + 'NAME': { + include: [] + } + }, + '*': { + include: [], + exclude: [] + } + }, + highlight: { + // populated by a global rule + }, + _source: { + __one_of: [ + "{field}", + ["{field}"], + { + "include": { + __one_of: [ + "{field}", + ["{field}"] + ] + }, + "exclude": { + __one_of: [ + "{field}", + ["{field}"] + ] + } + } + ] + }, + explain: { + __one_of: [true, false] + }, + stats: [''], + timeout: "1s", + version: {__one_of: [true, false]} + } + }); + + api.addEndpointDescription('_search_template', { + methods: ['GET'], + patterns: [ + "{indices}/{types}/_search/template", + "{indices}/_search/template", + "_search/template" + ], + data_autocomplete_rules: { + "template": { + __one_of: [ + {__scope_link: "_search"}, + {"file": ""}, + {"id": ""} + ] + }, + "params": {} + } + }); + + api.addEndpointDescription('_get_delete_search_template', { + methods: ['GET', 'DELETE'], + patterns: [ + "_search/template/{id}" + ] + }); + + api.addEndpointDescription('_put_search_template', { + methods: ['PUT'], + patterns: [ + "_search/template/{id}" + ], + data_autocomplete_rules: { + "template": { + __scope_link: "_search" + } + } + }); + + api.addEndpointDescription('_search_shards', { + methods: ['GET'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/{types}/_search_shards", + "{indices}/_search_shards", + "_search_shards" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + local: "__flag__" + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/settings.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/settings.js new file mode 100644 index 0000000..9e5d3bf --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/settings.js @@ -0,0 +1,83 @@ +module.exports = function (api) { + + api.addEndpointDescription('_get_settings', { + patterns: [ + "{indices}/_settings", + "_settings" + ], + url_params: { + flat_settings: "__flag__" + } + }); + api.addEndpointDescription('_put_settings', { + methods: ['PUT'], + patterns: [ + "{indices}/_settings", + "_settings" + ], + data_autocomplete_rules: { + refresh_interval: '1s', + number_of_shards: 5, + number_of_replicas: 1, + 'blocks.read_only': { + __one_of: [false, true] + }, + 'blocks.read': { + __one_of: [true, false] + }, + 'blocks.write': { + __one_of: [true, false] + }, + 'blocks.metadata': { + __one_of: [true, false] + }, + term_index_interval: 32, + term_index_divisor: 1, + 'translog.flush_threshold_ops': 5000, + 'translog.flush_threshold_size': '200mb', + 'translog.flush_threshold_period': '30m', + 'translog.disable_flush': { + __one_of: [true, false] + }, + 'cache.filter.max_size': '2gb', + 'cache.filter.expire': '2h', + 'gateway.snapshot_interval': '10s', + routing: { + allocation: { + include: { + tag: '' + }, + exclude: { + tag: '' + }, + require: { + tag: '' + }, + total_shards_per_node: -1 + } + }, + 'recovery.initial_shards': { + __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1'] + }, + 'ttl.disable_purge': { + __one_of: [true, false] + }, + analysis: { + analyzer: {}, + tokenizer: {}, + filter: {}, + char_filter: {} + }, + 'cache.query.enable': { + __one_of: [true, false] + }, + shadow_replicas: { + __one_of: [true, false] + }, + shared_filesystem: { + __one_of: [true, false] + }, + data_path: 'path' + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/snapshot_restore.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/snapshot_restore.js new file mode 100644 index 0000000..4e681ea --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/snapshot_restore.js @@ -0,0 +1,153 @@ +module.exports = function (api) { + api.addEndpointDescription('restore_snapshot', { + methods: ['POST'], + patterns: [ + '_snapshot/{id}/{id}/_restore' + ], + url_params: { + wait_for_completion: "__flag__" + }, + data_autocomplete_rules: { + indices: "*", + ignore_unavailable: {__one_of: [true, false]}, + include_global_state: false, + rename_pattern: "index_(.+)", + rename_replacement: "restored_index_$1" + } + }); + + + api.addEndpointDescription('single_snapshot', { + methods: ['GET', 'DELETE'], + patterns: [ + '_snapshot/{id}/{id}' + ] + }); + + api.addEndpointDescription('all_snapshots', { + methods: ['GET'], + patterns: [ + '_snapshot/{id}/_all' + ] + }); + + api.addEndpointDescription('put_snapshot', { + methods: ['PUT'], + patterns: [ + '_snapshot/{id}/{id}' + ], + url_params: { + wait_for_completion: "__flag__" + }, + data_autocomplete_rules: { + indices: "*", + ignore_unavailable: {__one_of: [true, false]}, + include_global_state: {__one_of: [true, false]}, + partial: {__one_of: [true, false]} + } + }); + + api.addEndpointDescription('_snapshot_status', { + methods: ['GET'], + patterns: [ + '_snapshot/_status', + '_snapshot/{id}/_status', + '_snapshot/{id}/{ids}/_status' + ] + }); + + + function getRepositoryType(context, editor) { + var iter = editor.iterForCurrentLoc(); + // for now just iterate back to the first "type" key + var t = iter.getCurrentToken(); + var type; + while (t && t.type.indexOf("url") < 0) { + if (t.type === 'variable' && t.value === '"type"') { + t = editor.parser.nextNonEmptyToken(iter); + if (!t || t.type !== "punctuation.colon") { + // weird place to be in, but safe choice.. + break; + } + t = editor.parser.nextNonEmptyToken(iter); + if (t && t.type === "string") { + type = t.value.replace(/"/g, ''); + } + break; + } + t = editor.parser.prevNonEmptyToken(iter); + } + return type; + } + + api.addEndpointDescription('put_repository', { + methods: ['PUT'], + patterns: [ + '_snapshot/{id}' + ], + data_autocomplete_rules: { + __template: {"type": ""}, + + "type": { + __one_of: ["fs", "url", "s3", "hdfs"] + }, + "settings": { + __one_of: [{ + //fs + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']fs` + }, + __template: { + location: "path" + }, + location: "path", + compress: {__one_of: [true, false]}, + concurrent_streams: 5, + chunk_size: "10m", + max_restore_bytes_per_sec: "20mb", + max_snapshot_bytes_per_sec: "20mb" + }, + {// url + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']url` + }, + __template: { + url: "" + }, + url: "", + concurrent_streams: 5 + }, + { //s3 + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']s3` + }, + __template: { + bucket: "" + }, + bucket: "", + region: "", + base_path: "", + concurrent_streams: 5, + chunk_size: "10m", + compress: {__one_of: [true, false]} + }, + {// hdfs + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']hdfs` + }, + __template: { + path: "" + }, + uri: "", + path: "some/path", + load_defaults: {__one_of: [true, false]}, + conf_location: "cfg.xml", + concurrent_streams: 5, + compress: {__one_of: [true, false]}, + chunk_size: "10m" + } + ] + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/templates.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/templates.js new file mode 100644 index 0000000..635256c --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/templates.js @@ -0,0 +1,27 @@ +module.exports = function (api) { + api.addEndpointDescription('_delete_template', { + methods: ['DELETE'], + patterns: [ + "_template/{id}", + ] + }); + api.addEndpointDescription('_get_template', { + methods: ['GET'], + patterns: [ + "_template/{id}", + "_template", + ] + }); + api.addEndpointDescription('_put_template', { + methods: ['PUT'], + patterns: [ + "_template/{id}", + ], + data_autocomplete_rules: { + template: 'index*', + warmers: {__scope_link: '_warmer'}, + mappings: {__scope_link: '_put_mapping'}, + settings: {__scope_link: '_put_settings'} + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/warmers.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/warmers.js new file mode 100644 index 0000000..9984512 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_1_0/warmers.js @@ -0,0 +1,30 @@ +module.exports = function (api) { + api.addEndpointDescription('_get_warmer', { + patterns: ["_warmer", "_warmer/{name}", "{indices}/_warmer", "{indices}/_warmer/{name}"] + }); + api.addEndpointDescription('_delete_warmer', { + methods: ['DELETE'], + patterns: [ + "{indices}/_warmer/{name}" + ] + }); + api.addEndpointDescription('_put_warmer', { + methods: ['PUT'], + patterns: [ + "{indices}/_warmer/{name}", + "{indices}/{types}/_warmer/{name}" + ], + data_autocomplete_rules: { + query: { + // populated by a global rule + }, + facets: { + // populated by a global rule + }, + aggs: {}, + sort: { + __scope_link: "_search.sort" + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0.js new file mode 100644 index 0000000..06b43ae --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0.js @@ -0,0 +1,55 @@ +let _ = require("lodash"); +let Api = require('./api'); +let parts = [ + require('./es_2_0/aliases'), + require('./es_2_0/aggregations'), + require('./es_2_0/cat'), + require('./es_2_0/cluster'), + require('./es_2_0/count'), + require('./es_2_0/document'), + require('./es_2_0/field_stats'), + require('./es_2_0/filter'), + require('./es_2_0/nodes'), + require('./es_2_0/globals'), + require('./es_2_0/indices'), + require('./es_2_0/mappings'), + require('./es_2_0/percolator'), + require('./es_2_0/query'), + require('./es_2_0/snapshot_restore'), + require('./es_2_0/search'), + require('./es_2_0/settings'), + require('./es_2_0/templates'), + require('./es_2_0/warmers') +]; + +function ES_2_0() { + Api.call(this, "es_2_0"); + _.each(parts, function (apiSection) { + apiSection(this); + }, this); +} + +ES_2_0.prototype = _.create(Api.prototype, {'constructor': ES_2_0}); + +(function (cls) { + cls.addEndpointDescription = function (endpoint, description) { + if (description) { + var url_params_def = {}; + _.each(description.patterns || [], function (p) { + if (p.indexOf("{indices}") >= 0) { + url_params_def["ignore_unavailable"] = "__flag__"; + url_params_def["allow_no_indices"] = "__flag__"; + url_params_def["expand_wildcards"] = ["open", "closed"]; + } + }); + + if (url_params_def) { + description.url_params = description.url_params || {}; + _.defaults(description.url_params, url_params_def); + } + } + Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description); + }; +})(ES_2_0.prototype); + +module.exports = new ES_2_0(); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js new file mode 100644 index 0000000..ac32e5f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js @@ -0,0 +1,436 @@ +var simple_metric = { + __template: {field: ""}, + field: "{field}", + missing: 0, + script: { + // populated by a global rule + } +}, field_metric = { + __template: {field: ""}, + field: "{field}" +}, gap_policy = { + __one_of: ["skip", "insert_zeros"] +}, simple_pipeline = { + __template: { + buckets_path: "" + }, + buckets_path: "", + format: "", + gap_policy: gap_policy +}; +var rules = { + "*": { + "aggs": { + __template: { + "NAME": { + "AGG_TYPE": {} + } + } + }, + "min": simple_metric, + "max": simple_metric, + "avg": simple_metric, + "sum": simple_metric, + "stats": simple_metric, + "extended_stats": simple_metric, + "value_count": { + __template: { + "field": "" + }, + "field": "{field}", + "script": { + // populated by a global rule + } + }, + "global": {}, + "filter": {}, + "filters": { + __template: { + "filters": { + "NAME": {} + } + }, + "filters": { + "*": {__scope_link: "GLOBAL.filter"} + }, + "other_bucket": {__one_of: [true, false]}, + "other_bucket_key": "" + }, + "missing": field_metric, + "nested": { + __template: { + "path": "" + }, + "path": "" + }, + "reverse_nested": { + __template: { + "path": "" + }, + "path": "" + }, + "terms": { + __template: { + "field": "", + "size": 10 + }, + "field": "{field}", + "size": 10, + "shard_size": 10, + "order": { + __template: { + "_term": "asc" + }, + "_term": {__one_of: ["asc", "desc"]}, + "_count": {__one_of: ["asc", "desc"]}, + "*": {__one_of: ["asc", "desc"]} + }, + "min_doc_count": 10, + "script": { + // populated by a global rule + }, + "include": ".*", + "exclude": ".*", + "execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash", "global_ordinals_low_cardinality"]}, + "show_term_doc_count_error": {__one_of: [true, false]}, + "collect_mode": {__one_of: ["depth_first", "breadth_first"]}, + "missing": "" + }, + "significant_terms": { + __template: { + "field": "" + }, + "field": "{field}", + "size": 10, + "shard_size": 10, + "shard_min_doc_count": 10, + "min_doc_count": 10, + "include": {__one_of: ["*", {pattern: "", flags: ""}]}, + "exclude": {__one_of: ["*", {pattern: "", flags: ""}]}, + "execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash"]}, + "background_filter": { + __scope_link: "GLOBAL.filter" + }, + "mutual_information": { + "include_negatives": {__one_of: [true, false]} + }, + "chi_square": { + "include_negatives": {__one_of: [true, false]}, + "background_is_superset": {__one_of: [true, false]} + }, + "percentage": {}, + "gnd": { + "background_is_superset": {__one_of: [true, false]} + }, + "script_heuristic": { + __template: { + "script": "_subset_freq/(_superset_freq - _subset_freq + 1)" + }, + "script": { + // populated by a global rule + } + } + }, + "range": { + __template: { + "field": "", + "ranges": [ + {"from": 50, "to": 100}, + ] + }, + "field": "{field}", + "ranges": [ + {"to": 50, "from": 100, "key": ""} + ], + "keyed": {__one_of: [true, false]}, + "script": { + // populated by a global rule + } + }, + "date_range": { + __template: { + "field": "", + "ranges": [ + {"from": "now-10d/d", "to": "now"}, + ] + }, + "field": "{field}", + "format": "MM-yyy", + "ranges": [ + {"to": "", "from": "", "key": ""} + ], + "keyed": {__one_of: [true, false]}, + "script": { + // populated by a global rule + } + }, + "ip_range": { + __template: { + "field": "", + "ranges": [ + {"from": "10.0.0.5", "to": "10.0.0.10"}, + ] + }, + "field": "{field}", + "format": "MM-yyy", + "ranges": [ + {"to": "", "from": "", "key": "", "mask": "10.0.0.127/25"} + ], + "keyed": {__one_of: [true, false]}, + "script": { + // populated by a global rule + } + }, + "histogram": { + __template: { + "field": "price", + "interval": 50 + }, + "field": "{field}", + "interval": 50, + "min_doc_count": 0, + "order": { + __template: { + "_key": "asc" + }, + "_key": {__one_of: ["asc", "desc"]}, + "_count": {__one_of: ["asc", "desc"]}, + "*": {__one_of: ["asc", "desc"]} + }, + "keyed": {__one_of: [true, false]}, + "missing": 0 + }, + "date_histogram": { + __template: { + "field": "date", + "interval": "month" + }, + "field": "{field}", + "interval": {__one_of: ["year", "quarter", "week", "day", "hour", "minute", "second"]}, + "min_doc_count": 0, + "order": { + __template: { + "_key": "asc" + }, + "_key": {__one_of: ["asc", "desc"]}, + "_count": {__one_of: ["asc", "desc"]}, + "*": {__one_of: ["asc", "desc"]} + }, + "keyed": {__one_of: [true, false]}, + "pre_zone": "-01:00", + "post_zone": "-01:00", + "pre_zone_adjust_large_interval": {__one_of: [true, false]}, + "factor": 1000, + "pre_offset": "1d", + "post_offset": "1d", + "format": "yyyy-MM-dd", + "time_zone": "00:00", + "missing": "" + }, + "geo_distance": { + __template: { + "field": "location", + "origin": {"lat": 52.3760, "lon": 4.894}, + "ranges": [ + {"from": 100, "to": 300}, + ] + }, + "field": "{field}", + "origin": {"lat": 0.0, "lon": 0.0}, + "unit": {__one_of: ["mi", "km", "in", "yd", "m", "cm", "mm"]}, + "ranges": [ + {"from": 50, "to": 100} + ], + "distance_type": {__one_of: ["arc", "sloppy_arc", "plane"]} + + }, + "geohash_grid": { + __template: { + "field": "", + "precision": 3 + }, + "field": "{field}", + "precision": {__one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}, + "size": 10, + "shard_size": 10 + }, + "percentiles": { + __template: { + "field": "", + "percents": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0] + }, + "field": "{field}", + "percents": { + __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0], + // mark type as list + __any_of: [] + }, + "script": { + // populated by a global rule + }, + "compression": 100, + "method": {__one_of: ["hdr", "tdigest"]}, + missing: 0 + }, + "cardinality": { + __template: { + "field": "" + }, + "precision_threshold": 100, + "rehash": true, + "script": { + // populated by a global rule + }, + missing: "" + }, + "scripted_metric": { + __template: { + "init_script": "", + "map_script": "", + "combine_script": "", + "reduce_script": "" + }, + "init_script": { + __scope_link: "GLOBAL.script" + }, + "map_script": { + __scope_link: "GLOBAL.script" + }, + "combine_script": { + __scope_link: "GLOBAL.script" + }, + "reduce_script": { + __scope_link: "GLOBAL.script" + }, + "lang": "groovy", + "params": {}, + "reduce_params": {} + }, + "geo_bounds": { + __template: { + field: "" + }, + field: "{field}", + wrap_longitude: {__one_of: [true, false]} + }, + "top_hits": { + __template: { + size: 10 + }, + from: 0, + size: 10, + sort: { + __template: [], + __scope_link: "_search.sort" + }, + highlight: {}, + explain: {__one_of: [true, false]}, + _source: { + __template: "", + __scope_link: "_search._source" + }, + script_fields: { + __scope_link: "_search.script_fields" + }, + fielddata_fields: ["{field}"], + version: {__one_of: [true, false]} + }, + "percentile_ranks": { + __template: { + field: "", + values: [10, 15] + }, + field: "{field}", + values: [], + "script": { + // populated by a global rule + }, + "compression": 100, + "method": {__one_of: ["hdr", "tdigest"]}, + missing: 0 + }, + "sampler": { + __template: {}, + "field": "{field}", + "script": { + // populated by a global rule + }, + "shard_size": 100, + "max_docs_per_value": 3, + "execution_hint": {__one_of: ["map", "global_ordinals", "bytes_hash"]} + }, + "children": { + __template: { + "type": "", + }, + "type": "" + }, + "derivative": simple_pipeline, + "avg_bucket": simple_pipeline, + "max_bucket": simple_pipeline, + "min_bucket": simple_pipeline, + "sum_bucket": simple_pipeline, + "moving_avg": { + __template: { + buckets_path: "" + }, + buckets_path: "", + format: "", + gap_policy: gap_policy, + "window": 5, + model: {__one_of: ["simple", "linear", "ewma", "holt", "holt_winters"]}, + settings: { + type: {__one_of: ["add", "mult"]}, + alpha: 0.5, + beta: 0.5, + gamma: 0.5, + period: 7 + } + }, + "cumulative_sum": { + __template: { + buckets_path: "" + }, + buckets_path: "", + format: "" + }, + "serial_diff": { + __template: { + buckets_path: "", + lag: 7 + }, + lag: 7, + gap_policy: gap_policy, + buckets_path: "", + format: "" + }, + "bucket_script": { + __template: { + buckets_path: "", + script: {} + }, + buckets_path: "", + format: "", + gap_policy: gap_policy, + script: { + // populated by a global rule + } + }, + "bucket_selector": { + __template: { + buckets_path: "", + script: {} + }, + buckets_path: "", + gap_policy: gap_policy, + script: { + // populated by a global rule + } + } + } +}; +module.exports = function (api) { + + api.addGlobalAutocompleteRules('aggregations', rules); + api.addGlobalAutocompleteRules('aggs', rules); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/aliases.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/aliases.js new file mode 100644 index 0000000..832a1ed --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/aliases.js @@ -0,0 +1,71 @@ +module.exports = function (api) { + api.addEndpointDescription('_post_aliases', { + methods: ['POST'], + patterns: [ + "_aliases", + ], + data_autocomplete_rules: { + 'actions': { + __template: [ + {'add': {'index': 'test1', 'alias': 'alias1'}} + ], + __any_of: [ + { + add: { + index: '{index}', + alias: '', + filter: {}, + routing: '1', + search_routing: '1,2', + index_routing: '1' + }, + remove: { + index: '', + alias: '' + } + } + ] + } + } + }); + api.addEndpointDescription('_get_aliases', { + methods: ['GET'], + patterns: [ + "_aliases", + ] + }); + + var aliasRules = { + filter: {}, + routing: '1', + search_routing: '1,2', + index_routing: '1' + }; + + api.addEndpointDescription('_post_alias', { + methods: ["POST", "PUT"], + patterns: [ + "{indices}/_alias/{name}" + ], + data_autocomplete_rules: aliasRules + }); + api.addEndpointDescription('_delete_alias', { + methods: ["DELETE"], + patterns: [ + "{indices}/_alias/{name}" + ] + }); + api.addEndpointDescription('_get_alias', { + methods: ["GET"], + patterns: [ + "_alias", + "{indices}/_alias", + "{indices}/_alias/{name}", + "_alias/{name}" + ] + }); + + api.addGlobalAutocompleteRules('aliases', { + '*': aliasRules + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/cat.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/cat.js new file mode 100644 index 0000000..af8a496 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/cat.js @@ -0,0 +1,56 @@ +let _ = require("lodash"); + +function addSimpleCat(endpoint, api, params, patterns) { + var url_params = {"help": "__flag__", "v": "__flag__", "bytes": ["b"]}; + _.each(params || [], function (p) { + if (_.isString(p)) { + url_params[p] = "__flag__"; + } + else { + var k = Object.keys(p)[0]; + url_params[k] = p[k]; + } + }); + api.addEndpointDescription(endpoint, { + match: endpoint, + url_params: url_params, + patterns: patterns || [endpoint] + }); +} + +function addNodeattrsCat(api) { + api.addEndpointDescription('_cat/nodeattrs', { + methods: ['GET'], + patterns: [ + "_cat/nodeattrs" + ], + url_params: { + help: "__flag__", + v: "__flag__", + h: ["node", "name", "id", "nodeId", "pid", "p", "host", "h", "ip", "i", "port", "po", "attr", "attr.name", "value", "attr.value"] + } + }); +} + +module.exports = function (api) { + addSimpleCat('_cat/aliases', api); + addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']); + addSimpleCat('_cat/count', api); + addSimpleCat('_cat/health', api, [ + {"ts": ["false", "true"]} + ]); + addSimpleCat('_cat/indices', api, [ + {h: []}, + "pri", + ], + ['_cat/indices', '_cat/indices/{indices}']); + addSimpleCat('_cat/master', api); + addSimpleCat('_cat/nodes', api); + addSimpleCat('_cat/pending_tasks', api); + addSimpleCat('_cat/recovery', api); + addSimpleCat('_cat/thread_pool', api); + addSimpleCat('_cat/shards', api); + addSimpleCat('_cat/plugins', api); + addSimpleCat('_cat/segments', api); + addNodeattrsCat(api); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/cluster.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/cluster.js new file mode 100644 index 0000000..a6519e8 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/cluster.js @@ -0,0 +1,142 @@ +module.exports = function (api) { + api.addEndpointDescription('_cluster/nodes/stats'); + api.addEndpointDescription('_cluster/state', { + patterns: [ + "_cluster/state", + "_cluster/state/{metrics}", + "_cluster/state/{metrics}/{indices}" + ], + url_components: { + "metrics": ["version", "master_node", "nodes", "routing_table", "routing_node", "metadata", "blocks"] + } + }); + api.addEndpointDescription('_cluster/health', { + url_params: { + "local": "__flag__", + "level": ["indices", "shards"], + "master_timeout": "30s", + "timeout": "30s", + "wait_for_status": ["yellow", "green"], + "wait_for_relocating_shards": 0, + "wait_for_active_shards": 0, + "wait_for_nodes": 0 + } + }); + api.addEndpointDescription('_cluster/pending_tasks'); + api.addEndpointDescription('get_cluster/settings', { + patterns: [ + '_cluster/settings' + ] + }); + + api.addEndpointDescription('put_cluster/settings', { + methods: ['PUT'], + patterns: [ + '_cluster/settings' + ], + data_autocomplete_rules: { + persistent: { + cluster: { + routing: { + 'allocation.enable': {__one_of: ["all", "primaries", "new_primaries", "none"]}, + 'allocation.disk.threshold_enabled': {__one_of: [false, true]}, + 'allocation.disk.watermark.low': '85%', + 'allocation.disk.watermark.high': '90%', + 'allocation.disk.include_relocations': {__one_of: [true, false]}, + 'allocation.disk.reroute_interval': '60s', + 'allocation.exclude': { + '_ip': "", + '_name': "", + '_host': "", + '_id': "" + }, + 'allocation.include': { + '_ip': "", + '_name': "", + '_host': "", + '_id': "" + }, + 'allocation.require': { + '_ip': "", + '_name': "", + '_host': "", + '_id': "" + }, + 'allocation.awareness.attributes': [], + 'allocation.awareness.force': { + '*': { + 'values': [] + } + }, + 'allocation.allow_rebalance': {__one_of: ['always', 'indices_primaries_active', 'indices_all_active']}, + 'allocation.cluster_concurrent_rebalance': 2, + 'allocation.node_initial_primaries_recoveries': 4, + 'allocation.node_concurrent_recoveries': 2, + 'allocation.same_shard.host': {__one_of: [false, true]} + } + }, + indices: { + breaker: { + "total.limit": "70%", + "fielddata.limit": "60%", + "fielddata.overhead": 1.03, + "request.limit": "40%", + "request.overhead": 1.0 + } + } + }, + transient: { + __scope_link: '.persistent' + } + } + }); + + api.addEndpointDescription('_cluster/reroute', { + methods: ['POST'], + url_params: { + explain: "__flag__", + dry_run: "__flag__" + }, + data_autocomplete_rules: { + commands: [ + { + move: { + __template: { + index: "", + shard: 0, + from_node: "", + to_node: "" + }, + index: "{index}", + shard: 0, + from_node: "{node}", + to_node: "{node}" + }, + cancel: { + __template: { + index: "", + shard: 0, + node: "" + }, + index: "{index}", + shard: 0, + node: "{node}", + allow_primary: {__one_of: [true, false]} + }, + allocate: { + __template: { + index: "", + shard: 0, + node: "" + }, + index: "{index}", + shard: 0, + node: "{node}", + allow_primary: {__one_of: [true, false]} + } + } + ], + dry_run: {__one_of: [true, false]} + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/count.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/count.js new file mode 100644 index 0000000..6bbcb3a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/count.js @@ -0,0 +1,22 @@ +module.exports = function (api) { + api.addEndpointDescription('_count', { + methods: ['GET', 'POST'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/{types}/_count", + "{indices}/_count", + "_count" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + min_score: 1.0, + terminate_after: 10, + }, + data_autocomplete_rules: { + query: { + // populated by a global rule + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/document.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/document.js new file mode 100644 index 0000000..f54c025 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/document.js @@ -0,0 +1,235 @@ +module.exports = function (api) { + api.addEndpointDescription('_get_doc', { + methods: ['GET'], + patterns: [ + "{index}/{type}/{id}" + ], + url_params: { + "version": 1, + "routing": "", + "parent": "", + "_source": "", + "_source_exclude": "", + "_source_include": "" + } + }); + api.addEndpointDescription('_get_doc_source', { + methods: ['GET'], + patterns: [ + "{index}/{type}/{id}/_source" + ], + url_params: { + "version": 1, + "routing": "", + "parent": "", + "_source_exclude": "", + "_source_include": "" + } + }); + api.addEndpointDescription('_delete_doc', { + methods: ['DELETE'], + patterns: [ + "{index}/{type}/{id}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "routing": "", + "parent": "" + } + }); + api.addEndpointDescription('index_doc', { + methods: ['PUT', 'POST'], + patterns: [ + "{index}/{type}/{id}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "op_type": ["create"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "refresh": "__flag__", + "timeout": "1m" + } + }); + api.addEndpointDescription('create_doc', { + methods: ['PUT', 'POST'], + patterns: [ + "{index}/{type}/{id}/_create" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "refresh": "__flag__", + "timeout": "1m" + } + }); + api.addEndpointDescription('index_doc_no_id', { + methods: ['POST'], + patterns: [ + "{index}/{type}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "refresh": "__flag__", + "timeout": "1m" + } + }); + + api.addEndpointDescription('_update', { + methods: ['POST'], + patterns: [ + "{index}/{type}/{id}/_update" + ], + url_params: { + "version": 1, + "version_type": ["force", "internal"], + "routing": "", + "parent": "", + "timestamp": "", + "consistency": ["qurom", "one", "all"], + "refresh": "__flag__", + "timeout": "1m", + "retry_on_conflict": 3, + "fields": "" + }, + data_autocomplete_rules: { + "script": { + // populated by a global rule + }, + "doc": {}, + "upsert": {}, + "scripted_upsert": {__one_of: [true, false]} + } + + }); + + api.addEndpointDescription('_put_script', { + methods: ['POST', 'PUT'], + patterns: [ + "_scripts/{lang}/{id}", + "_scripts/{lang}/{id}/_create" + ], + url_components: { + "lang": [ + "groovy", + "expressions" + ] + }, + data_autocomplete_rules: { + "script": "" + } + }); + + api.addEndpointDescription('_termvectors', { + methods: ['GET', 'POST'], + patterns: [ + "{index}/{type}/_termvectors" + ], + priority: 10, // collision with get doc + url_params: { + "fields": "", + "offsets": "__flag__", + "payloads": "__flag__", + "positions": "__flag__", + "term_statistics": "__flag__", + "field_statistics": "__flag__", + "routing": "", + "version": 1, + "version_type": ["external", "external_gt", "external_gte", "force", "internal"], + "parent": "", + "preference": "", + "dfs": "__flag__" + }, + data_autocomplete_rules: { + fields: [ + "{field}" + ], + offsets: {__one_of: [false, true]}, + payloads: {__one_of: [false, true]}, + positions: {__one_of: [false, true]}, + term_statistics: {__one_of: [true, false]}, + field_statistics: {__one_of: [false, true]}, + dfs: {__one_of: [true, false]}, + per_field_analyzer: { + __template: {"FIELD": ""}, + "{field}": "" + }, + routing: "", + version: 1, + version_type: ["external", "external_gt", "external_gte", "force", "internal"], + doc: {}, + filter: { // TODO: Exclude from global filter rules + "max_num_terms": 1, + "min_term_freq": 1, + "max_term_freq": 1, + "min_doc_freq": 1, + "max_doc_freq": 1, + "min_word_length": 1, + "max_word_length": 1 + } + } + }); + api.addEndpointDescription('_termvectors_id', { + methods: ['GET', 'POST'], + patterns: [ + "{index}/{type}/{id}/_termvectors" + ], + url_params: { + "fields": "", + "offsets": "__flag__", + "payloads": "__flag__", + "positions": "__flag__", + "term_statistics": "__flag__", + "field_statistics": "__flag__", + "routing": "", + "version": 1, + "version_type": ["external", "external_gt", "external_gte", "force", "internal"], + "parent": "", + "preference": "", + "dfs": "__flag__" + }, + data_autocomplete_rules: { + fields: [ + "{field}" + ], + offsets: {__one_of: [false, true]}, + payloads: {__one_of: [false, true]}, + positions: {__one_of: [false, true]}, + term_statistics: {__one_of: [true, false]}, + field_statistics: {__one_of: [false, true]}, + dfs: {__one_of: [true, false]}, + per_field_analyzer: { + __template: {"FIELD": ""}, + "{field}": "" + }, + routing: "", + version: 1, + version_type: ["external", "external_gt", "external_gte", "force", "internal"], + filter: { // TODO: Exclude from global filter rules + "max_num_terms": 1, + "min_term_freq": 1, + "max_term_freq": 1, + "min_doc_freq": 1, + "max_doc_freq": 1, + "min_word_length": 1, + "max_word_length": 1 + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js new file mode 100644 index 0000000..58c35e6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js @@ -0,0 +1,47 @@ +module.exports = function (api) { + api.addEndpointDescription('_field_stats', { + methods: ['GET', 'POST'], + patterns: [ + "_field_stats", + "{indices}/_field_stats" + ], + url_params: { + fields: [], + level: ["cluster", "indices"], + ignore_unavailable: ["true", "false"], + allow_no_indices: [false, true], + expand_wildcards: ["open", "closed", "none", "all"] + }, + data_autocomplete_rules: { + fields: [ + "{field}", + ], + index_constraints: { + "{field}": { + min_value: { + gt: "MIN", + gte: "MAX", + lt: "MIN", + lte: "MAX" + }, + max_value: { + gt: "MIN", + gte: "MAX", + lt: "MIN", + lte: "MAX" + } + }, + __template: { + "FIELD": { + min_value: { + gt: "MIN" + }, + max_value: { + lt: "MAX" + } + } + } + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/filter.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/filter.js new file mode 100644 index 0000000..877c049 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/filter.js @@ -0,0 +1,336 @@ +var filters = {}; + +filters.and = { + __template: { + filters: [ + {} + ] + }, + filters: [ + { + __scope_link: '.' + } + ], +}; + + +filters.bool = { + __scope_link: 'GLOBAL.query' +}; + + +filters.exists = { + __template: { + 'field': 'FIELD_NAME' + }, + 'field': '{field}' +}; + + +filters.ids = { + __template: { + 'values': ['ID'] + }, + 'type': '{type}', + 'values': [''] +}; + + +filters.limit = { + __template: { + value: 100 + }, + value: 100 +}; + + +filters.type = { + __template: { + value: 'TYPE' + }, + value: '{type}' +}; + + +filters.geo_bounding_box = { + __template: { + 'FIELD': { + 'top_left': { + 'lat': 40.73, + 'lon': -74.1 + }, + 'bottom_right': { + 'lat': 40.717, + 'lon': -73.99 + } + } + }, + + '{field}': { + top_left: { + lat: 40.73, + lon: -74.1 + }, + bottom_right: { + lat: 40.73, + lon: -74.1 + } + }, + type: { + __one_of: ['memory', 'indexed'] + }, +}; + + +filters.geo_distance = { + __template: { + distance: 100, + distance_unit: 'km', + 'FIELD': { + lat: 40.73, + lon: -74.1 + } + }, + distance: 100, + distance_unit: { + __one_of: ['km', 'miles'] + }, + distance_type: { + __one_of: ['arc', 'plane'] + }, + optimize_bbox: { + __one_of: ['memory', 'indexed', 'none'] + }, + '{field}': { + lat: 40.73, + lon: -74.1 + }, +}; + + +filters.geo_distance_range = { + __template: { + from: 100, + to: 200, + distance_unit: 'km', + 'FIELD': { + lat: 40.73, + lon: -74.1 + } + }, + from: 100, + to: 200, + + distance_unit: { + __one_of: ['km', 'miles'] + }, + distance_type: { + __one_of: ['arc', 'plane'] + }, + include_lower: { + __one_of: [true, false] + }, + include_upper: { + __one_of: [true, false] + }, + + '{field}': { + lat: 40.73, + lon: -74.1 + } +}; + + +filters.geo_polygon = { + __template: { + 'FIELD': { + 'points': [ + { + lat: 40.73, + lon: -74.1 + }, + { + lat: 40.83, + lon: -75.1 + } + ] + } + }, + '{field}': { + points: [ + { + lat: 40.73, + lon: -74.1 + } + ] + } +}; + + +filters.geo_shape = { + __template: { + 'FIELD': { + shape: { + type: 'envelope', + coordinates: [ + [-45, 45], + [45, -45] + ] + }, + 'relation': 'within' + } + }, + '{field}': { + shape: { + type: '', + coordinates: [] + }, + indexed_shape: { + id: '', + index: '{index}', + type: '{type}', + shape_field_name: 'shape' + }, + relation: { + __one_of: ['within', 'intersects', 'disjoint'] + } + } +}; + + +filters.has_child = { + __template: { + type: 'TYPE', + filter: {} + }, + type: '{type}', + query: {}, + filter: {}, + _scope: '', + min_children: 1, + max_children: 10 +}; + + +filters.has_parent = { + __template: { + parent_type: 'TYPE', + filter: {} + }, + parent_type: '{type}', + query: {}, + filter: {}, + _scope: '' +}; + + +filters.m = filters.missing = { + __template: { + field: 'FIELD' + }, + existence: { + __one_of: [true, false] + }, + null_value: { + __one_of: [true, false] + }, + field: '{field}' +}; + + +filters.not = { + __template: { + filter: {} + }, + filter: {} +}; + + +filters.range = { + __template: { + 'FIELD': { + gte: 10, + lte: 20 + } + }, + "{field}": { + gte: 1, + gt: 1, + lte: 20, + lt: 20, + time_zone: "+1:00", + "format": "dd/MM/yyyy||yyyy", + execution: {__one_of: ["index", "fielddata"]} + } +}; + + +filters.or = { + __template: { + filters: [ + {} + ] + }, + filters: [ + { + __scope_link: '.' + } + ] +}; + + +filters.prefix = { + __template: { + 'FIELD': 'VALUE' + }, + '{field}': '' +}; + + +filters.query = { + // global query +}; + +filters.script = { + __template: { + script: {} + }, + script: { + // populated by a global rule + } +}; + + +filters.term = { + __template: { + 'FIELD': 'VALUE' + }, + '{field}': '' +}; + + +filters.terms = { + __template: { + 'FIELD': ['VALUE1', 'VALUE2'] + }, + field: ['{field}'], + execution: { + __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache'] + } +}; + + +filters.nested = { + __template: { + path: 'path_to_nested_doc', + query: {} + }, + query: {}, + path: '', + _name: '' +}; + +module.exports = function (api) { + api.addGlobalAutocompleteRules('filter', filters); +}; + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/globals.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/globals.js new file mode 100644 index 0000000..e8cd849 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/globals.js @@ -0,0 +1,24 @@ +module.exports = function (api) { + api.addGlobalAutocompleteRules('highlight', { + pre_tags: {}, + post_tags: {}, + tags_schema: {}, + fields: { + '{field}': { + fragment_size: 20, + number_of_fragments: 3 + } + } + }); + + api.addGlobalAutocompleteRules('script', { + __template: { + inline: "SCRIPT" + }, + inline: "SCRIPT", + file: "FILE_SCRIPT_NAME", + id: "SCRIPT_ID", + lang: "", + params: {} + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/indices.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/indices.js new file mode 100644 index 0000000..9058daa --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/indices.js @@ -0,0 +1,209 @@ +module.exports = function (api) { + api.addEndpointDescription('_refresh', { + methods: ['POST'], + patterns: [ + "_refresh", + "{indices}/_refresh" + ], + }); + + api.addEndpointDescription('_flush', { + methods: ['POST'], + patterns: [ + "_flush", + "{indices}/_flush" + ], + url_params: { + wait_if_ongoing: [true, false], + force: [true, false] + } + }); + + api.addEndpointDescription('_flush_synced', { + methods: ['POST'], + patterns: [ + "_flush/synced", + "{indices}/_flush/synced" + ] + }); + + api.addEndpointDescription('_stats', { + patterns: [ + "_stats", + "_stats/{metrics}", + "{indices}/_stats", + "{indices}/_stats/{metrics}", + ], + url_components: { + "metrics": [ + "docs", + "store", + "indexing", + "search", + "get", + "merge", + "refresh", + "flush", + "warmer", + "filter_cache", + "percolate", + "segments", + "fielddata", + "completion", + "translog", + "query_cache", + "commit", + "_all" + ] + }, + url_params: { + "fields": [], + "types": [], + "completion_fields": [], + "fielddata_fields": [], + "level": ["cluster", "indices", "shards"] + } + + }); + + api.addEndpointDescription('_segments', { + patterns: [ + "{indices}/_segments", + "_segments" + ] + }); + + api.addEndpointDescription('_recovery', { + patterns: [ + "{indices}/_recovery", + "_recovery" + ], + url_params: { + detailed: "__flag__", + active_only: "__flag__", + human: "__flag__" + } + }); + + api.addEndpointDescription('_analyze', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/_analyze", + "_analyze" + ], + url_params: { + "analyzer": "", + "char_filters": [], + "field": "", + "filters": [], + "text": "", + "tokenizer": "" + } + }); + + api.addEndpointDescription('_validate_query', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/_validate/query", + "_validate/query" + ], + url_params: { + explain: "__flag__", + rewrite: "__flag__" + }, + data_autocomplete_rules: { + query: { + // populated by a global rule + } + } + }); + + api.addEndpointDescription('_shard_stores', { + methods: ['GET'], + patterns: [ + "{indices}/_shard_stores", + "_shard_stores" + ], + url_params: { + status: ["green", "yellow", "red", "all"] + } + }); + + api.addEndpointDescription('__create_index__', { + methods: ['PUT'], + patterns: [ + "{index}" + ], + data_autocomplete_rules: { + mappings: { + __scope_link: '_put_mapping' + }, + settings: { + __scope_link: '_put_settings' + }, + aliases: { + __template: { + "NAME": {} + } + } + } + }); + + api.addEndpointDescription('__delete_indices__', { + methods: ['DELETE'], + patterns: [ + "{indices}" + ] + }); + + api.addEndpointDescription('_get_index_settings', { + methods: ['GET',], + patterns: [ + "{indices}/_settings", + ], + url_params: { + flat_settings: "__flag__" + } + }); + + api.addEndpointDescription('_get_index', { + methods: ['GET',], + patterns: [ + "{indices}", + "{indices}/{feature}" + ], + url_components: { + "feature": [ + "_mappings", + "_warmers", + "_aliases" + ] + } + }); + + api.addEndpointDescription('_cache/clear', { + patterns: [ + "_cache/clear", + "{indices}/_cache/clear" + ] + }); + + api.addEndpointDescription('_upgrade', { + methods: ["POST"], + patterns: [ + "_upgrade", + "{indices}/_upgrade" + ], + url_params: { + wait_for_completion: "__flag__" + } + }); + + api.addEndpointDescription('_upgrade_status', { + methods: ["GET"], + patterns: [ + "_upgrade", + "{indices}/_upgrade" + ] + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/mappings.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/mappings.js new file mode 100644 index 0000000..5bb075f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/mappings.js @@ -0,0 +1,237 @@ +let _ = require("lodash"); + +var INDEX_SETTING = { + __one_of: ['analyzed', 'not_analyzed', 'no'] +}, BOOLEAN = { + __one_of: [true, false] +}; + +module.exports = function (api) { + api.addEndpointDescription('_get_mapping', { + methods: ['GET'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/_mapping", + "{indices}/_mapping/{types}", + "{indices}/{types}/_mapping", + "_mapping" + ] + }); + api.addEndpointDescription('_get_field_mapping', { + methods: ['GET'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/_mapping/field/{fields}", + "{indices}/_mapping/{type}/field/{fields}" + ], + url_params: { + "include_defaults": "__flag__" + } + }); + api.addEndpointDescription('_delete_mapping', { + methods: ['DELETE'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/_mapping", + "{indices}/_mapping/{types}", + "{indices}/{types}/_mapping", + "_mapping" + ] + }); + api.addEndpointDescription('_put_type_mapping', { + methods: ['PUT', 'POST'], + patterns: [ + "{indices}/{type}/_mapping", + "{indices}/_mapping/{type}" + ], + priority: 10, // collides with put doc by id + data_autocomplete_rules: { + __template: { + properties: { + 'FIELD': {} + } + }, + '_source': { + 'enabled': BOOLEAN + }, + '_all': { + 'enabled': BOOLEAN + }, + '_field_names': { + 'index': INDEX_SETTING + }, + '_routing': { + 'required': BOOLEAN, + }, + '_index': { + 'enabled': BOOLEAN + }, + '_parent': { + __template: { + 'type': '' + }, + 'type': '{type}' + }, + '_timestamp': { + 'enabled': BOOLEAN, + 'format': 'YYYY-MM-dd', + 'default': "" + }, + 'dynamic_date_formats': ['yyyy-MM-dd'], + 'date_detection': BOOLEAN, + 'numeric_detection': BOOLEAN, + 'transform': { + __template: { + script: {} + }, + __one_of: [ + { + __scope_link: "GLOBAL.script" + }, + [ + { + __scope_link: "GLOBAL.script" + } + ] + ] + + + }, + 'properties': { + '*': { + type: { + __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean', + 'binary', 'object', 'nested', "geo_point", "geo_shape" + ] + }, + + // strings + store: BOOLEAN, + index: INDEX_SETTING, + term_vector: { + __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets'] + }, + boost: 1.0, + null_value: '', + omit_norms: { + __one_of: [true, false] + }, + index_options: { + __one_of: ['docs', 'freqs', 'positions'] + }, + analyzer: 'standard', + search_analyzer: 'standard', + include_in_all: { + __one_of: [false, true] + }, + ignore_above: 10, + position_increment_gap: 0, + + // numeric + precision_step: 4, + ignore_malformed: BOOLEAN, + + // geo_point + lat_lon: { + __one_of: [true, false] + }, + geohash: { + __one_of: [true, false] + }, + geohash_precision: '1m', + geohash_prefix: { + __one_of: [true, false] + }, + validate: { + __one_of: [true, false] + }, + validate_lat: { + __one_of: [true, false] + }, + validate_lon: { + __one_of: [true, false] + }, + normalize: { + __one_of: [true, false] + }, + normalize_lat: { + __one_of: [true, false] + }, + normalize_lon: { + __one_of: [true, false] + }, + + // geo_shape + tree: { + __one_of: ['geohash', 'quadtree'] + }, + precision: '5km', + tree_levels: 12, + distance_error_pct: 0.025, + orientation: 'ccw', + + // dates + format: { + __one_of: _.flatten([_.map(['date', 'date_time', 'date_time_no_millis', + 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', + 'time', 'time_no_millis', 't_time', 't_time_no_millis', + 'week_date', 'week_date_time', 'week_date_time_no_millis'], function (s) { + return ['basic_' + s, 'strict_' + s]; + }), + [ + 'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction', + 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis', + 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis', + 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis', + 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year', + 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second' + ]]) + }, + + fielddata: { + filter: { + regex: '', + frequency: { + min: 0.001, + max: 0.1, + min_segment_size: 500 + } + } + }, + similarity: { + __one_of: ['default', 'BM25'] + }, + + // objects + properties: { + __scope_link: '_put_mapping.{type}.properties' + }, + + // multi_field + fields: { + '*': { + __scope_link: '_put_mapping.type.properties.field' + } + }, + copy_to: {__one_of: ['{field}', ['{field}']]}, + + // nested + include_in_parent: BOOLEAN, + include_in_root: BOOLEAN + } + } + } + + }); + api.addEndpointDescription('_put_mapping', { + methods: ['PUT'], + patterns: [ + "{indices}/_mapping" + ], + data_autocomplete_rules: { + '{type}': { + __scope_link: '_put_type_mapping' + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/nodes.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/nodes.js new file mode 100644 index 0000000..a3c4799 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/nodes.js @@ -0,0 +1,76 @@ +module.exports = function (api) { + api.addEndpointDescription('_nodes/hot_threads', { + methods: ['GET'], + patterns: [ + "_nodes/hot_threads", + "_nodes/{nodes}/hot_threads" + ] + }); + api.addEndpointDescription('_nodes/info', { + patterns: [ + "_nodes", + "_nodes/{metrics}", + "_nodes/{nodes}", + "_nodes/{nodes}/{metrics}", + "_nodes/{nodes}/info/{metrics}" + ], + url_components: { + "metrics": [ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "network", + "transport", + "http", + "plugins", + "_all" + ] + } + }); + api.addEndpointDescription('_nodes/stats', { + patterns: [ + "_nodes/stats", + "_nodes/stats/{metrics}", + "_nodes/stats/{metrics}/{index_metric}", + "_nodes/{nodes}/stats", + "_nodes/{nodes}/stats/{metrics}", + "_nodes/{nodes}/stats/{metrics}/{index_metric}" + ], + url_components: { + "metrics": [ + "os", + "jvm", + "thread_pool", + "network", + "fs", + "transport", + "http", + "indices", + "process", + "breaker", + "_all" + ], + "index_metric": [ + "store", + "indexing", + "get", + "search", + "merge", + "flush", + "refresh", + "filter_cache", + "fielddata", + "docs", + "warmer", + "percolate", + "completion", + "segments", + "translog", + "query_cache", + "_all" + ] + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/percolator.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/percolator.js new file mode 100644 index 0000000..7f100f3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/percolator.js @@ -0,0 +1,90 @@ +module.exports = function (api) { + api.addEndpointDescription('_put_percolator', { + priority: 10, // to override doc + methods: ['PUT', 'POST'], + patterns: [ + "{index}/.percolator/{id}" + ], + url_params: { + "version": 1, + "version_type": ["external", "internal"], + "op_type": ["create"], + "routing": "", + "parent": "", + "timestamp": "", + "ttl": "5m", + "consistency": ["qurom", "one", "all"], + "refresh": "__flag__", + "timeout": "1m" + }, + data_autocomplete_rules: { + query: {} + } + }); + api.addEndpointDescription('_percolate', { + methods: ['GET', 'POST'], + priority: 10, // to override doc + patterns: [ + "{indices}/{type}/_percolate" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + ignore_unavailable: ["true", "false"], + percolate_format: ["ids"] + }, + data_autocomplete_rules: { + doc: {}, + query: {}, + filter: {}, + size: 10, + track_scores: {__one_of: [true, false]}, + sort: "_score", + aggs: {}, + highlight: {} + } + }); + api.addEndpointDescription('_percolate_id', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/{type}/{id}/_percolate" + ], + url_params: { + routing: "", + ignore_unavailable: ["true", "false"], + percolate_format: ["ids"], + percolate_index: "{index}", + percolate_type: "{type}", + percolate_routing: "", + percolate_preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + version: 1, + version_type: ["external", "internal"] + }, + data_autocomplete_rules: { + query: {}, + filter: {}, + size: 10, + track_scores: {__one_of: [true, false]}, + sort: "_score", + aggs: {}, + highlight: {} + } + }); + api.addEndpointDescription('_percolate_count', { + methods: ['GET', 'POST'], + patterns: [ + "{indices}/{type}/_percolate/count" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + ignore_unavailable: ["true", "false"], + percolate_format: ["ids"] + }, + data_autocomplete_rules: { + doc: {}, + query: {}, + filter: {} + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/query.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/query.js new file mode 100644 index 0000000..092cfd6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/query.js @@ -0,0 +1,629 @@ +let _ = require("lodash"); + +var SPAN_QUERIES = { + // TODO add one_of for objects + span_first: { + __scope_link: '.span_first' + }, + span_near: { + __scope_link: '.span_near' + }, + span_or: { + __scope_link: '.span_or' + }, + span_not: { + __scope_link: '.span_not' + }, + span_term: { + __scope_link: '.span_term' + }, + span_containing: { + __scope_link: '.span_containing' + }, + span_within: { + __scope_link: '.span_within' + } +}; + +var DECAY_FUNC_DESC = { + __template: { + "FIELD": { + "origin": "", + "scale": "" + } + }, + "{field}": { + "origin": "", + "scale": "", + "offset": "", + "decay": 0.5 + } + }, + SCORING_FUNCS = { + "script_score": { + __template: { + "script": "_score * doc['f'].value" + }, + "script": { + //populated by a global rule + } + }, + "boost_factor": 2.0, + "random_score": { + "seed": 314159265359 + }, + "linear": DECAY_FUNC_DESC, + "exp": DECAY_FUNC_DESC, + "gauss": DECAY_FUNC_DESC, + "field_value_factor": { + __template: { + "field": "" + }, + "field": "{field}", + "factor": 1.2, + "modifier": { + __one_of: ["none", "log", "log1p", "log2p", "ln", "ln1p", "ln2p", "square", "sqrt", "reciprocal"] + } + } + }; + +module.exports = function (api) { + api.addGlobalAutocompleteRules('query', { + match: { + __template: { + 'FIELD': 'TEXT' + }, + '{field}': { + 'query': '', + 'operator': { + __one_of: ['and', 'or'] + }, + 'type': { + __one_of: ['phrase', 'phrase_prefix', 'boolean'] + }, + 'max_expansions': 10, + 'analyzer': '', + 'fuzziness': 1.0, + 'prefix_length': 1 + } + }, + match_phrase: { + __template: { + 'FIELD': 'PHRASE' + }, + '{field}': { + query: '', + analyzer: '' + } + }, + match_phrase_prefix: { + __template: { + 'FIELD': 'PREFIX' + }, + '{field}': { + query: '', + analyzer: '', + max_expansions: 10, + prefix_length: 1, + fuzziness: 0.1 + } + }, + multi_match: { + __template: { + 'query': '', + 'fields': [] + }, + query: '', + fields: ['{field}'], + use_dis_max: { + __template: true, + __one_of: [true, false] + }, + tie_breaker: 0.0, + type: {__one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix']} + }, + bool: { + must: [ + { + __scope_link: '.' + } + ], + must_not: [ + { + __scope_link: '.' + } + ], + should: [ + { + __scope_link: '.' + } + ], + filter: { + __scope_link: 'GLOBAL.filter' + }, + minimum_number_should_match: 1, + boost: 1.0 + }, + boosting: { + positive: { + __scope_link: '.' + }, + negative: { + __scope_link: '.' + }, + negative_boost: 0.2 + }, + ids: { + type: '', + values: [] + }, + constant_score: { + __template: { + filter: {}, + boost: 1.2 + }, + query: {}, + filter: {}, + boost: 1.2 + }, + dis_max: { + __template: { + tie_breaker: 0.7, + boost: 1.2, + queries: [] + }, + tie_breaker: 0.7, + boost: 1.2, + queries: [ + { + __scope_link: '.' + } + ] + }, + field: { + '{field}': { + query: '', + boost: 2.0, + enable_position_increments: { + __template: false, + __one_of: [true, false] + } + } + }, + filtered: { + __template: { + query: {}, + filter: {} + }, + query: {}, + filter: {} + }, + fuzzy: { + '{field}': { + 'value': '', + 'boost': 1.0, + 'min_similarity': 0.5, + 'prefix_length': 0 + } + }, + has_child: { + __template: { + type: 'TYPE', + query: {} + }, + 'type': '{type}', + 'score_mode': { + __one_of: ['none', 'max', 'sum', 'avg'] + }, + '_scope': '', + 'query': {}, + 'min_children': 1, + 'max_children': 10 + }, + has_parent: { + __template: { + parent_type: 'TYPE', + query: {} + }, + 'parent_type': '{type}', + 'score_mode': { + __one_of: ['none', 'score'] + }, + '_scope': '', + 'query': {} + }, + match_all: {}, + more_like_this: { + __template: { + 'fields': ['FIELD'], + 'like_text': 'text like this one', + 'min_term_freq': 1, + 'max_query_terms': 12 + }, + fields: ['{field}'], + like_text: '', + percent_terms_to_match: 0.3, + min_term_freq: 2, + max_query_terms: 25, + stop_words: [''], + min_doc_freq: 5, + max_doc_freq: 100, + min_word_len: 0, + max_word_len: 0, + boost_terms: 1, + boost: 1.0, + analyzer: '', + docs: [{ + _index: "{index}", + _type: "{type}", + _id: "" + }], + ids: [""] + }, + mlt: { + __template: { + 'fields': ['FIELD'], + 'like_text': 'text like this one', + 'min_term_freq': 1, + 'max_query_terms': 12 + }, + __scope_link: ".more_like_this" + }, + prefix: { + __template: { + 'FIELD': { + 'value': '' + } + }, + '{field}': { + value: '', + boost: 1.0 + } + }, + query_string: { + __template: { + 'default_field': 'FIELD', + 'query': 'this AND that OR thus' + }, + query: '', + default_field: '{field}', + fields: ['{field}'], + default_operator: { + __one_of: ['OR', 'AND'] + }, + analyzer: '', + allow_leading_wildcard: { + __one_of: [true, false] + }, + lowercase_expanded_terms: { + __one_of: [true, false] + }, + enable_position_increments: { + __one_of: [true, false] + }, + fuzzy_max_expansions: 50, + fuzzy_min_sim: 0.5, + fuzzy_prefix_length: 0, + phrase_slop: 0, + boost: 1.0, + analyze_wildcard: { + __one_of: [false, true] + }, + auto_generate_phrase_queries: { + __one_of: [false, true] + }, + minimum_should_match: '20%', + lenient: { + __one_of: [false, true] + }, + use_dis_max: { + __one_of: [true, false] + }, + tie_breaker: 0, + time_zone: "+1:00" + }, + simple_query_string: { + __template: { + query: "", + fields: [] + }, + query: "", + fields: ["{field}"], + default_operator: {__one_of: ["OR", "AND"]}, + analyzer: "", + flags: "OR|AND|PREFIX", + lowercase_expanded_terms: {__one_of: [true, false]}, + locale: "ROOT", + lenient: {__one_of: [true, false]} + }, + range: { + __template: { + 'FIELD': { + gte: 10, + lte: 20 + } + }, + '{field}': { + __template: { + gte: 10, + lte: 20 + }, + gte: 10, + gt: 10, + lte: 20, + lt: 20, + time_zone: "+1:00", + boost: 1.0, + "format": "dd/MM/yyyy||yyyy" + + } + }, + span_first: { + __template: { + 'match': { + 'span_term': { + 'FIELD': 'VALUE' + } + }, + 'end': 3 + }, + match: SPAN_QUERIES + }, + span_near: { + __template: { + 'clauses': [ + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + ], + slop: 12, + in_order: false + }, + clauses: [ + SPAN_QUERIES + ], + slop: 12, + in_order: { + __one_of: [false, true] + }, + collect_payloads: { + __one_of: [false, true] + } + }, + span_term: { + __template: { + 'FIELD': { + 'value': 'VALUE' + } + }, + '{field}': { + value: '', + boost: 2.0 + } + }, + span_not: { + __template: { + include: { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + }, + exclude: { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + }, + include: SPAN_QUERIES, + exclude: SPAN_QUERIES + }, + span_or: { + __template: { + clauses: [ + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + ] + }, + clauses: [ + SPAN_QUERIES + ] + }, + span_containing: { + __template: { + little: { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + }, + big: { + span_near: { + 'clauses': [ + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + }, + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + ], + "slop": 5, + "in_order": false + } + } + }, + little: SPAN_QUERIES, + big: SPAN_QUERIES + }, + span_within: { + __template: { + little: { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + }, + big: { + span_near: { + 'clauses': [ + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + }, + { + span_term: { + 'FIELD': { + 'value': 'VALUE' + } + } + } + ], + "slop": 5, + "in_order": false + } + } + }, + little: SPAN_QUERIES, + big: SPAN_QUERIES + }, + term: { + __template: { + 'FIELD': { + value: 'VALUE' + } + }, + '{field}': { + value: '', + boost: 2.0 + } + }, + terms: { + __template: { + 'FIELD': ['VALUE1', 'VALUE2'] + }, + '{field}': [''], + minimum_match: 1 + }, + wildcard: { + __template: { + 'FIELD': { + value: 'VALUE' + } + }, + '{field}': { + value: '', + boost: 2.0 + } + }, + nested: { + __template: { + path: 'path_to_nested_doc', + query: {} + }, + path: '', + query: {}, + filter: {}, + score_mode: { + __one_of: ['avg', 'total', 'max', 'none'] + } + }, + custom_filters_score: { + __template: { + query: {}, + filters: [ + { + filter: {} + } + ] + }, + query: {}, + filters: [ + { + filter: {}, + boost: 2.0, + script: { + //populated by a global rule + } + } + ], + score_mode: { + __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply'] + }, + max_boost: 2.0, + params: {}, + lang: '' + }, + indices: { + __template: { + indices: ['INDEX1', 'INDEX2'], + query: {} + }, + indices: ['{index}'], + query: {}, + no_match_query: { + __scope_link: '.' + } + }, + geo_shape: { + __template: { + location: {}, + relation: 'within' + }, + __scope_link: '.filter.geo_shape' + }, + // js hint gets confused here + /* jshint -W015 */ + function_score: _.defaults({ + __template: { + query: {}, + functions: [ + {} + ] + }, + query: {}, + filter: {}, + functions: [ + _.defaults( + { + filter: {}, + weight: 1.0 + }, + SCORING_FUNCS + ) + ], + boost: 1.0, + boost_mode: {__one_of: ["multiply", "replace", "sum", "avg", "max", "min"]}, + score_mode: {__one_of: ["multiply", "sum", "first", "avg", "max", "min"]}, + max_boost: 10, + min_score: 1.0 + }, + SCORING_FUNCS + ) + + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/search.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/search.js new file mode 100644 index 0000000..5153eb5 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/search.js @@ -0,0 +1,255 @@ +module.exports = function (api) { + api.addEndpointDescription('_search', { + methods: ['GET', 'POST'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/{types}/_search", + "{indices}/_search", + "_search" + ], + url_params: { + q: "", + df: "", + analyzer: "", + default_operator: ["AND", "OR"], + explain: "__flag__", + _source: "", + _source_include: "", + _source_exclude: "", + fields: [], + sort: "", + track_scores: "__flag__", + timeout: 1, + from: 0, + size: 10, + search_type: ["dfs_query_then_fetch", "dfs_query_and_fetch", "query_then_fetch", "query_and_fetch", "count", "scan"], + terminate_after: 10, + lowercase_expanded_terms: ["true", "false"], + analyze_wildcard: "__flag__", + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + scroll: "5m", + scroll_id: "", + routing: "", + request_cache: ["true", "false"] + }, + data_autocomplete_rules: { + query: { + // populated by a global rule + }, + aggs: { + __template: { + "NAME": { + "AGG_TYPE": {} + } + } + }, + + post_filter: { + __scope_link: 'GLOBAL.filter' + }, + size: { + __template: 20 + }, + from: 0, + sort: { + __template: [ + { + 'FIELD': { + 'order': 'desc' + } + } + ], + __any_of: [ + { + '{field}': { + 'order': { + __one_of: ['desc', 'asc'] + }, + missing: { + __one_of: ['_last', '_first'] + }, + mode: { + __one_of: ['min', 'max', 'avg', 'sum'] + }, + nested_path: "", + nested_filter: { + __scope_link: "GLOBAL.filter" + } + } + }, + '{field}', + '_score', + { + '_geo_distance': { + __template: { + "FIELD": { + lat: 40, + lon: -70 + }, + order: "asc" + }, + "{field}": { + __one_of: [ + { + __template: { + lat: 40, + lon: -70 + }, + lat: 40, + lon: -70 + }, + [ + { + __template: { + lat: 40, + lon: -70 + }, + lat: 40, + lon: -70 + } + ], + [""], + "" + ] + }, + distance_type: {__one_of: ["sloppy_arc", "arc", "plane"]}, + sort_mode: {__one_of: ["min", "max", "avg"]}, + order: {__one_of: ["asc", "desc"]}, + unit: "km" + } + } + ] + }, + fields: ['{field}'], + fielddata_fields: ["{field}"], + script_fields: { + __template: { + 'FIELD': { + 'script': { + // populated by a global rule + } + } + }, + '*': { + __scope_link: 'GLOBAL.script' + } + }, + partial_fields: { + __template: { + 'NAME': { + include: [] + } + }, + '*': { + include: [], + exclude: [] + } + }, + highlight: { + // populated by a global rule + }, + _source: { + __one_of: [ + "{field}", + ["{field}"], + { + "include": { + __one_of: [ + "{field}", + ["{field}"] + ] + }, + "exclude": { + __one_of: [ + "{field}", + ["{field}"] + ] + } + } + ] + }, + explain: { + __one_of: [true, false] + }, + stats: [''], + timeout: "1s", + version: {__one_of: [true, false]} + } + }); + + api.addEndpointDescription('_search_template', { + methods: ['GET'], + patterns: [ + "{indices}/{types}/_search/template", + "{indices}/_search/template", + "_search/template" + ], + data_autocomplete_rules: { + "template": { + __one_of: [ + {__scope_link: "_search"}, + {__scope_link: "GLOBAL.script"} + ] + }, + "params": {} + } + }); + + api.addEndpointDescription('_render_search_template', { + methods: ['GET'], + patterns: [ + "_render/template" + ], + data_autocomplete_rules: { + __one_of: [ + {"inline": {__scope_link: "_search"}}, + {__scope_link: "GLOBAL.script"} + ], + "params": {} + } + }); + + api.addEndpointDescription('_render_search_template_with_id', { + methods: ['GET'], + patterns: [ + "_render/template/{id}" + ], + data_autocomplete_rules: { + "params": {} + } + }); + + api.addEndpointDescription('_get_delete_search_template', { + methods: ['GET', 'DELETE'], + patterns: [ + "_search/template/{id}" + ] + }); + + api.addEndpointDescription('_put_search_template', { + methods: ['PUT'], + patterns: [ + "_search/template/{id}" + ], + data_autocomplete_rules: { + "template": { + __scope_link: "_search" + } + } + }); + + api.addEndpointDescription('_search_shards', { + methods: ['GET'], + priority: 10, // collides with get doc by id + patterns: [ + "{indices}/{types}/_search_shards", + "{indices}/_search_shards", + "_search_shards" + ], + url_params: { + preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"], + routing: "", + local: "__flag__" + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/settings.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/settings.js new file mode 100644 index 0000000..1cfdcad --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/settings.js @@ -0,0 +1,86 @@ +module.exports = function (api) { + + api.addEndpointDescription('_get_settings', { + patterns: [ + "{indices}/_settings", + "_settings" + ], + url_params: { + flat_settings: "__flag__" + } + }); + api.addEndpointDescription('_put_settings', { + methods: ['PUT'], + patterns: [ + "{indices}/_settings", + "_settings" + ], + data_autocomplete_rules: { + refresh_interval: '1s', + number_of_shards: 5, + number_of_replicas: 1, + 'blocks.read_only': { + __one_of: [false, true] + }, + 'blocks.read': { + __one_of: [true, false] + }, + 'blocks.write': { + __one_of: [true, false] + }, + 'blocks.metadata': { + __one_of: [true, false] + }, + term_index_interval: 32, + term_index_divisor: 1, + 'translog.flush_threshold_ops': 5000, + 'translog.flush_threshold_size': '200mb', + 'translog.flush_threshold_period': '30m', + 'translog.disable_flush': { + __one_of: [true, false] + }, + 'cache.filter.max_size': '2gb', + 'cache.filter.expire': '2h', + 'gateway.snapshot_interval': '10s', + routing: { + allocation: { + include: { + tag: '' + }, + exclude: { + tag: '' + }, + require: { + tag: '' + }, + total_shards_per_node: -1 + } + }, + 'recovery.initial_shards': { + __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1'] + }, + 'ttl.disable_purge': { + __one_of: [true, false] + }, + analysis: { + analyzer: {}, + tokenizer: {}, + filter: {}, + char_filter: {} + }, + 'cache.query.enable': { + __one_of: [true, false] + }, + shadow_replicas: { + __one_of: [true, false] + }, + shared_filesystem: { + __one_of: [true, false] + }, + data_path: 'path', + codec: { + __one_of: ['default', 'best_compression', 'lucene_default'] + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js new file mode 100644 index 0000000..4e681ea --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js @@ -0,0 +1,153 @@ +module.exports = function (api) { + api.addEndpointDescription('restore_snapshot', { + methods: ['POST'], + patterns: [ + '_snapshot/{id}/{id}/_restore' + ], + url_params: { + wait_for_completion: "__flag__" + }, + data_autocomplete_rules: { + indices: "*", + ignore_unavailable: {__one_of: [true, false]}, + include_global_state: false, + rename_pattern: "index_(.+)", + rename_replacement: "restored_index_$1" + } + }); + + + api.addEndpointDescription('single_snapshot', { + methods: ['GET', 'DELETE'], + patterns: [ + '_snapshot/{id}/{id}' + ] + }); + + api.addEndpointDescription('all_snapshots', { + methods: ['GET'], + patterns: [ + '_snapshot/{id}/_all' + ] + }); + + api.addEndpointDescription('put_snapshot', { + methods: ['PUT'], + patterns: [ + '_snapshot/{id}/{id}' + ], + url_params: { + wait_for_completion: "__flag__" + }, + data_autocomplete_rules: { + indices: "*", + ignore_unavailable: {__one_of: [true, false]}, + include_global_state: {__one_of: [true, false]}, + partial: {__one_of: [true, false]} + } + }); + + api.addEndpointDescription('_snapshot_status', { + methods: ['GET'], + patterns: [ + '_snapshot/_status', + '_snapshot/{id}/_status', + '_snapshot/{id}/{ids}/_status' + ] + }); + + + function getRepositoryType(context, editor) { + var iter = editor.iterForCurrentLoc(); + // for now just iterate back to the first "type" key + var t = iter.getCurrentToken(); + var type; + while (t && t.type.indexOf("url") < 0) { + if (t.type === 'variable' && t.value === '"type"') { + t = editor.parser.nextNonEmptyToken(iter); + if (!t || t.type !== "punctuation.colon") { + // weird place to be in, but safe choice.. + break; + } + t = editor.parser.nextNonEmptyToken(iter); + if (t && t.type === "string") { + type = t.value.replace(/"/g, ''); + } + break; + } + t = editor.parser.prevNonEmptyToken(iter); + } + return type; + } + + api.addEndpointDescription('put_repository', { + methods: ['PUT'], + patterns: [ + '_snapshot/{id}' + ], + data_autocomplete_rules: { + __template: {"type": ""}, + + "type": { + __one_of: ["fs", "url", "s3", "hdfs"] + }, + "settings": { + __one_of: [{ + //fs + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']fs` + }, + __template: { + location: "path" + }, + location: "path", + compress: {__one_of: [true, false]}, + concurrent_streams: 5, + chunk_size: "10m", + max_restore_bytes_per_sec: "20mb", + max_snapshot_bytes_per_sec: "20mb" + }, + {// url + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']url` + }, + __template: { + url: "" + }, + url: "", + concurrent_streams: 5 + }, + { //s3 + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']s3` + }, + __template: { + bucket: "" + }, + bucket: "", + region: "", + base_path: "", + concurrent_streams: 5, + chunk_size: "10m", + compress: {__one_of: [true, false]} + }, + {// hdfs + __condition: { + lines_regex: String.raw`type["']\s*:\s*["']hdfs` + }, + __template: { + path: "" + }, + uri: "", + path: "some/path", + load_defaults: {__one_of: [true, false]}, + conf_location: "cfg.xml", + concurrent_streams: 5, + compress: {__one_of: [true, false]}, + chunk_size: "10m" + } + ] + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/templates.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/templates.js new file mode 100644 index 0000000..635256c --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/templates.js @@ -0,0 +1,27 @@ +module.exports = function (api) { + api.addEndpointDescription('_delete_template', { + methods: ['DELETE'], + patterns: [ + "_template/{id}", + ] + }); + api.addEndpointDescription('_get_template', { + methods: ['GET'], + patterns: [ + "_template/{id}", + "_template", + ] + }); + api.addEndpointDescription('_put_template', { + methods: ['PUT'], + patterns: [ + "_template/{id}", + ], + data_autocomplete_rules: { + template: 'index*', + warmers: {__scope_link: '_warmer'}, + mappings: {__scope_link: '_put_mapping'}, + settings: {__scope_link: '_put_settings'} + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/warmers.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/warmers.js new file mode 100644 index 0000000..9984512 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/es_2_0/warmers.js @@ -0,0 +1,30 @@ +module.exports = function (api) { + api.addEndpointDescription('_get_warmer', { + patterns: ["_warmer", "_warmer/{name}", "{indices}/_warmer", "{indices}/_warmer/{name}"] + }); + api.addEndpointDescription('_delete_warmer', { + methods: ['DELETE'], + patterns: [ + "{indices}/_warmer/{name}" + ] + }); + api.addEndpointDescription('_put_warmer', { + methods: ['PUT'], + patterns: [ + "{indices}/_warmer/{name}", + "{indices}/{types}/_warmer/{name}" + ], + data_autocomplete_rules: { + query: { + // populated by a global rule + }, + facets: { + // populated by a global rule + }, + aggs: {}, + sort: { + __scope_link: "_search.sort" + } + } + }); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/server.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/server.js new file mode 100644 index 0000000..ced1cbb --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/api_server/server.js @@ -0,0 +1,14 @@ +let _ = require("lodash"); + +module.exports.resolveApi = function (sense_version, apis, reply) { + let result = {}; + _.each(apis, function (name) { + { + // for now we ignore sense_version. might add it in the api name later + let api = require('./' + name); + result[name] = api.asJson(); + } + }); + + return reply(result).type("application/json"); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/index.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/index.js new file mode 100644 index 0000000..2f20de7 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/index.js @@ -0,0 +1,122 @@ +module.exports = function (kibana) { + let { resolve, join, sep } = require('path'); + let Joi = require('joi'); + let Boom = require('boom'); + let modules = resolve(__dirname, 'public/webpackShims/'); + let src = resolve(__dirname, 'public/src/'); + let { existsSync } = require('fs'); + const { startsWith, endsWith } = require('lodash'); + + const apps = [ + { + title: 'Sense', + description: 'JSON aware developer\'s interface to ElasticSearch', + icon: 'plugins/sense/bonsai.png', + main: 'plugins/sense/sense', + autoload: kibana.autoload.styles, + injectVars: function (server, options) { + return options; + } + } + ]; + + if (existsSync(resolve(__dirname, 'public/tests'))) { + apps.push({ + title: 'Sense Tests', + id: 'sense-tests', + main: 'plugins/sense/tests', + hidden: true + //listed: false // uncomment after https://github.com/elastic/kibana/pull/4755 + }); + } + + return new kibana.Plugin({ + id: 'sense', + + config: function (Joi) { + return Joi.object({ + enabled: Joi.boolean().default(true), + defaultServerUrl: Joi.string().default('http://localhost:9200'), + proxyFilter: Joi.array().items(Joi.string()).single().default(['.*']), + }).default(); + }, + + init: function (server, options) { + const filters = options.proxyFilter.map(str => new RegExp(str)); + + // http://hapijs.com/api/8.8.1#route-configuration + server.route({ + path: '/api/sense/proxy', + method: ['*', 'GET'], + config: { + handler: { + proxy: { + mapUri: function (req, cb) { + let { uri } = req.query; + if (!uri) { + cb(Boom.badRequest('URI is a required param.')); + return; + } + + if (!filters.some(re => re.test(uri))) { + const err = Boom.forbidden(); + err.output.payload = "Error connecting to '" + uri + "':\n\nUnable to send requests to that url."; + err.output.headers['content-type'] = 'text/plain'; + cb(err); + return; + } + + cb(null, uri); + }, + passThrough: true, + xforward: true, + onResponse: function (err, res, request, reply, settings, ttl) { + if (err != null) { + reply("Error connecting to '" + request.query.uri + "':\n\n" + err.message).type("text/plain").statusCode = 502; + } else { + reply(null, res); + } + } + } + } + } + }); + + server.route({ + path: '/api/sense/api_server', + method: ['GET', 'POST'], + handler: function (req, reply) { + let server = require('./api_server/server'); + let {sense_version, apis} = req.query; + if (!apis) { + reply(Boom.badRequest('"apis" is a required param.')); + return; + } + + return server.resolveApi(sense_version, apis.split(","), reply); + } + }); + + const testApp = kibana.uiExports.apps.hidden.byId['sense-tests']; + if (testApp) { + server.route({ + path: '/app/sense-tests', + method: 'GET', + handler: function (req, reply) { + return reply.renderApp(testApp); + } + }); + } + }, + + uiExports: { + apps: apps, + + noParse: [ + join(modules, 'ace' + sep), + join(modules, 'moment_src/moment' + sep), + join(src, 'sense_editor/mode/worker.js') + ] + } + }) +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/package.json b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/package.json new file mode 100644 index 0000000..d4f1370 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/package.json @@ -0,0 +1,35 @@ +{ + "author": "Boaz Leskes ", + "contributors": [ + "Spencer Alger " + ], + "name": "Sense", + "version": "2.0.0-beta2", + "repository": { + "type": "git", + "url": "http://github.com/elastic/sense.git" + }, + "scripts": { + "build": "grunt build", + "release": "grunt release", + "lint": "grunt eslint:source" + }, + "devDependencies": { + "babel-eslint": "^4.1.6", + "eslint": "^1.7.3", + "eslint-config-airbnb": "^0.1.0", + "eslint-plugin-react": "^3.6.3", + "grunt": "^0.4.5", + "grunt-aws": "^0.6.1", + "grunt-cli": "^0.1.13", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-compress": "^0.14.0", + "grunt-contrib-copy": "^0.8.2", + "grunt-gitinfo": "^0.1.7", + "grunt-replace": "^0.11.0", + "gruntify-eslint": "^1.2.0", + "jit-grunt": "^0.9.1" + }, + "dependencies": {}, + "license": "Apache-2.0" +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/bonsai.png b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/bonsai.png new file mode 100644 index 0000000..ac406f1 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/bonsai.png differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/css/sense.less b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/css/sense.less new file mode 100644 index 0000000..ececc2e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/css/sense.less @@ -0,0 +1,205 @@ +@import "./sense.light.css"; +@import (reference) "~ui/styles/variables"; + +nav.navbar .logo.hidden-sm { + display: block !important; +} + +[sense-navbar] { + .server-url-form { + flex: 1 1 1%; + } +} + +#editor_output_container { + display: flex; + flex: 1 1 auto; + position: relative; + padding: 10px; +} + +#editor_container { + display: flex; + flex: 0 0 auto; + width: 468px; + position: relative; + + #autocomplete { + position: absolute; + left: -1000px; + } + + #editor_actions { + position: absolute; + } + + #editor { + flex: 1 1 1px; + } +} + +#editor_resizer { + display: flex; + flex: 0 0 13px; + cursor: ew-resize; + background-color: transparent; + align-items: center; + + &:hover { + background-color: #DCDCDC; + } + + &.active { + background-color: rgba(194, 193, 208, 100); + } +} + +#output_container { + display: flex; + flex: 1 1 1px; + + #output { + flex: 1 1 1px; + } +} + +#editor_actions { + position: absolute; + top: 0; + right: 0; + line-height: 1; + padding: 1px 3px 0 0; + /* by pass any other element in ace and resize bar, but not modal popups */ + z-index: 1005; + + .editor_action { + padding: 2px 4px; + &:hover { + text-decoration: none; + } + } + + .fa-wrench { + color: rgb(51, 51, 51); + } + + .fa-play { + color: rgb(112, 186, 86); + } +} + +.ace_gutter { + margin-top: 1px; +} + +#autocomplete { + visibility: hidden; + position: absolute; + /* by pass any other element in ace and resize bar, but not modal popups */ + z-index: 1003; + margin-top: 22px; + /*font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;*/ + /*font-size: 12px;*/ + /*max-height: 100px;*/ + /*overflow-y: auto;*/ + /* prevent horizontal scrollbar */ + /*overflow-x: hidden;*/ +} + +.ui-state-focus { + margin: auto !important; +} + +sense-help-example { + display: block; + height: 11em; + margin: 1em 0; +} + +.history-body { + display: flex; + height: 300px; + + .history-reqs, + .history-viewer { + flex: 0 0 50%; + } + + .history-reqs { + overflow: auto; + margin: 0 25px 0 0; + } + + .history-req { + display: flex; + + &.selected { + background-color: #DCDCDC; + } + + .history-req-icon { + flex: 1 0 auto; + text-align: right; + .fa-chevron-right { + opacity: .25; + } + } + } +} + +.history-footer { + text-align: right; + padding-top: 10px; +} + +.ui-autocomplete { + z-index: 400 !important; +} + +.ace_editor { + line-height: normal; +} + +.ace_layer.ace_marker-layer { + overflow: visible; +} + +.ace_snippet-marker { + position: absolute; + width: 100% !important; +} + +// .ui-resizable-e { +// cursor: ew-resize; +// width: 13px; +// right: -14px; +// top: -1px; +// bottom: -2px; +// background-color: transparent; +// position: absolute; +// } +// +// .ui-resizable-e:hover { +// background-color: #DCDCDC; +// } + +.ui-resizable-e.active { + background-color: rgba(194, 193, 208, 100); +} + +/** COPIED FROM BOOTSTRAP, MODIFIED SELECTORS **/ +.dropdown-menu li > a.zeroclipboard-is-hover, +.dropdown-menu li > a.zeroclipboard-is-active { + color: #FFF; + text-decoration: none; + background-color: #0081C2; + background-image: -moz-linear-gradient(top, #08c, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08C), to(#0077B3)); + background-image: -webkit-linear-gradient(top, #08C, #0077B3); + background-image: -o-linear-gradient(top, #08c, #0077b3); + background-image: linear-gradient(to bottom, #08C, #0077B3); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +/** END COPIED **/ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/css/sense.light.css b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/css/sense.light.css new file mode 100644 index 0000000..3c3b448 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/css/sense.light.css @@ -0,0 +1,51 @@ + +body { + background-color: #f7f7f7; +} + +#editor, #output { + outline: 1px solid #ccc; + border-top: 1px solid #ffffff; +} + +.ace_url { + color: #0088cc; +} + +.ace_url.ace_param { + color: rgb(49, 132, 149); +} + +.ace_url.ace_value { + color: rgb(3, 106, 7); +} + +.ace-tm .ace_gutter { + background: transparent; +} + +.ace_scroller { + border-left: 1px solid #ccc; +} + +.ace_method { + color: rgb(197, 6, 11); +} + +.ace_snippet-marker { + background: rgba(194, 193, 208, 0.20); + border-top: dotted 1px rgba(194, 193, 208, 0.80); + border-bottom: dotted 1px rgba(194, 193, 208, 0.80); + margin-top: -1px; /* compensate for background */ +} + + +.ui-menu { + background-color: white; + border: 1px solid #CCC +} + +.ui-state-focus { + color: white; + background-color: #08C; +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/favicon.ico b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/favicon.ico new file mode 100644 index 0000000..42d46e1 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/favicon.ico differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/icon.png b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/icon.png new file mode 100644 index 0000000..edce83b Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/icon.png differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/index.html b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/index.html new file mode 100644 index 0000000..86c3d16 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/index.html @@ -0,0 +1,42 @@ + + + + + + +
+
+
    +
    + + + + + + + + + + + + +
    + +
    GET _search +{ + "query": { "match_all": {} } +}
    + +
    +
    +
    +
    {}
    +
    +
    diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo128.icns b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo128.icns new file mode 100644 index 0000000..05b4de5 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo128.icns differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo128.png b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo128.png new file mode 100755 index 0000000..3b53447 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo128.png differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo16.png b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo16.png new file mode 100755 index 0000000..45ad263 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo16.png differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo19.png b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo19.png new file mode 100755 index 0000000..1c2aa71 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo19.png differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo38.png b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo38.png new file mode 100755 index 0000000..23d3b8f Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo38.png differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo48.png b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo48.png new file mode 100755 index 0000000..8f427c1 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/logo48.png differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/sense.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/sense.js new file mode 100644 index 0000000..c789a61 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/sense.js @@ -0,0 +1,20 @@ +require('ace'); +require('ui-bootstrap-custom'); + +require('ui/modules').get('kibana', ['sense.ui.bootstrap']); +require('ui/tooltip'); + +require('./css/sense.less'); +require('./src/controllers/SenseController'); +require('./src/directives/senseHistory'); +require('./src/directives/senseSettings'); +require('./src/directives/senseHelp'); +require('./src/directives/senseWelcome'); +require('./src/directives/senseNavbar'); + +require('ui/chrome') +.setBrand({ + logo: 'url(./installedPlugins/sense/public/icon.png) center no-repeat' +}) +.setRootTemplate(require('./index.html')) +.setRootController('sense', 'SenseController'); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/app.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/app.js new file mode 100644 index 0000000..33ee968 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/app.js @@ -0,0 +1,136 @@ +var $ = require('jquery'); + +let curl = require('./curl'); +let history = require('./history'); +let input = require('./input'); +let mappings = require('./mappings'); +let output = require('./output'); +let es = require('./es'); +let utils = require('./utils'); +let _ = require('lodash'); +const chrome = require('ui/chrome'); + +const defaultServerUrl = chrome.getInjected('defaultServerUrl'); + +$(document.body).removeClass('fouc'); + +// set the value of the server and/or the input and clear the output +function resetToValues(server, content) { + if (server != null) { + es.setBaseUrl(server); + } + if (content != null) { + input.update(content); + } + output.update(""); +} + +function loadSavedState() { + var sourceLocation = utils.getUrlParam('load_from') || "stored"; + var previousSaveState = history.getSavedEditorState(); + + if (sourceLocation == "stored") { + if (previousSaveState) { + resetToValues(previousSaveState.server, previousSaveState.content); + } + else { + resetToValues(defaultServerUrl); + input.autoIndent(); + } + } + else if (/^https?:\/\//.test(sourceLocation)) { + var loadFrom = {url: sourceLocation, dataType: "text", kbnXsrfToken: false}; + if (/https?:\/\/api.github.com/.test(sourceLocation)) { + loadFrom.headers = {Accept: "application/vnd.github.v3.raw"}; + } + $.ajax(loadFrom).done(function (data) { + resetToValues(defaultServerUrl, data); + input.moveToNextRequestEdge(true); + input.highlightCurrentRequestsAndUpdateActionBar(); + input.updateActionsBar(); + }); + } + else if (previousSaveState) { + resetToValues(previousSaveState.server); + } + else { + resetToValues(defaultServerUrl); + } + input.moveToNextRequestEdge(true); +} + +function setupAutosave() { + var timer; + var saveDelay = 500; + + input.getSession().on("change", function onChange(e) { + if (timer) { + timer = clearTimeout(timer); + } + timer = setTimeout(saveCurrentState, saveDelay); + }); + + es.addServerChangeListener(saveCurrentState); +} + +function saveCurrentState() { + try { + var content = input.getValue(); + var server = es.getBaseUrl(); + history.updateCurrentState(server, content); + } + catch (e) { + console.log("Ignoring saving error: " + e); + } +} + +// stupid simple restore function, called when the user +// chooses to restore a request from the history +// PREVENTS history from needing to know about the input +history.restoreFromHistory = function applyHistoryElem(req) { + var session = input.getSession(); + var pos = input.getCursorPosition(); + var prefix = ""; + var suffix = "\n"; + if (input.parser.isStartRequestRow(pos.row)) { + pos.column = 0; + suffix += "\n"; + } + else if (input.parser.isEndRequestRow(pos.row)) { + var line = session.getLine(pos.row); + pos.column = line.length; + prefix = "\n\n"; + } + else if (input.parser.isInBetweenRequestsRow(pos.row)) { + pos.column = 0; + } + else { + pos = input.nextRequestEnd(pos); + prefix = "\n\n"; + } + + var s = prefix + req.method + " " + req.endpoint; + if (req.data) { + s += "\n" + req.data; + } + + s += suffix; + + session.insert(pos, s); + input.clearSelection(); + input.moveCursorTo(pos.row + prefix.length, 0); + input.focus(); +}; + +function resize() { + input.resize(); + output.resize(); +} + +resize(); +$(window).resize((event) => { + if (event.target === window) resize(); +}); + +loadSavedState(); +setupAutosave(); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete.js new file mode 100644 index 0000000..a020fc2 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete.js @@ -0,0 +1,1030 @@ +let history = require('./history'); +let kb = require('./kb'); +let mappings = require('./mappings'); +let ace = require('ace'); +let utils = require('./utils'); +let autocomplete_engine = require('./autocomplete/engine'); +let url_pattern_matcher = require('./autocomplete/url_pattern_matcher'); +let _ = require('lodash'); +let $ = require('jquery'); +let ext_lang_tools = require('ace/ext-language_tools'); + + +var AceRange = ace.require('ace/range').Range; + +var LAST_EVALUATED_TOKEN = null; + +module.exports = function (editor) { + + function isSeparatorToken(token) { + switch ((token || {}).type) { + case "url.slash": + case "url.comma": + case "url.questionmark": + case "paren.lparen": + case "paren.rparen": + case "punctuation.colon": + case "punctuation.comma": + case "whitespace": + return true; + default: + // standing on white space, quotes or another punctuation - no replacing + return false; + } + } + + function isUrlPathToken(token) { + switch ((token || {}).type) { + case "url.slash": + case "url.comma": + case "url.part": + return true; + default: + return false; + } + } + + function isUrlParamsToken(token) { + switch ((token || {}).type) { + case "url.param": + case "url.equal": + case "url.value": + case "url.questionmark": + case "url.amp": + return true; + default: + return false; + } + } + + function getAutoCompleteValueFromToken(token) { + switch ((token || {}).type) { + case "variable": + case "string": + case "text": + case "constant.numeric": + case "constant.language.boolean": + return token.value.replace(/"/g, ''); + case "method": + case "url.part": + return token.value; + default: + // standing on white space, quotes or another punctuation - no replacing + return ""; + } + } + + function addMetaToTermsList(list, meta, template) { + return _.map(list, function (t) { + if (typeof t !== "object") { + t = {name: t}; + } + return _.defaults(t, {meta: meta, template: template}); + }); + } + + function termToFilterRegex(term, prefix, suffix) { + if (!prefix) { + prefix = ""; + } + if (!suffix) { + suffix = ""; + } + + return new RegExp(prefix + term.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') + suffix, 'i'); + } + + function applyTerm(term) { + var session = editor.getSession(); + + var context = term.context; + + // make sure we get up to date replacement info. + addReplacementInfoToContext(context, editor.getCursorPosition(), term.insert_value); + + var termAsString; + if (context.autoCompleteType == "body") { + termAsString = typeof term.insert_value == "string" ? '"' + term.insert_value + '"' : term.insert_value + ""; + if (term.insert_value === "[" || term.insert_value === "{") { + termAsString = ""; + } + } + else { + termAsString = term.insert_value + ""; + } + + var valueToInsert = termAsString; + var templateInserted = false; + if (context.addTemplate && !_.isUndefined(term.template) && !_.isNull(term.template)) { + var indentedTemplateLines = utils.jsonToString(term.template, true).split("\n"); + var currentIndentation = session.getLine(context.rangeToReplace.start.row); + currentIndentation = currentIndentation.match(/^\s*/)[0]; + for (var i = 1; i < indentedTemplateLines.length; i++) // skip first line + indentedTemplateLines[i] = currentIndentation + indentedTemplateLines[i]; + + valueToInsert += ": " + indentedTemplateLines.join("\n"); + templateInserted = true; + } + else { + templateInserted = true; + if (term.value === "[") { + valueToInsert += "[]"; + } + else if (term.value == "{") { + valueToInsert += "{}"; + } + else { + templateInserted = false; + } + } + + valueToInsert = context.prefixToAdd + valueToInsert + context.suffixToAdd; + + // disable listening to the changes we are making. + removeChangeListener(); + + if (context.rangeToReplace.start.column != context.rangeToReplace.end.column) { + session.replace(context.rangeToReplace, valueToInsert); + } + else { + editor.insert(valueToInsert); + } + + editor.clearSelection(); // for some reason the above changes selection + + // go back to see whether we have one of ( : { & [ do not require a comma. All the rest do. + var newPos = { + row: context.rangeToReplace.start.row, + column: context.rangeToReplace.start.column + termAsString.length + context.prefixToAdd.length + + (templateInserted ? 0 : context.suffixToAdd.length) + }; + + var tokenIter = editor.iterForPosition(newPos.row, newPos.column); + + if (context.autoCompleteType === "body") { + // look for the next place stand, just after a comma, { + var nonEmptyToken = editor.parser.nextNonEmptyToken(tokenIter); + switch (nonEmptyToken ? nonEmptyToken.type : "NOTOKEN") { + case "paren.rparen": + newPos = {row: tokenIter.getCurrentTokenRow(), column: tokenIter.getCurrentTokenColumn()}; + break; + case "punctuation.colon": + nonEmptyToken = editor.parser.nextNonEmptyToken(tokenIter); + if ((nonEmptyToken || {}).type == "paren.lparen") { + nonEmptyToken = editor.parser.nextNonEmptyToken(tokenIter); + newPos = {row: tokenIter.getCurrentTokenRow(), column: tokenIter.getCurrentTokenColumn()}; + if (nonEmptyToken && nonEmptyToken.value.indexOf('"') === 0) { + newPos.column++; + } // don't stand on " + } + break; + case "paren.lparen": + case "punctuation.comma": + tokenIter.stepForward(); + newPos = {row: tokenIter.getCurrentTokenRow(), column: tokenIter.getCurrentTokenColumn()}; + break; + } + editor.moveCursorToPosition(newPos); + } + + // re-enable listening to typing + addChangeListener(); + } + + function getAutoCompleteContext(editor, session, pos) { + // deduces all the parameters need to position and insert the auto complete + var context = { + autoCompleteSet: null, // instructions for what can be here + endpoint: null, + urlPath: null, + method: null, + activeScheme: null, + editor: editor + }; + +// context.updatedForToken = session.getTokenAt(pos.row, pos.column); +// +// if (!context.updatedForToken) +// context.updatedForToken = { value: "", start: pos.column }; // empty line +// +// context.updatedForToken.row = pos.row; // extend + + context.autoCompleteType = getAutoCompleteType(pos); + switch (context.autoCompleteType) { + case "path": + addPathAutoCompleteSetToContext(context, pos); + break; + case "url_params": + addUrlParamsAutoCompleteSetToContext(context, pos); + break; + case "method": + addMethodAutoCompleteSetToContext(context, pos); + break; + case "body": + addBodyAutoCompleteSetToContext(context, pos); + break; + default: + return null; + } + + + if (!context.autoCompleteSet) { + return null; // nothing to do.. + } + + addReplacementInfoToContext(context, pos); + + context.createdWithToken = _.clone(context.updatedForToken); + + return context; + } + + function getAutoCompleteType(pos) { + // return "method", "path" or "body" to determine auto complete type. + + var rowMode = editor.parser.getRowParseMode(pos.row); + + //noinspection JSBitwiseOperatorUsage + if (rowMode & editor.parser.MODE.IN_REQUEST) { + return "body"; + } + //noinspection JSBitwiseOperatorUsage + if (rowMode & editor.parser.MODE.REQUEST_START) { + // on url path, url params or method. + var tokenIter = editor.iterForPosition(pos.row, pos.column); + var t = tokenIter.getCurrentToken(); + + while (t.type == "url.comma") { + t = tokenIter.stepBackward(); + } + switch (t.type) { + case "method": + return "method"; + case "whitespace": + t = editor.parser.prevNonEmptyToken(tokenIter); + + switch ((t || {}).type) { + case "method": + // we moved one back + return "path"; + break; + default: + if (isUrlPathToken(t)) { + return "path"; + } + if (isUrlParamsToken(t)) { + return "url_params"; + } + return null; + } + break; + default: + if (isUrlPathToken(t)) { + return "path"; + } + if (isUrlParamsToken(t)) { + return "url_params"; + } + return null; + } + } + + // after start to avoid single line url only requests + //noinspection JSBitwiseOperatorUsage + if (rowMode & editor.parser.MODE.REQUEST_END) { + return "body" + } + + // in between request on an empty + if ((editor.getSession().getLine(pos.row) || "").trim() === "") { + // check if the previous line is a single line begging of a new request + rowMode = editor.parser.getRowParseMode(pos.row - 1); + //noinspection JSBitwiseOperatorUsage + if ((rowMode & editor.parser.MODE.REQUEST_START) && (rowMode & editor.parser.MODE.REQUEST_END)) { + return "body"; + } + //o.w suggest a method + return "method"; + } + + return null; + } + + function addReplacementInfoToContext(context, pos, replacingTerm) { + // extract the initial value, rangeToReplace & textBoxPosition + + // Scenarios for current token: + // - Nice token { "bla|" + // - Broken text token { bla| + // - No token : { | + // - Broken scenario { , bla| + // - Nice token, broken before: {, "bla" + + var session = editor.getSession(); + var insertingRelativeToToken; + + context.updatedForToken = _.clone(session.getTokenAt(pos.row, pos.column)); + if (!context.updatedForToken) { + context.updatedForToken = {value: "", start: pos.column}; + } // empty line + + var anchorToken = context.createdWithToken; + if (!anchorToken) { + anchorToken = context.updatedForToken; + } + + switch (context.updatedForToken.type) { + case "variable": + case "string": + case "text": + case "constant.numeric": + case "constant.language.boolean": + case "method": + case "url.index": + case "url.type": + case "url.id": + case "url.method": + case "url.endpoint": + case "url.part": + case "url.param": + case "url.value": + insertingRelativeToToken = 0; + context.rangeToReplace = new AceRange( + pos.row, anchorToken.start, pos.row, + context.updatedForToken.start + context.updatedForToken.value.length + ); + context.replacingToken = true; + break; + default: + if (replacingTerm && context.updatedForToken.value == replacingTerm) { + insertingRelativeToToken = 0; + context.rangeToReplace = new AceRange( + pos.row, anchorToken.start, pos.row, + context.updatedForToken.start + context.updatedForToken.value.length + ); + context.replacingToken = true; + } + else { + // standing on white space, quotes or another punctuation - no replacing + context.rangeToReplace = new AceRange( + pos.row, pos.column, pos.row, pos.column + ); + context.replacingToken = false; + } + break; + } + + context.textBoxPosition = {row: context.rangeToReplace.start.row, column: context.rangeToReplace.start.column}; + + switch (context.autoCompleteType) { + case "path": + addPathPrefixSuffixToContext(context); + break; + case "url_params": + addUrlParamsPrefixSuffixToContext(context); + break; + case "method": + addMethodPrefixSuffixToContext(context); + break; + case "body": + addBodyPrefixSuffixToContext(context); + break; + } + } + + function addBodyPrefixSuffixToContext(context) { + // Figure out what happens next to the token to see whether it needs trailing commas etc. + + // Templates will be used if not destroying existing structure. + // -> token : {} or token ]/} or token , but not token : SOMETHING ELSE + + context.prefixToAdd = ""; + context.suffixToAdd = ""; + + var tokenIter = editor.iterForCurrentLoc(); + var nonEmptyToken = editor.parser.nextNonEmptyToken(tokenIter); + switch (nonEmptyToken ? nonEmptyToken.type : "NOTOKEN") { + case "NOTOKEN": + case "paren.lparen": + case "paren.rparen": + case "punctuation.comma": + context.addTemplate = true; + break; + case "punctuation.colon": + // test if there is an empty object - if so we replace it + context.addTemplate = false; + + nonEmptyToken = editor.parser.nextNonEmptyToken(tokenIter); + if (!(nonEmptyToken && nonEmptyToken.value == "{")) { + break; + } + nonEmptyToken = editor.parser.nextNonEmptyToken(tokenIter); + if (!(nonEmptyToken && nonEmptyToken.value == "}")) { + break; + } + context.addTemplate = true; + // extend range to replace to include all up to token + context.rangeToReplace.end.row = tokenIter.getCurrentTokenRow(); + context.rangeToReplace.end.column = tokenIter.getCurrentTokenColumn() + nonEmptyToken.value.length; + + // move one more time to check if we need a trailing comma + nonEmptyToken = editor.parser.nextNonEmptyToken(tokenIter); + switch (nonEmptyToken ? nonEmptyToken.type : "NOTOKEN") { + case "NOTOKEN": + case "paren.rparen": + case "punctuation.comma": + case "punctuation.colon": + break; + default: + context.suffixToAdd = ", " + } + + break; + default: + context.addTemplate = true; + context.suffixToAdd = ", "; + break; // for now play safe and do nothing. May be made smarter. + } + + + // go back to see whether we have one of ( : { & [ do not require a comma. All the rest do. + tokenIter = editor.iterForCurrentLoc(); + nonEmptyToken = tokenIter.getCurrentToken(); + var insertingRelativeToToken; // -1 is before token, 0 middle, +1 after token + if (context.replacingToken) { + insertingRelativeToToken = 0; + } + else { + var pos = editor.getCursorPosition(); + if (pos.column == context.updatedForToken.start) { + insertingRelativeToToken = -1; + } + else if (pos.column < context.updatedForToken.start + context.updatedForToken.value.length) { + insertingRelativeToToken = 0; + } + else { + insertingRelativeToToken = 1; + } + + } + // we should actually look at what's happening before this token + if (editor.parser.isEmptyToken(nonEmptyToken) || insertingRelativeToToken <= 0) { + nonEmptyToken = editor.parser.prevNonEmptyToken(tokenIter); + } + + + switch (nonEmptyToken ? nonEmptyToken.type : "NOTOKEN") { + case "NOTOKEN": + case "paren.lparen": + case "punctuation.comma": + case "punctuation.colon": + case "method": + break; + default: + if (nonEmptyToken && nonEmptyToken.type.indexOf("url") < 0) { + context.prefixToAdd = ", " + } + } + + return context; + } + + function addUrlParamsPrefixSuffixToContext(context) { + context.prefixToAdd = ""; + context.suffixToAdd = ""; + } + + function addMethodPrefixSuffixToContext(context) { + context.prefixToAdd = ""; + context.suffixToAdd = ""; + var tokenIter = editor.iterForCurrentLoc(); + var row = tokenIter.getCurrentTokenRow(); + var t = editor.parser.nextNonEmptyToken(tokenIter); + + if (tokenIter.getCurrentTokenRow() != row || !t) { + // we still have nothing next to the method, add a space.. + context.suffixToAdd = " "; + } + } + + function addPathPrefixSuffixToContext(context) { + context.prefixToAdd = ""; + context.suffixToAdd = ""; + } + + function addMethodAutoCompleteSetToContext(context, pos) { + context.autoCompleteSet = _.map(["GET", "PUT", "POST", "DELETE", "HEAD"], function (m, i) { + return {name: m, score: -i, meta: "method"} + }) + } + + function addPathAutoCompleteSetToContext(context, pos) { + var ret = getCurrentMethodAndTokenPaths(pos); + context.method = ret.method; + context.token = ret.token; + context.otherTokenValues = ret.otherTokenValues; + context.urlTokenPath = ret.urlTokenPath; + autocomplete_engine.populateContext(ret.urlTokenPath, context, editor, true, kb.getTopLevelUrlCompleteComponents()); + context.autoCompleteSet = addMetaToTermsList(context.autoCompleteSet, "endpoint"); + } + + function addUrlParamsAutoCompleteSetToContext(context, pos) { + var ret = getCurrentMethodAndTokenPaths(pos); + context.method = ret.method; + context.otherTokenValues = ret.otherTokenValues; + context.urlTokenPath = ret.urlTokenPath; + if (!ret.urlTokenPath) { // zero length tokenPath is true + + console.log("Can't extract a valid url token path."); + return context; + } + + autocomplete_engine.populateContext(ret.urlTokenPath, context, editor, false, kb.getTopLevelUrlCompleteComponents()); + + if (!context.endpoint) { + console.log("couldn't resolve an endpoint."); + return context; + } + + if (!ret.urlParamsTokenPath) { // zero length tokenPath is true + console.log("Can't extract a valid urlParams token path."); + return context; + } + var tokenPath = [], currentParam = ret.urlParamsTokenPath.pop(); + if (currentParam) { + tokenPath = Object.keys(currentParam); // single key object + context.otherTokenValues = currentParam[tokenPath[0]]; + } + + autocomplete_engine.populateContext(tokenPath, context, editor, true, + context.endpoint.paramsAutocomplete.getTopLevelComponents()); + return context; + } + + function addBodyAutoCompleteSetToContext(context, pos) { + + var ret = getCurrentMethodAndTokenPaths(pos); + context.method = ret.method; + context.otherTokenValues = ret.otherTokenValues; + context.urlTokenPath = ret.urlTokenPath; + context.requestStartRow = ret.requestStartRow; + if (!ret.urlTokenPath) { // zero length tokenPath is true + console.log("Can't extract a valid url token path."); + return context; + } + + autocomplete_engine.populateContext(ret.urlTokenPath, context, editor, false, kb.getTopLevelUrlCompleteComponents()); + + context.bodyTokenPath = ret.bodyTokenPath; + if (!ret.bodyTokenPath) { // zero length tokenPath is true + + console.log("Can't extract a valid body token path."); + return context; + } + + + // needed for scope linking + global term resolving + context.endpointComponentResolver = kb.getEndpointBodyCompleteComponents; + context.globalComponentResolver = kb.getGlobalAutocompleteComponents; + var components; + if (context.endpoint) { + components = context.endpoint.bodyAutocompleteRootComponents; + } + else { + components = kb.getUnmatchedEndpointComponents(); + } + autocomplete_engine.populateContext(ret.bodyTokenPath, context, editor, true, components); + + return context; + } + + + function getCurrentMethodAndTokenPaths(pos) { + var tokenIter = editor.iterForPosition(pos.row, pos.column); + var startPos = pos; + var bodyTokenPath = [], last_var = "", first_scope = true, ret = {}; + + var STATES = { + looking_for_key: 0, // looking for a key but without jumping over anything but white space and colon. + looking_for_scope_start: 1, // skip everything until scope start + start: 3 + }; + var state = STATES.start; + + // initialization problems - + var t = tokenIter.getCurrentToken(); + if (t) { + if (startPos.column == 0) { + // if we are at the beginning of the line, the current token is the one after cursor, not before which + // deviates from the standard. + t = tokenIter.stepBackward(); + state = STATES.looking_for_scope_start; + } + } + else { + if (startPos.column == 0) { + // empty lines do no have tokens, move one back + t = tokenIter.stepBackward(); + state = STATES.start; + } + } + + var walkedSomeBody = false; + + // climb one scope at a time and get the scope key + for (; t && t.type.indexOf("url") == -1 && t.type != "method"; t = tokenIter.stepBackward()) { + + if (t.type != "whitespace") { + walkedSomeBody = true; + } // marks we saw something + + switch (t.type) { + case "variable": + if (state == STATES.looking_for_key) { + bodyTokenPath.unshift(t.value.trim().replace(/"/g, '')); + } + state = STATES.looking_for_scope_start; // skip everything until the beginning of this scope + break; + + + case "paren.lparen": + bodyTokenPath.unshift(t.value); + if (state == STATES.looking_for_scope_start) { + // found it. go look for the relevant key + state = STATES.looking_for_key; + } + break; + case "paren.rparen": + // reset he search for key + state = STATES.looking_for_scope_start; + // and ignore this sub scope.. + var parenCount = 1; + t = tokenIter.stepBackward(); + while (t && parenCount > 0) { + switch (t.type) { + case "paren.lparen": + parenCount--; + break; + case "paren.rparen": + parenCount++; + break; + } + if (parenCount > 0) { + t = tokenIter.stepBackward(); + } + } + if (!t) // oops we run out.. we don't know what's up return null; + { + return {}; + } + continue; + case "string": + case "constant.numeric": + case "constant.language.boolean": + case "text": + if (state == STATES.start) { + state = STATES.looking_for_key; + } + else if (state == STATES.looking_for_key) { + state = STATES.looking_for_scope_start; + } + + break; + case "punctuation.comma": + if (state == STATES.start) { + state = STATES.looking_for_scope_start; + } + break; + case "punctuation.colon": + case "whitespace": + if (state == STATES.start) { + state = STATES.looking_for_key; + } + break; // skip white space + + } + } + + if (walkedSomeBody && (!bodyTokenPath || bodyTokenPath.length == 0)) { + // we had some content and still no path -> the cursor is position after a closed body -> no auto complete + return {}; + } + + if (tokenIter.getCurrentTokenRow() == startPos.row) { + if (t.type === "url.part" || t.type === "url.param" || t.type === "url.value") { + // we are on the same line as cursor and dealing with a url. Current token is not part of the context + t = tokenIter.stepBackward(); + } + bodyTokenPath = null; // no not on a body line. + } + + ret.bodyTokenPath = bodyTokenPath; + ret.urlTokenPath = []; + ret.urlParamsTokenPath = null; + ret.requestStartRow = tokenIter.getCurrentTokenRow(); + var curUrlPart; + + while (t && isUrlParamsToken(t)) { + switch (t.type) { + case "url.value": + if (_.isArray(curUrlPart)) { + curUrlPart.unshift(t.value); + } + else if (curUrlPart) { + curUrlPart = [t.value, curUrlPart]; + } + else { + curUrlPart = t.value; + } + break; + case "url.comma": + if (!curUrlPart) { + curUrlPart = []; + } + else if (!_.isArray(curUrlPart)) { + curUrlPart = [curUrlPart]; + } + break; + case "url.param": + var v = curUrlPart; + curUrlPart = {}; + curUrlPart[t.value] = v; + break; + case "url.amp": + case "url.questionmark": + if (!ret.urlParamsTokenPath) { + ret.urlParamsTokenPath = []; + } + ret.urlParamsTokenPath.unshift(curUrlPart || {}); + curUrlPart = null; + break; + } + t = tokenIter.stepBackward(); + } + + + curUrlPart = null; + while (t && t.type.indexOf("url") != -1) { + switch (t.type) { + case "url.part": + if (_.isArray(curUrlPart)) { + curUrlPart.unshift(t.value); + } + else if (curUrlPart) { + curUrlPart = [t.value, curUrlPart]; + } + else { + curUrlPart = t.value; + } + break; + case "url.comma": + if (!curUrlPart) { + curUrlPart = []; + } + else if (!_.isArray(curUrlPart)) { + curUrlPart = [curUrlPart]; + } + break; + case "url.slash": + ret.urlTokenPath.unshift(curUrlPart); + curUrlPart = null; + break; + } + t = editor.parser.prevNonEmptyToken(tokenIter); + } + + if (curUrlPart) { + ret.urlTokenPath.unshift(curUrlPart); + } + + if (!ret.bodyTokenPath && !ret.urlParamsTokenPath) { + + if (ret.urlTokenPath.length > 0) { + // started on the url, first token is current token + ret.otherTokenValues = ret.urlTokenPath.splice(-1)[0]; + } + } + else { + // mark the url as completed. + ret.urlTokenPath.push(url_pattern_matcher.URL_PATH_END_MARKER); + } + + if (t && t.type == "method") { + ret.method = t.value; + } + return ret; + } + + + var evaluateCurrentTokenAfterAChange = _.debounce(function evaluateCurrentTokenAfterAChange(pos) { + var session = editor.getSession(); + var currentToken = session.getTokenAt(pos.row, pos.column); + + if (!currentToken) { + if (pos.row == 0) { + LAST_EVALUATED_TOKEN = null; + return; + } + currentToken = {start: 0, value: ""}; // empty row + } + + currentToken.row = pos.row; // extend token with row. Ace doesn't supply it by default + if (editor.parser.isEmptyToken(currentToken)) { + // empty token. check what's coming next + var nextToken = session.getTokenAt(pos.row, pos.column + 1); + if (editor.parser.isEmptyToken(nextToken)) { + // Empty line, or we're not on the edge of current token. Save the current position as base + currentToken.start = pos.column; + LAST_EVALUATED_TOKEN = currentToken; + } + else { + nextToken.row = pos.row; + LAST_EVALUATED_TOKEN = nextToken; + } + return; + } + + + if (!LAST_EVALUATED_TOKEN) { + LAST_EVALUATED_TOKEN = currentToken; + return; // wait for the next typing. + } + + if (LAST_EVALUATED_TOKEN.start != currentToken.start || LAST_EVALUATED_TOKEN.row != currentToken.row + || LAST_EVALUATED_TOKEN.value === currentToken.value) { + // not on the same place or nothing changed, cache and wait for the next time + LAST_EVALUATED_TOKEN = currentToken; + return; + } + + // don't automatically open the auto complete if some just hit enter (new line) or open a parentheses + switch (currentToken.type || "UNKNOWN") { + case "paren.lparen": + case "paren.rparen": + case "punctuation.colon": + case "punctuation.comma": + case "UNKOWN": + return; + } + + LAST_EVALUATED_TOKEN = currentToken; + editor.execCommand("startAutocomplete"); + }, 100); + + function editorChangeListener(e) { + var cursor = editor.selection.lead; + if (editor.__ace.completer && editor.__ace.completer.activated) { + return; + } + evaluateCurrentTokenAfterAChange(cursor); + } + + function addChangeListener() { + editor.on("changeSelection", editorChangeListener); + } + + function removeChangeListener() { + editor.off("changeSelection", editorChangeListener) + } + + + function getCompletions(aceEditor, session, pos, prefix, callback) { + try { + + var context = getAutoCompleteContext(editor, session, pos); + if (!context) { + callback(null, []); + } + else { + var terms = _.map(context.autoCompleteSet, function (term) { + if (typeof term !== "object") { + term = { + name: term + } + } else { + term = _.clone(term); + } + + return _.defaults(term, { + value: term.name, + meta: "API", + score: 0, + context: context, + completer: { + insertMatch: function () { + applyTerm(term); + } + } + }); + }); + + terms.sort(function (t1, t2) { + /* score sorts from high to low */ + if (t1.score > t2.score) { + return -1; + } + if (t1.score < t2.score) { + return 1; + } + /* names sort from low to high */ + if (t1.name < t2.name) { + return -1; + } + if (t1.name === t2.name) { + return 0; + } + return 1; + }); + + callback(null, _.map(terms, function (t, i) { + t.insert_value = t.insert_value || t.value; + t.value = '' + t.value; // normalize to strings + t.score = -i; + return t; + })); + } + } + catch (e) { + console.log("error while getting completion terms", e); + callback(e, null); + } + } + + + addChangeListener(); + + // Hook into Ace + + // disable standard context based autocompletion. + ace.define('ace/autocomplete/text_completer', ['require', 'exports', 'module'], function (require, exports, + module) { + exports.getCompletions = function (editor, session, pos, prefix, callback) { + callback(null, []); + } + }); + + var langTools = ace.require('ace/ext/language_tools'), + aceUtils = ace.require('ace/autocomplete/util'), + aceAutoComplete = ace.require('ace/autocomplete'); + + langTools.addCompleter({ + getCompletions: getCompletions + }); + + editor.setOptions({ + enableBasicAutocompletion: true + }); + + // Ace doesn't care about tokenization when calculating prefix. It will thus stop on . in keys names. + // we patch this behavior. + // CHECK ON ACE UPDATE + var aceAutoCompleteInstance = new aceAutoComplete.Autocomplete(); + aceAutoCompleteInstance.autoInsert = false; + aceAutoCompleteInstance.gatherCompletions = function (ace_editor, callback) { + var session = ace_editor.getSession(); + var pos = ace_editor.getCursorPosition(); + var prefix = ""; + // change starts here + var token = session.getTokenAt(pos.row, pos.column); + this.base = _.clone(pos); + if (!editor.parser.isEmptyToken(token) && !isSeparatorToken(token)) { + if (token.value.indexOf('"') == 0) { + this.base.column = token.start + 1; + } + else { + this.base.column = token.start; + } + + prefix = getAutoCompleteValueFromToken(token); + } + + + var matches = []; + aceUtils.parForEach(ace_editor.completers, function (completer, next) { + completer.getCompletions(ace_editor, session, pos, prefix, function (err, results) { + if (!err) { + matches = matches.concat(results); + } + next(); + }); + }, function () { + callback(null, { + prefix: prefix, + matches: matches + }); + }); + return true; + }; + + editor.__ace.completer = aceAutoCompleteInstance; + + + return { + _test: { + getCompletions: getCompletions, + addReplacementInfoToContext: addReplacementInfoToContext, + addChangeListener: addChangeListener, + removeChangeListener: removeChangeListener + } + } +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/body_completer.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/body_completer.js new file mode 100644 index 0000000..a3891d3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/body_completer.js @@ -0,0 +1,400 @@ +const _ = require('lodash'); +const engine = require('./engine'); + +function CompilingContext(endpoint_id, parametrizedComponentFactories) { + this.parametrizedComponentFactories = parametrizedComponentFactories; + this.endpoint_id = endpoint_id; +} + +function getTemplate(description) { + if (description.__template) { + return description.__template; + } + else if (description.__one_of) { + return getTemplate(description.__one_of[0]); + } + else if (description.__any_of) { + return []; + } + else if (description.__scope_link) { + // assume an object for now. + return {}; + } + else if (_.isArray(description)) { + if (description.length == 1) { + if (_.isObject(description[0])) { + // shortcut to save typing + var innerTemplate = getTemplate(description[0]); + + return innerTemplate != null ? [innerTemplate] : []; + } + } + return []; + } + else if (_.isObject(description)) { + return {}; + } + else if (_.isString(description) && !/^\{.*\}$/.test(description)) { + return description; + } + else { + return description; + } +} + +function getOptions(description) { + var options = {}; + var template = getTemplate(description); + + if (!_.isUndefined(template)) { + options.template = template; + } + return options; +} + +/** + * @param description a json dict describing the endpoint + * @param compilingContext + */ +function compileDescription(description, compilingContext) { + if (_.isArray(description)) { + return [compileList(description, compilingContext)]; + } + else if (_.isObject(description)) { + // test for objects list as arrays are also objects + if (description.__scope_link) { + return [new ScopeResolver(description.__scope_link, compilingContext)] + } + if (description.__any_of) { + return [compileList(description.__any_of, compilingContext)]; + } + if (description.__one_of) { + return _.flatten(_.map(description.__one_of, function (d) { + return compileDescription(d, compilingContext); + })); + } + let obj = compileObject(description, compilingContext); + if (description.__condition) { + return [compileCondition(description.__condition, obj, compilingContext)]; + } else { + return [obj]; + } + } + else if (_.isString(description) && /^\{.*\}$/.test(description)) { + return [compileParametrizedValue(description, compilingContext)]; + } + else { + return [new engine.ConstantComponent(description)]; + } + +} + +function compileParametrizedValue(value, compilingContext, template) { + value = value.substr(1, value.length - 2).toLowerCase(); + var component = compilingContext.parametrizedComponentFactories[value]; + if (!component) { + throw new Error("no factory found for '" + value + "'"); + } + component = component(value, null, template); + if (!_.isUndefined(template)) { + component = engine.wrapComponentWithDefaults(component, {template: template}); + } + return component; + +} + +function compileObject(objDescription, compilingContext) { + var objectC = new engine.ConstantComponent("{"); + var constants = [], patterns = []; + _.each(objDescription, function (desc, key) { + if (key.indexOf("__") == 0) { + // meta key + return; + } + + var options = getOptions(desc), component; + if (/^\{.*\}$/.test(key)) { + component = compileParametrizedValue(key, compilingContext, options.template); + patterns.push(component); + } + else if (key === "*") { + component = new engine.SharedComponent(key); + patterns.push(component); + } + else { + options.name = key; + component = new engine.ConstantComponent(key, null, [options]); + constants.push(component); + } + _.map(compileDescription(desc, compilingContext), function (subComponent) { + component.addComponent(subComponent); + }); + }); + objectC.addComponent(new ObjectComponent("inner", constants, patterns)); + return objectC; +} + +function compileList(listRule, compilingContext) { + var listC = new engine.ConstantComponent("["); + _.each(listRule, function (desc) { + _.each(compileDescription(desc, compilingContext), function (component) { + listC.addComponent(component); + }); + }); + return listC; +} + +/** takes a compiled object and wraps in a {@link ConditionalProxy }*/ +function compileCondition(description, compiledObject, compilingContext) { + if (description.lines_regex) { + return new ConditionalProxy(function (context, editor) { + let lines = editor.getSession().getLines(context.requestStartRow, editor.getCursorPosition().row).join("\n"); + return new RegExp(description.lines_regex, "m").test(lines); + }, compiledObject); + } else { + throw "unknown condition type - got: " + JSON.stringify(description); + } +} + +/** + * @param constants list of components that represent constant keys + * @param patternsAndWildCards list of components that represent patterns and should be matched only if + * there is no constant matches + */ +function ObjectComponent(name, constants, patternsAndWildCards) { + engine.AutocompleteComponent.call(this, name); + this.constants = constants; + this.patternsAndWildCards = patternsAndWildCards; +} + +ObjectComponent.prototype = _.create( + engine.AutocompleteComponent.prototype, + {'constructor': ObjectComponent}); + + +(function (cls) { + cls.getTerms = function (context, editor) { + var options = []; + _.each(this.constants, function (component) { + options.push.apply(options, component.getTerms(context, editor)); + }); + _.each(this.patternsAndWildCards, function (component) { + options.push.apply(options, component.getTerms(context, editor)); + }); + return options; + }; + + cls.match = function (token, context, editor) { + var result = { + next: [] + }; + _.each(this.constants, function (component) { + var componentResult = component.match(token, context, editor); + if (componentResult && componentResult.next) { + result.next.push.apply(result.next, componentResult.next); + } + }); + + // try to link to GLOBAL rules + var globalRules = context.globalComponentResolver(token, false); + if (globalRules) { + result.next.push.apply(result.next, globalRules); + } + + if (result.next.length) { + return result; + } + _.each(this.patternsAndWildCards, function (component) { + var componentResult = component.match(token, context, editor); + if (componentResult && componentResult.next) { + result.next.push.apply(result.next, componentResult.next); + } + }); + + return result; + + }; +})(ObjectComponent.prototype); + +/** + * An object to resolve scope links (syntax endpoint.path1.path2) + * @param link the link either string (endpoint.path1.path2, or .path1.path2) or a function (context,editor) + * which returns a description to be compiled + * @constructor + * @param compilingContext + * + * + * For this to work we expect the context to include a method context.endpointComponentResolver(endpoint) + * which should return the top level components for the given endpoint + */ +function ScopeResolver(link, compilingContext) { + engine.SharedComponent.call(this, "__scope_link", null); + if (_.isString(link) && link[0] === ".") { + // relative link, inject current endpoint + if (link === ".") { + link = compilingContext.endpoint_id; + } + else { + link = compilingContext.endpoint_id + link; + } + } + this.link = link; + this.compilingContext = compilingContext; +} + +ScopeResolver.prototype = _.create( + engine.SharedComponent.prototype, + {'constructor': ScopeResolver}); + + +(function (cls) { + + cls.resolveLinkToComponents = function (context, editor) { + if (_.isFunction(this.link)) { + var desc = this.link(context, editor); + return compileDescription(desc, this.compilingContext); + } + if (!_.isString(this.link)) { + throw new Error("unsupported link format", this.link); + } + + var path = this.link.replace(/\./g, "{").split(/(\{)/); + var endpoint = path[0]; + var components; + try { + if (endpoint === "GLOBAL") { + // global rules need an extra indirection + if (path.length < 3) { + throw new Error("missing term in global link: " + this.link); + } + var term = path[2]; + components = context.globalComponentResolver(term); + path = path.slice(3); + } + else { + path = path.slice(1); + components = context.endpointComponentResolver(endpoint); + } + } + catch (e) { + throw new Error("failed to resolve link [" + this.link + "]: " + e); + } + return engine.resolvePathToComponents(path, context, editor, components); + }; + + cls.getTerms = function (context, editor) { + var options = [], components = this.resolveLinkToComponents(context, editor); + _.each(components, function (component) { + options.push.apply(options, component.getTerms(context, editor)); + }); + return options; + }; + + cls.match = function (token, context, editor) { + var result = { + next: [] + }, + components = this.resolveLinkToComponents(context, editor); + + _.each(components, function (component) { + var componentResult = component.match(token, context, editor); + if (componentResult && componentResult.next) { + result.next.push.apply(result.next, componentResult.next); + } + }); + + return result; + }; +})(ScopeResolver.prototype); + + +function ConditionalProxy(predicate, delegate) { + engine.SharedComponent.call(this, "__condition", null); + this.predicate = predicate; + this.delegate = delegate; +} + +ConditionalProxy.prototype = _.create( + engine.SharedComponent.prototype, + {'constructor': ConditionalProxy}); + + +(function (cls) { + + cls.getTerms = function (context, editor) { + if (this.predicate(context, editor)) { + return this.delegate.getTerms(context, editor); + } else { + return null; + } + }; + + cls.match = function (token, context, editor) { + if (this.predicate(context, editor)) { + return this.delegate.match(token, context, editor); + } else { + return false; + } + }; +})(ConditionalProxy.prototype); + + +function GlobalOnlyComponent(name) { + engine.AutocompleteComponent.call(this, name); +} + +GlobalOnlyComponent.prototype = _.create( + engine.AutocompleteComponent.prototype, + {'constructor': ObjectComponent}); + + +(function (cls) { + + cls.getTerms = function (context, editor) { + return null; + }; + + cls.match = function (token, context, editor) { + var result = { + next: [] + }; + + // try to link to GLOBAL rules + var globalRules = context.globalComponentResolver(token, false); + if (globalRules) { + result.next.push.apply(result.next, globalRules); + } + + if (result.next.length) { + return result; + } + // just loop back to us + result.next = [this]; + + return result; + + }; +})(GlobalOnlyComponent.prototype); + + +// a list of component that match anything but give auto complete suggestions based on global API entries. +module.exports.globalsOnlyAutocompleteComponents = function () { + return [new GlobalOnlyComponent("__global__")]; +}; + +/** + * @param endpoint_id id of the endpoint being compiled. + * @param description a json dict describing the endpoint + * @param endpointComponentResolver a function (endpoint,context,editor) which should resolve an endpoint + * to it's list of compiled components. + * @param parametrizedComponentFactories a dict of the following structure + * that will be used as a fall back for pattern keys (i.e.: {type} ,resolved without the $s) + * { + * TYPE: function (part, parent, endpoint) { + * return new SharedComponent(part, parent) + * } + * } + */ +module.exports.compileBodyDescription = function (endpoint_id, description, parametrizedComponentFactories) { + return compileDescription(description, new CompilingContext(endpoint_id, parametrizedComponentFactories)); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/engine.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/engine.js new file mode 100644 index 0000000..31115d4 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/engine.js @@ -0,0 +1,356 @@ +let _ = require('lodash'); + +module.exports.AutocompleteComponent = function (name) { + this.name = name; +}; + +/** called to get the possible suggestions for tokens, when this object is at the end of + * the resolving chain (and thus can suggest possible continuation paths) + */ +module.exports.AutocompleteComponent.prototype.getTerms = function (context, editor) { + return []; +}; + +/* + if the current matcher matches this term, this method should return an object with the following keys + { + context_values: { + values extract from term that should be added to the context + } + next: AutocompleteComponent(s) to use next + priority: optional priority to solve collisions between multiple paths. Min value is used across entire chain + } + */ +module.exports.AutocompleteComponent.prototype.match = function (token, context, editor) { + return { + next: this.next + }; +}; + +function SharedComponent(name, parent) { + module.exports.AutocompleteComponent.call(this, name); + this._nextDict = {}; + if (parent) { + parent.addComponent(this); + } + // for debugging purposes + this._parent = parent; +} + +SharedComponent.prototype = _.create( + module.exports.AutocompleteComponent.prototype, + {'constructor': SharedComponent}); + +module.exports.SharedComponent = SharedComponent; + +(function (cls) { + /* return the first component with a given name */ + cls.getComponent = function (name) { + return (this._nextDict[name] || [undefined])[0]; + }; + + cls.addComponent = function (component) { + var current = this._nextDict[component.name] || []; + current.push(component); + this._nextDict[component.name] = current; + this.next = [].concat.apply([], _.values(this._nextDict)); + }; + +})(SharedComponent.prototype); + +/** A component that suggests one of the give options, but accepts anything */ +function ListComponent(name, list, parent, multi_valued, allow_non_valid_values) { + SharedComponent.call(this, name, parent); + this.listGenerator = _.isArray(list) ? function () { + return list + } : list; + this.multi_valued = _.isUndefined(multi_valued) ? true : multi_valued; + this.allow_non_valid_values = _.isUndefined(allow_non_valid_values) ? false : allow_non_valid_values; +} + +ListComponent.prototype = _.create(SharedComponent.prototype, {"constructor": ListComponent}); +module.exports.ListComponent = ListComponent; + + +(function (cls) { + cls.getTerms = function (context, editor) { + if (!this.multi_valued && context.otherTokenValues) { + // already have a value -> no suggestions + return [] + } + var already_set = context.otherTokenValues || []; + if (_.isString(already_set)) { + already_set = [already_set]; + } + var ret = _.difference(this.listGenerator(context, editor), already_set); + + if (this.getDefaultTermMeta()) { + var meta = this.getDefaultTermMeta(); + ret = _.map(ret, function (term) { + if (_.isString(term)) { + term = {"name": term}; + } + return _.defaults(term, {meta: meta}); + }); + } + + return ret; + }; + + cls.validateTokens = function (tokens, context, editor) { + if (!this.multi_valued && tokens.length > 1) { + return false; + } + + // verify we have all tokens + var list = this.listGenerator(); + var not_found = _.any(tokens, function (token) { + return list.indexOf(token) == -1; + }); + + if (not_found) { + return false; + } + return true; + }; + + cls.getContextKey = function (context, editor) { + return this.name; + }; + + cls.getDefaultTermMeta = function (context, editor) { + return this.name; + }; + + cls.match = function (token, context, editor) { + if (!_.isArray(token)) { + token = [token] + } + if (!this.allow_non_valid_values && !this.validateTokens(token, context, editor)) { + return null + } + + var result = Object.getPrototypeOf(cls).match.call(this, token, context, editor); + result.context_values = result.context_values || {}; + result.context_values[this.getContextKey()] = token; + return result; + } +})(ListComponent.prototype); + +function SimpleParamComponent(name, parent) { + SharedComponent.call(this, name, parent); +} + +SimpleParamComponent.prototype = _.create(SharedComponent.prototype, {"constructor": SimpleParamComponent}); +module.exports.SimpleParamComponent = SimpleParamComponent; + +(function (cls) { + cls.match = function (token, context, editor) { + var result = Object.getPrototypeOf(cls).match.call(this, token, context, editor); + result.context_values = result.context_values || {}; + result.context_values[this.name] = token; + return result; + } + +})(SimpleParamComponent.prototype); + +function ConstantComponent(name, parent, options) { + SharedComponent.call(this, name, parent); + if (_.isString(options)) { + options = [options]; + } + this.options = options || [name]; +} + +ConstantComponent.prototype = _.create(SharedComponent.prototype, {"constructor": ConstantComponent}); +module.exports.ConstantComponent = ConstantComponent; + +(function (cls) { + cls.getTerms = function () { + return this.options; + }; + + cls.addOption = function (options) { + if (!_.isArray(options)) { + options = [options]; + } + + [].push.apply(this.options, options); + this.options = _.uniq(this.options); + }; + cls.match = function (token, context, editor) { + if (token !== this.name) { + return null; + } + + return Object.getPrototypeOf(cls).match.call(this, token, context, editor); + + } +})(ConstantComponent.prototype); + +module.exports.wrapComponentWithDefaults = function (component, defaults) { + function Wrapper() { + + } + + Wrapper.prototype = {}; + for (var key in component) { + if (_.isFunction(component[key])) { + Wrapper.prototype[key] = _.bindKey(component, key); + } + } + + Wrapper.prototype.getTerms = function (context, editor) { + var result = component.getTerms(context, editor); + if (!result) { + return result; + } + result = _.map(result, function (term) { + if (!_.isObject(term)) { + term = {name: term}; + } + return _.defaults(term, defaults); + }, this); + return result; + }; + return new Wrapper(); +}; + +let tracer = function () { + if (window.engine_trace) { + console.log.call(console, arguments); + } +}; + + +function passThroughContext(context, extensionList) { + function PTC() { + + } + + PTC.prototype = context; + var result = new PTC(); + if (extensionList) { + extensionList.unshift(result); + _.assign.apply(_, extensionList); + extensionList.shift(); + } + return result; +} + +function WalkingState(parent_name, components, contextExtensionList, depth, priority) { + this.parent_name = parent_name; + this.components = components; + this.contextExtensionList = contextExtensionList; + this.depth = depth || 0; + this.priority = priority; +} + + +function walkTokenPath(tokenPath, walkingStates, context, editor) { + if (!tokenPath || tokenPath.length === 0) { + return walkingStates + } + var token = tokenPath[0], + nextWalkingStates = []; + + tracer("starting token evaluation [" + token + "]"); + + _.each(walkingStates, function (ws) { + var contextForState = passThroughContext(context, ws.contextExtensionList); + _.each(ws.components, function (component) { + tracer("evaluating [" + token + "] with [" + component.name + "]", component); + var result = component.match(token, contextForState, editor); + if (result && !_.isEmpty(result)) { + tracer("matched [" + token + "] with:", result); + var next, extensionList; + if (result.next && !_.isArray(result.next)) { + next = [result.next]; + } + else { + next = result.next; + } + if (result.context_values) { + extensionList = []; + [].push.apply(extensionList, ws.contextExtensionList); + extensionList.push(result.context_values); + } + else { + extensionList = ws.contextExtensionList; + } + + var priority = ws.priority; + if (_.isNumber(result.priority)) { + if (_.isNumber(priority)) { + priority = Math.min(priority, result.priority); + } + else { + priority = result.priority; + } + } + + nextWalkingStates.push(new WalkingState(component.name, next, extensionList, ws.depth + 1, priority)); + } + }); + }); + + if (nextWalkingStates.length == 0) { + // no where to go, still return context variables returned so far.. + return _.map(walkingStates, function (ws) { + return new WalkingState(ws.name, [], ws.contextExtensionList); + }) + } + + return walkTokenPath(tokenPath.slice(1), nextWalkingStates, context, editor); +} + +module.exports.resolvePathToComponents = function (tokenPath, context, editor, components) { + var walkStates = walkTokenPath(tokenPath, [new WalkingState("ROOT", components, [])], context, editor); + var result = [].concat.apply([], _.pluck(walkStates, 'components')); + return result; +}; + +module.exports.populateContext = function (tokenPath, context, editor, includeAutoComplete, components) { + + var walkStates = walkTokenPath(tokenPath, [new WalkingState("ROOT", components, [])], context, editor); + if (includeAutoComplete) { + var autoCompleteSet = []; + _.each(walkStates, function (ws) { + var contextForState = passThroughContext(context, ws.contextExtensionList); + _.each(ws.components, function (component) { + _.each(component.getTerms(contextForState, editor), function (term) { + if (!_.isObject(term)) { + term = {name: term}; + } + autoCompleteSet.push(term); + }); + }) + }); + autoCompleteSet = _.uniq(autoCompleteSet, false); + context.autoCompleteSet = autoCompleteSet; + } + + // apply what values were set so far to context, selecting the deepest on which sets the context + if (walkStates.length !== 0) { + var wsToUse; + walkStates = _.sortBy(walkStates, function (ws) { + return _.isNumber(ws.priority) ? ws.priority : Number.MAX_VALUE; + }); + wsToUse = _.find(walkStates, function (ws) { + return _.isEmpty(ws.components) + }); + console.log("resolved ", tokenPath, 'to', walkStates); + if (!wsToUse && walkStates.length > 1 && !includeAutoComplete) { + console.info("more then one context active for current path, but autocomplete isn't requested", walkStates); + } + if (!wsToUse) { + wsToUse = walkStates[0]; + } + + console.log("resolved ", tokenPath, 'to', wsToUse, 'options were', walkStates); + + _.each(wsToUse.contextExtensionList, function (extension) { + _.assign(context, extension); + }); + } +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/url_params.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/url_params.js new file mode 100644 index 0000000..7a0b771 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/url_params.js @@ -0,0 +1,60 @@ +let _ = require('lodash'); +let engine = require('./engine'); + +function ParamComponent(name, parent, description) { + engine.ConstantComponent.call(this, name, parent); + this.description = description; +} + +ParamComponent.prototype = _.create(engine.ConstantComponent.prototype, {"constructor": ParamComponent}); +module.exports.ParamComponent = ParamComponent; + +(function (cls) { + cls.getTerms = function () { + var t = {name: this.name}; + if (this.description === "__flag__") { + t.meta = "flag" + } + else { + t.meta = "param"; + t.insert_value = this.name + "="; + } + return [t]; + }; + +})(ParamComponent.prototype); + +function UrlParams(description, defaults) { + // This is not really a component, just a handy container to make iteration logic simpler + this.rootComponent = new engine.SharedComponent("ROOT"); + if (_.isUndefined(defaults)) { + defaults = { + "pretty": "__flag__", + "format": ["json", "yaml"], + "filter_path": "", + }; + } + description = _.clone(description || {}); + _.defaults(description, defaults); + _.each(description, function (p_description, param) { + var values, component; + component = new ParamComponent(param, this.rootComponent, p_description); + if (_.isArray(p_description)) { + values = new engine.ListComponent(param, p_description, component); + } + else if (p_description === "__flag__") { + values = new engine.ListComponent(param, ["true", "false"], component); + } + }, this); + +} + +(function (cls) { + + cls.getTopLevelComponents = function () { + return this.rootComponent.next; + } + +})(UrlParams.prototype); + +module.exports.UrlParams = UrlParams; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/url_pattern_matcher.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/url_pattern_matcher.js new file mode 100644 index 0000000..1ff1e13 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/autocomplete/url_pattern_matcher.js @@ -0,0 +1,124 @@ +let _ = require('lodash'); +let engine = require('./engine'); + +module.exports.URL_PATH_END_MARKER = "__url_path_end__"; + + +function AcceptEndpointComponent(endpoint, parent) { + engine.SharedComponent.call(this, endpoint.id, parent); + this.endpoint = endpoint +} + +AcceptEndpointComponent.prototype = _.create(engine.SharedComponent.prototype, {"constructor": AcceptEndpointComponent}); + +(function (cls) { + + cls.match = function (token, context, editor) { + if (token !== module.exports.URL_PATH_END_MARKER) { + return null; + } + if (this.endpoint.methods && -1 === _.indexOf(this.endpoint.methods, context.method)) { + return null; + } + var r = Object.getPrototypeOf(cls).match.call(this, token, context, editor); + r.context_values = r.context_values || {}; + r.context_values['endpoint'] = this.endpoint; + if (_.isNumber(this.endpoint.priority)) { + r.priority = this.endpoint.priority; + } + return r; + } +})(AcceptEndpointComponent.prototype); + + +/** + * @param parametrizedComponentFactories a dict of the following structure + * that will be used as a fall back for pattern parameters (i.e.: {indices}) + * { + * indices: function (part, parent) { + * return new SharedComponent(part, parent) + * } + * } + * @constructor + */ +function UrlPatternMatcher(parametrizedComponentFactories) { + // This is not really a component, just a handy container to make iteration logic simpler + this.rootComponent = new engine.SharedComponent("ROOT"); + this.parametrizedComponentFactories = parametrizedComponentFactories || {}; +} + +(function (cls) { + cls.addEndpoint = function (pattern, endpoint) { + var c, + active_component = this.rootComponent, + endpointComponents = endpoint.url_components || {}; + var partList = pattern.split("/"); + _.each(partList, function (part, partIndex) { + if (part.search(/^{.+}$/) >= 0) { + part = part.substr(1, part.length - 2); + if (active_component.getComponent(part)) { + // we already have something for this, reuse + active_component = active_component.getComponent(part); + return; + } + // a new path, resolve. + + if ((c = endpointComponents[part])) { + // endpoint specific. Support list + if (_.isArray(c)) { + c = new engine.ListComponent(part, c, active_component); + } + else if (_.isObject(c) && c.type === "list") { + c = new engine.ListComponent(part, c.list, active_component, c.multi_valued, c.allow_non_valid); + } + else { + console.warn("incorrectly configured url component ", part, " in endpoint", endpoint); + c = new engine.SharedComponent(part); + } + } + else if ((c = this.parametrizedComponentFactories[part])) { + // c is a f + c = c(part, active_component); + } + else { + // just accept whatever with not suggestions + c = new engine.SimpleParamComponent(part, active_component); + } + + active_component = c; + } + else { + // not pattern + var lookAhead = part, s; + + for (partIndex++; partIndex < partList.length; partIndex++) { + s = partList[partIndex]; + if (s.indexOf("{") >= 0) { + break; + } + lookAhead += "/" + s; + + } + + if (active_component.getComponent(part)) { + // we already have something for this, reuse + active_component = active_component.getComponent(part); + active_component.addOption(lookAhead); + } + else { + c = new engine.ConstantComponent(part, active_component, lookAhead); + active_component = c; + } + } + }, this); + // mark end of endpoint path + new AcceptEndpointComponent(endpoint, active_component); + }; + + cls.getTopLevelComponents = function () { + return this.rootComponent.next; + } + +})(UrlPatternMatcher.prototype); + +module.exports.UrlPatternMatcher = UrlPatternMatcher; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/controllers/SenseController.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/controllers/SenseController.js new file mode 100644 index 0000000..fae4147 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/controllers/SenseController.js @@ -0,0 +1,52 @@ +require('ui/doc_title'); + + +require('ui/modules') +.get('app/sense') +.controller('SenseController', function SenseController($scope, docTitle) { + + docTitle.change('Sense'); + + // require the root app code, which expects to execute once the dom is loaded up + require('../app'); + + const ConfigTemplate = require('ui/ConfigTemplate'); + const input = require('../input'); + const es = require('../es'); + const storage = require('../storage'); + + this.dropdown = new ConfigTemplate({ + welcome: '', + history: '', + settings: '', + help: '', + }); + + /** + * Display the welcome dropdown if it has not been shown yet + */ + if (storage.get('version_welcome_shown') !== 'f271d96dcc64cc6747bc2565501b2bb990917d5d') { + this.dropdown.open('welcome'); + } + + this.sendSelected = () => { + input.focus(); + input.sendCurrentRequestToES(); + return false; + }; + + this.autoIndent = (event) => { + input.autoIndent(); + event.preventDefault(); + input.focus(); + }; + + this.serverUrl = es.getBaseUrl(); + + // read server url changes into scope + es.addServerChangeListener((server) => { + $scope.$evalAsync(() => { + this.serverUrl = server; + }); + }); +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/curl.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/curl.js new file mode 100644 index 0000000..7cfa4d2 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/curl.js @@ -0,0 +1,217 @@ +define(function () { + 'use strict'; + + function detectCURLinLine(line) { + // returns true if text matches a curl request + return line.match(/^\s*?curl\s+(-X[A-Z]+)?\s*['"]?.*?['"]?(\s*$|\s+?-d\s*?['"])/); + + } + + function detectCURL(text) { + // returns true if text matches a curl request + if (!text) return false; + for (var line of text.split("\n")) { + if (detectCURLinLine(line)) { + return true; + } + } + return false; + } + + function parseCURL(text) { + var state = 'NONE'; + var out = []; + var body = []; + var line = ''; + var lines = text.trim().split("\n"); + var matches; + + var EmptyLine = /^\s*$/; + var Comment = /^\s*(?:#|\/{2,})(.*)\n?$/; + var ExecutionComment = /^\s*#!/; + var ClosingSingleQuote = /^([^']*)'/; + var ClosingDoubleQuote = /^((?:[^\\"]|\\.)*)"/; + var EscapedQuotes = /^((?:[^\\"']|\\.)+)/; + + var LooksLikeCurl = /^\s*curl\s+/; + var CurlVerb = /-X ?(GET|HEAD|POST|PUT|DELETE)/; + + var HasProtocol = /[\s"']https?:\/\//; + var CurlRequestWithProto = /[\s"']https?:\/\/[^\/ ]+\/+([^\s"']+)/; + var CurlRequestWithoutProto = /[\s"'][^\/ ]+\/+([^\s"']+)/; + var CurlData = /^.+\s(--data|-d)\s*/; + var SenseLine = /^\s*(GET|HEAD|POST|PUT|DELETE)\s+\/?(.+)/; + + if (lines.length > 0 && ExecutionComment.test(lines[0])) { + lines.shift(); + } + + function nextLine() { + if (line.length > 0) { + return true; + } + if (lines.length == 0) { + return false; + } + line = lines.shift().replace(/[\r\n]+/g, "\n") + "\n"; + return true; + } + + function unescapeLastBodyEl() { + var str = body.pop().replace(/\\([\\"'])/g, "$1"); + body.push(str); + } + + // Is the next char a single or double quote? + // If so remove it + function detectQuote() { + if (line.substr(0, 1) == "'") { + line = line.substr(1); + state = 'SINGLE_QUOTE'; + } + else if (line.substr(0, 1) == '"') { + line = line.substr(1); + state = 'DOUBLE_QUOTE'; + } + else { + state = 'UNQUOTED'; + } + } + + // Body is finished - append to output with final LF + function addBodyToOut() { + if (body.length > 0) { + out.push(body.join("")); + body = []; + } + state = 'LF'; + out.push("\n"); + } + + // If the pattern matches, then the state is about to change, + // so add the capture to the body and detect the next state + // Otherwise add the whole line + function consumeMatching(pattern) { + var matches = line.match(pattern); + if (matches) { + body.push(matches[1]); + line = line.substr(matches[0].length); + detectQuote(); + } + else { + body.push(line); + line = ''; + } + } + + function parseCurlLine() { + var verb = 'GET'; + var request = ''; + var matches; + if (matches = line.match(CurlVerb)) { + verb = matches[1]; + } + + // JS regexen don't support possesive quantifiers, so + // we need two distinct patterns + var pattern = HasProtocol.test(line) + ? CurlRequestWithProto + : CurlRequestWithoutProto; + + if (matches = line.match(pattern)) { + request = matches[1]; + } + + out.push(verb + ' /' + request + "\n"); + + if (matches = line.match(CurlData)) { + line = line.substr(matches[0].length); + detectQuote(); + if (EmptyLine.test(line)) { + line = ''; + } + } + else { + state = 'NONE'; + line = ''; + out.push(''); + } + } + + while (nextLine()) { + + if (state == 'SINGLE_QUOTE') { + consumeMatching(ClosingSingleQuote); + } + + else if (state == 'DOUBLE_QUOTE') { + consumeMatching(ClosingDoubleQuote); + unescapeLastBodyEl(); + } + + else if (state == 'UNQUOTED') { + consumeMatching(EscapedQuotes); + if (body.length) { + unescapeLastBodyEl(); + } + if (state == 'UNQUOTED') { + addBodyToOut(); + line = '' + } + } + + // the BODY state (used to match the body of a Sense request) + // can be terminated early if it encounters + // a comment or an empty line + else if (state == 'BODY') { + if (Comment.test(line) || EmptyLine.test(line)) { + addBodyToOut(); + } + else { + body.push(line); + line = ''; + } + } + + else if (EmptyLine.test(line)) { + if (state != 'LF') { + out.push("\n"); + state = 'LF'; + } + line = ''; + } + + else if (matches = line.match(Comment)) { + out.push("#" + matches[1] + "\n"); + state = 'NONE'; + line = ''; + } + + else if (LooksLikeCurl.test(line)) { + parseCurlLine(); + } + + else if (matches = line.match(SenseLine)) { + out.push(matches[1] + ' /' + matches[2] + "\n"); + line = ''; + state = 'BODY'; + } + + // Nothing else matches, so output with a prefix of !!! for debugging purposes + else { + out.push('### ' + line); + line = ''; + } + } + + addBodyToOut(); + return out.join('').trim(); + } + + + return { + parseCURL: parseCURL, + detectCURL: detectCURL + }; + +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/help.html b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/help.html new file mode 100644 index 0000000..9413211 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/help.html @@ -0,0 +1,36 @@ +

    Help

    + + + + You can type one or more requests in the white editor. Sense understands requests in a compact format: + + + +
    +
    +
    General editing
    +
    Ctrl/Cmd + I
    +
    Auto indent current request
    +
    Ctrl + Space
    +
    Open Auto complete (even if not typing)
    +
    Ctrl/Cmd + Enter
    +
    Submit request
    +
    Ctrl/Cmd + Up/Down
    +
    Jump to the previous/next request start or end.
    +
    Ctrl/Cmd + Alt + L
    +
    Collapse/expand current scope.
    +
    Ctrl/Cmd + Option + 0
    +
    Collapse all scopes but the current one. Expand by adding a shift.
    +
    +
    +
    +
    When auto-complete is visible
    +
    Down arrow
    +
    Switch focus to auto-complete menu. Use arrows to further select a term
    +
    Enter/Tab
    +
    Select the currently selected or the top most term in auto-complete menu
    +
    Esc
    +
    Close auto-complete menu
    +
    +
    +
    diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/helpExample.txt b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/helpExample.txt new file mode 100644 index 0000000..9bc22ec --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/helpExample.txt @@ -0,0 +1,8 @@ +# index a doc +PUT index/type/1 +{ + "body": "here" +} + +# and get it ... +GET index/type/1 diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/history.html b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/history.html new file mode 100644 index 0000000..180612e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/history.html @@ -0,0 +1,32 @@ +

    History

    + +
    +
      +
    • + + {{ history.describeReq(req) }} + +
    • +
    + + +
    + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/navbar.html b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/navbar.html new file mode 100644 index 0000000..245bd79 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/navbar.html @@ -0,0 +1,61 @@ +Server + +
    + + +
    + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHelp.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHelp.js new file mode 100644 index 0000000..0e9e72d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHelp.js @@ -0,0 +1,10 @@ +require('./senseHelpExample'); + +require('ui/modules') +.get('app/sense') +.directive('senseHelp', function () { + return { + restrict: 'E', + template: require('./help.html') + } +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHelpExample.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHelpExample.js new file mode 100644 index 0000000..06c340f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHelpExample.js @@ -0,0 +1,20 @@ +const SenseEditor = require('../sense_editor/editor'); +const exampleText = require('raw!./helpExample.txt').trim(); + +require('ui/modules') +.get('app/sense') +.directive('senseHelpExample', function () { + return { + restrict: 'E', + link: function ($scope, $el) { + $el.text(exampleText); + $scope.editor = new SenseEditor($el); + $scope.editor.setReadOnly(true); + $scope.editor.$blockScrolling = Infinity; + + $scope.$on('$destroy', function () { + if ($scope.editor) $scope.editor.destroy(); + }); + } + } +}) diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHistory.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHistory.js new file mode 100644 index 0000000..50e7164 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHistory.js @@ -0,0 +1,45 @@ +var { assign, memoize } = require('lodash'); +let moment = require('moment'); + +var history = require('../history'); +require('./senseHistoryViewer'); + +require('ui/modules') +.get('app/sense') +.directive('senseHistory', function () { + return { + restrict: 'E', + template: require('./history.html'), + controllerAs: 'history', + controller: function ($scope, $element) { + this.reqs = history.getHistory(); + this.selectedReq = this.reqs[0]; + this.viewingReq = this.selectedReq; + + // calculate the text description of a request + this.describeReq = memoize((req) => { + const endpoint = req.endpoint; + const date = moment(req.time); + + let formattedDate = date.format("MMM D"); + if (date.diff(moment(), "days") > -7) { + formattedDate = date.fromNow(); + } + + return `${endpoint} (${formattedDate})`; + }); + this.describeReq.cache = new WeakMap(); + + // main actions + this.clear = () => { + history.clearHistory($element); + $scope.close(); + }; + + this.restore = (req = this.selectedReq) => { + history.restoreFromHistory(req); + $scope.close(); + }; + } + }; +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHistoryViewer.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHistoryViewer.js new file mode 100644 index 0000000..d97bd4d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseHistoryViewer.js @@ -0,0 +1,33 @@ +const history = require('../history'); +let SenseEditor = require('../sense_editor/editor'); + +require('ui/modules') +.get('app/sense') +.directive('senseHistoryViewer', function () { + return { + restrict: 'E', + scope: { + req: '=', + }, + link: function ($scope, $el) { + const viewer = new SenseEditor($el); + viewer.setReadOnly(true); + viewer.renderer.setShowPrintMargin(false); + require('../settings').applyCurrentSettings(viewer); + + $scope.$watch('req', function (req) { + if (req) { + var s = req.method + " " + req.endpoint + "\n" + (req.data || ""); + viewer.setValue(s); + viewer.clearSelection(); + } else { + viewer.getSession().setValue("No history available") + } + }); + + $scope.$on('$destroy', function () { + viewer.destroy(); + }); + } + } +}) diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseNavbar.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseNavbar.js new file mode 100644 index 0000000..46e2d65 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseNavbar.js @@ -0,0 +1,28 @@ +const history = require('../history'); +const es = require('../es'); + +require('ui/modules') +.get('app/sense') +.directive('senseNavbar', function () { + return { + restrict: 'A', + template: require('./navbar.html'), + controllerAs: 'navbar', + controller: function SenseNavbarController($scope, $element) { + this.serverUrlHistory = []; + this.updateServerUrlHistory = function () { + this.serverUrlHistory = history.getHistoricalServers(); + }; + + this.updateServerUrlHistory(); + + this.commitServerUrlFormModel = () => { + es.setBaseUrl(this.serverUrlFormModel); + }; + + $scope.$watch('sense.serverUrl', (serverUrl) => { + this.serverUrlFormModel = serverUrl; + }); + } + }; +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseSettings.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseSettings.js new file mode 100644 index 0000000..aca5438 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseSettings.js @@ -0,0 +1,21 @@ +require('ui/directives/input_focus'); + +require('ui/modules') +.get('app/sense') +.directive('senseSettings', function () { + return { + restrict: 'E', + template: require('./settings.html'), + controllerAs: 'settings', + controller: function ($scope) { + const settings = require('../settings'); + + this.vals = settings.getCurrentSettings(); + this.apply = () => { + this.vals = settings.updateSettings(this.vals); + $scope.close(); + }; + + }, + }; +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseWelcome.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseWelcome.js new file mode 100644 index 0000000..aeef36a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/senseWelcome.js @@ -0,0 +1,22 @@ +require('./senseHelpExample'); + +const storage = require('../storage'); + +require('ui/modules') +.get('app/sense') +.directive('senseWelcome', function () { + return { + restrict: 'E', + template: require('./welcome.html'), + link: function ($scope) { + // date junk is a work around for https://github.com/elastic/kibana/pull/5167 + var shown = Date.now(); + + $scope.$on('$destroy', function () { + if (Date.now() - shown > 1000) { + storage.set('version_welcome_shown', 'f271d96dcc64cc6747bc2565501b2bb990917d5d'); + } + }); + } + } +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/settings.html b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/settings.html new file mode 100644 index 0000000..1365da0 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/settings.html @@ -0,0 +1,69 @@ +

    Settings

    + +
    +
    +

    Editor & Output pane settings

    + +
    + +
    + +
    +
    + +
    + +
    + +
    + +
    +

    Autocomplete

    + +
    + +
    + +
    + +
    + +
    + + +
    diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/welcome.html b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/welcome.html new file mode 100644 index 0000000..1d5dc1f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/directives/welcome.html @@ -0,0 +1,27 @@ +

    Welcome to Sense

    + +

    Quick intro to the UI

    + +

    Sense is split into two panes: an editor pane (white) and a response pane (black). + Use the editor to type requests and submit them to Elasticsearch. The results will be displayed in + the response pane on the right side. +

    + +

    Sense understands requests in a compact format, similar to cURL: + + +

    While typing a request, Sense will make suggestions which you can than accept by hitting Enter/Tab. + These suggestions are made based on the request structure as well as your indices and types. +

    + + +

    A few quick tips, while I have your attention

    +
      +
    • Submit requests to ES using the green triangle button.
    • +
    • Use the wrench menu for other useful things.
    • +
    • You can paste requests in cURL format and they will be translated to the Sense syntax.
    • +
    • You can resize the editor and output panes by dragging the separator between them.
    • +
    • Study the keyboard shortcuts under the Help button. Good stuff in there!
    • +
    + + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/es.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/es.js new file mode 100644 index 0000000..c7cbf87 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/es.js @@ -0,0 +1,116 @@ +let _ = require('lodash'); +let $ = require('jquery'); + +let baseUrl; +let serverChangeListeners = []; +let esVersion = []; + +module.exports.getBaseUrl = function () { + return baseUrl; +}; +module.exports.getVersion = function () { + return esVersion; +}; + +module.exports.send = function (method, path, data, server, disable_auth_alert) { + var wrappedDfd = $.Deferred(); + + server = server || exports.getBaseUrl(); + path = exports.constructESUrl(server, path); + var uname_password_re = /^(https?:\/\/)?(?:(?:([^\/]*):)?([^\/]*?)@)?(.*)$/; + var url_parts = path.match(uname_password_re); + + var uname = url_parts[2]; + var password = url_parts[3]; + path = url_parts[1] + url_parts[4]; + console.log("Calling " + path + " (uname: " + uname + " pwd: " + password + ")"); + if (data && method == "GET") { + method = "POST"; + } + + // delayed loading for circular references + var settings = require("./settings"); + + var options = { + url: /*'../api/sense/proxy?uri=' +*/ encodeURIComponent(path), + data: method == "GET" ? null : data, + cache: false, + crossDomain: true, + type: method, + password: password, + username: uname, + dataType: "text", // disable automatic guessing + }; + + + $.ajax(options).then( + function (data, textStatus, jqXHR) { + wrappedDfd.resolveWith(this, [data, textStatus, jqXHR]); + }, + function (jqXHR, textStatus, errorThrown) { + if (jqXHR.status == 0) { + jqXHR.responseText = "\n\nFailed to connect to Sense's backend.\nPlease check the Kibana server is up and running"; + } + wrappedDfd.rejectWith(this, [jqXHR, textStatus, errorThrown]); + }); + return wrappedDfd; +}; + +module.exports.constructESUrl = function (server, path) { + if (!path) { + path = server; + server = exports.getBaseUrl(); + } + if (path.indexOf("://") >= 0) { + return path; + } + if (server.indexOf("://") < 0) { + server = (document.location.protocol || "http:") + "//" + server; + } + if (server.substr(-1) == "/") { + server = server.substr(0, server.length - 1); + } + if (path.charAt(0) === "/") { + path = path.substr(1); + } + + return server + "/" + path; +}; + +module.exports.forceRefresh = function () { + exports.setBaseUrl(baseUrl, true) +}; + +module.exports.setBaseUrl = function (base, force) { + if (baseUrl !== base || force) { + var old = baseUrl; + baseUrl = base; + exports.send("GET", "/").done(function (data, status, xhr) { + if (xhr.status === 200) { + // parse for version + var value = xhr.responseText; + try { + value = JSON.parse(value); + if (value.version && value.version.number) { + esVersion = value.version.number.split("."); + } + } + catch (e) { + + } + } + _.each(serverChangeListeners, function (cb) { + cb(base, old) + }); + }).fail(function () { + esVersion = []; // unknown + _.each(serverChangeListeners, function (cb) { + cb(base, old) + }); + }); + } +}; + +module.exports.addServerChangeListener = function (cb) { + serverChangeListeners.push(cb); +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/history.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/history.js new file mode 100644 index 0000000..484ba9e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/history.js @@ -0,0 +1,72 @@ +const $ = require('jquery'); +const { uniq } = require('lodash'); +const storage = require('./storage'); +const chrome = require('ui/chrome'); + +const defaultServerUrl = chrome.getInjected('defaultServerUrl'); + +const history = module.exports = { + restoreFromHistory() { + // default method for history.restoreFromHistory + // replace externally to do something when the user chooses + // to relive a bit of history + throw new Error('not implemented'); + }, + + getHistoryKeys() { + return storage.keys() + .filter(key => key.indexOf('hist_elem') === 0) + .sort() + .reverse(); + }, + + getHistory() { + return history + .getHistoryKeys() + .map(key => storage.get(key)); + }, + + getHistoricalServers() { + return uniq(history.getHistory().map(req => req.server)); + }, + + addToHistory(server, endpoint, method, data) { + var keys = history.getHistoryKeys(); + keys.splice(0, 500); // only maintain most recent X; + $.each(keys, function (i, k) { + storage.delete(k); + }); + + var timestamp = new Date().getTime(); + var k = "hist_elem_" + timestamp; + storage.set(k, { + time: timestamp, + server: server, + endpoint: endpoint, + method: method, + data: data + }); + }, + + updateCurrentState(server, content) { + var timestamp = new Date().getTime(); + storage.set("editor_state", { + time: timestamp, + server: server === defaultServerUrl ? undefined : server, + content: content + }); + }, + + getSavedEditorState() { + const saved = storage.get('editor_state'); + if (!saved) return; + const { time, server = defaultServerUrl, content } = saved; + return { time, server, content }; + }, + + clearHistory($el) { + history + .getHistoryKeys() + .forEach(key => storage.delete(key)); + } +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/input.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/input.js new file mode 100644 index 0000000..5f0024b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/input.js @@ -0,0 +1,241 @@ +let ace = require('ace'); +let $ = require('jquery'); +let ZeroClipboard = require('zeroclip'); +let ext_searchbox = require('ace/ext-searchbox'); +let Autocomplete = require('./autocomplete'); +let mappings = require('./mappings'); +let output = require('./output'); +let SenseEditor = require('./sense_editor/editor'); +let settings = require('./settings'); +let storage = require('./storage'); +let utils = require('./utils'); +let es = require('./es'); +let history = require('./history'); + +var input = new SenseEditor($('#editor')); + +input.autocomplete = new Autocomplete(input); + +input.$actions = $("#editor_actions"); + +input.commands.addCommand({ + name: 'auto indent request', + bindKey: {win: 'Ctrl-I', mac: 'Command-I'}, + exec: function () { + input.autoIndent(); + } +}); +input.commands.addCommand({ + name: 'move to previous request start or end', + bindKey: {win: 'Ctrl-Up', mac: 'Command-Up'}, + exec: function () { + input.moveToPreviousRequestEdge() + } +}); +input.commands.addCommand({ + name: 'move to next request start or end', + bindKey: {win: 'Ctrl-Down', mac: 'Command-Down'}, + exec: function () { + input.moveToNextRequestEdge() + } +}); + + +/** + * COPY AS CURL + * + * Since the copy functionality is powered by a flash movie (via ZeroClipboard) + * the only way to trigger the copy is with a litteral mouseclick from the user. + * + * The original shortcut will now just open the menu and highlight the + * + */ +var $copyAsCURL = $('#copy_as_curl'); +var zc = (function setupZeroClipboard() { + var zc = new ZeroClipboard($copyAsCURL); // the ZeroClipboard instance + + zc.on('wrongflash noflash', function () { + if (!storage.get('flash_warning_shown')) { + alert('Sense needs flash version 10.0 or greater in order to provide "Copy as cURL" functionality'); + storage.set('flash_warning_shown', 'true'); + } + $copyAsCURL.hide(); + }); + + zc.on('ready', function () { + function setupCopyButton(cb) { + cb = typeof cb === 'function' ? cb : $.noop; + $copyAsCURL.css('visibility', 'hidden'); + input.getRequestsAsCURL(function (curl) { + $copyAsCURL.attr('data-clipboard-text', curl); + $copyAsCURL.css('visibility', 'visible'); + cb(); + }); + } + + input.$actions.on('mouseenter', function () { + if (!$(this).hasClass('open')) { + setupCopyButton(); + } + }); + }); + + zc.on('complete', function () { + $copyAsCURL.click(); + input.focus(); + }); + + return zc; +}()); + +/** + * Setup the "send" shortcut + */ + +var CURRENT_REQ_ID = 0; + +function sendCurrentRequestToES() { + + var req_id = ++CURRENT_REQ_ID; + + input.getRequestsInRange(function (requests) { + if (req_id != CURRENT_REQ_ID) { + return; + } + output.update(''); + + if (requests.length == 0) { + return; + } + + var isMultiRequest = requests.length > 1; + var finishChain = function () { /* noop */ }; + + var isFirstRequest = true; + + var sendNextRequest = function () { + if (req_id != CURRENT_REQ_ID) { + return; + } + if (requests.length == 0) { + finishChain(); + return; + } + var req = requests.shift(); + var es_path = req.url; + var es_method = req.method; + var es_data = req.data.join("\n"); + if (es_data) { + es_data += "\n"; + } //append a new line for bulk requests. + + es.send(es_method, es_path, es_data).always(function (dataOrjqXHR, textStatus, jqXhrORerrorThrown) { + if (req_id != CURRENT_REQ_ID) { + return; + } + var xhr; + if (dataOrjqXHR.promise) { + xhr = dataOrjqXHR; + } + else { + xhr = jqXhrORerrorThrown; + } + function modeForContentType(contentType) { + if (contentType.indexOf("text/plain") >= 0) { + return "ace/mode/text"; + } + else if (contentType.indexOf("application/yaml") >= 0) { + return "ace/mode/yaml"; + } + return null; + } + + if (typeof xhr.status == "number" && + // things like DELETE index where the index is not there are OK. + ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 404) + ) { + // we have someone on the other side. Add to history + history.addToHistory(es.getBaseUrl(), es_path, es_method, es_data); + + + let value = xhr.responseText; + let mode = modeForContentType(xhr.getAllResponseHeaders("Content-Type") || ""); + + if (mode === null || mode === "application/json") { + // assume json - auto pretty + try { + value = JSON.stringify(JSON.parse(value), null, 2); + } + catch (e) { + + } + } + + if (isMultiRequest) { + value = "# " + req.method + " " + req.url + "\n" + value; + } + if (isFirstRequest) { + output.update(value, mode); + } + else { + output.append("\n" + value); + } + isFirstRequest = false; + // single request terminate via sendNextRequest as well + sendNextRequest(); + } + else { + let value, mode; + if (xhr.responseText) { + value = xhr.responseText; // ES error should be shown + mode = modeForContentType(xhr.getAllResponseHeaders("Content-Type") || ""); + if (value[0] == "{") { + try { + value = JSON.stringify(JSON.parse(value), null, 3); + } + catch (e) { + } + } + } else { + value = "Request failed to get to the server (status code: " + xhr.status + ")"; + mode = 'ace/mode/text'; + } + if (isMultiRequest) { + value = "# " + req.method + " " + req.url + "\n" + value; + } + if (isFirstRequest) { + output.update(value, mode); + } + else { + output.append("\n" + value); + } + finishChain(); + } + }); + }; + + sendNextRequest(); + }); +} + + +input.commands.addCommand({ + name: 'send to elasticsearch', + bindKey: {win: 'Ctrl-Enter', mac: 'Command-Enter'}, + exec: sendCurrentRequestToES +}); + + +/** + * Init the editor + */ +if (settings) { + settings.applyCurrentSettings(input); +} +input.focus(); +input.highlightCurrentRequestsAndUpdateActionBar(); + +input.sendCurrentRequestToES = sendCurrentRequestToES; +require('./input_resize')(input, output); + +module.exports = input; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/input_resize.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/input_resize.js new file mode 100644 index 0000000..83688cb --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/input_resize.js @@ -0,0 +1,47 @@ +const $ = require('jquery'); +const storage = require('./storage'); + +module.exports = function (input, output) { + + const $left = input.$el.parent(); + + function readStoredEditorWidth() { + return storage.get('editorWidth'); + } + + function storeEditorWidth(editorWidth) { + storage.set('editorWidth', editorWidth); + } + + function setEditorWidth(editorWidth) { + storeEditorWidth(editorWidth); + $left.width(editorWidth); + } + + var $resizer = $('#editor_resizer'); + $resizer + .on('mousedown', function (event) { + $resizer.addClass('active'); + var startWidth = $left.width(); + var startX = event.pageX; + + function onMove(event) { + setEditorWidth(startWidth + event.pageX - startX) + } + + $(document.body) + .on('mousemove', onMove) + .one('mouseup', function () { + $resizer.removeClass('active'); + $(this).off('mousemove', onMove); + input.resize(); + output.resize(); + }); + }); + + const initialEditorWidth = readStoredEditorWidth(); + if (initialEditorWidth != null) { + setEditorWidth(initialEditorWidth); + } + +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/kb.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/kb.js new file mode 100644 index 0000000..7ddaeef --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/kb.js @@ -0,0 +1,274 @@ +let $ = require('jquery'); +let _ = require('lodash'); +let mappings = require('./mappings'); +let es = require('./es'); +let Api = require('./kb/api'); +let autocomplete_engine = require('./autocomplete/engine'); + +var ACTIVE_API = new Api(); + +function nonValidIndexType(token) { + return !(token === "_all" || token[0] !== "_"); +} + +function IndexAutocompleteComponent(name, parent, multi_valued) { + autocomplete_engine.ListComponent.call(this, name, mappings.getIndices, parent, multi_valued); +} + +IndexAutocompleteComponent.prototype = _.create( + autocomplete_engine.ListComponent.prototype, + {'constructor': IndexAutocompleteComponent}); + +(function (cls) { + cls.validateTokens = function (tokens) { + if (!this.multi_valued && tokens.length > 1) { + return false; + } + return !_.find(tokens, nonValidIndexType); + }; + + cls.getDefaultTermMeta = function () { + return "index" + }; + + cls.getContextKey = function () { + return "indices"; + }; +})(IndexAutocompleteComponent.prototype); + + +function TypeGenerator(context) { + return mappings.getTypes(context.indices); +} + +function TypeAutocompleteComponent(name, parent, multi_valued) { + autocomplete_engine.ListComponent.call(this, name, TypeGenerator, parent, multi_valued); +} + +TypeAutocompleteComponent.prototype = _.create( + autocomplete_engine.ListComponent.prototype, + {'constructor': TypeAutocompleteComponent}); + +(function (cls) { + cls.validateTokens = function (tokens) { + if (!this.multi_valued && tokens.length > 1) { + return false; + } + + return !_.find(tokens, nonValidIndexType); + }; + + cls.getDefaultTermMeta = function () { + return "type" + }; + + cls.getContextKey = function () { + return "types"; + }; +})(TypeAutocompleteComponent.prototype); + +function FieldGenerator(context) { + return _.map(mappings.getFields(context.indices, context.types), function (field) { + return {name: field.name, meta: field.type}; + }); +} + +function FieldAutocompleteComponent(name, parent, multi_valued) { + autocomplete_engine.ListComponent.call(this, name, FieldGenerator, parent, multi_valued); +} + +FieldAutocompleteComponent.prototype = _.create( + autocomplete_engine.ListComponent.prototype, + {'constructor': FieldAutocompleteComponent}); + +(function (cls) { + cls.validateTokens = function (tokens) { + if (!this.multi_valued && tokens.length > 1) { + return false; + } + + return !_.find(tokens, function (token) { + return token.match(/[^\w.?*]/); + }); + }; + + cls.getDefaultTermMeta = function () { + return "field" + }; + + cls.getContextKey = function () { + return "fields"; + }; +})(FieldAutocompleteComponent.prototype); + + +function IdAutocompleteComponent(name, parent, multi) { + autocomplete_engine.SharedComponent.call(this, name, parent); + this.multi_match = multi +} + +IdAutocompleteComponent.prototype = _.create( + autocomplete_engine.SharedComponent.prototype, + {'constructor': IdAutocompleteComponent}); + +(function (cls) { + cls.match = function (token, context, editor) { + if (!token) { + return null; + } + if (!this.multi_match && _.isArray(token)) { + return null; + } + token = _.isArray(token) ? token : [token]; + if (_.find(token, function (t) { + return t.match(/[\/,]/); + })) { + return null; + } + var r = Object.getPrototypeOf(cls).match.call(this, token, context, editor); + r.context_values = r.context_values || {}; + r.context_values['id'] = token; + return r; + }; +})(IdAutocompleteComponent.prototype); + +var parametrizedComponentFactories = { + + 'index': function (name, parent, endpoint) { + return new IndexAutocompleteComponent(name, parent, false); + }, + 'indices': function (name, parent, endpoint) { + return new IndexAutocompleteComponent(name, parent, true); + }, + 'type': function (name, parent, endpoint) { + return new TypeAutocompleteComponent(name, parent, false); + }, + 'types': function (name, parent, endpoint) { + return new TypeAutocompleteComponent(name, parent, true); + }, + 'id': function (name, parent, endpoint) { + return new IdAutocompleteComponent(name, parent); + }, + 'ids': function (name, parent, endpoint) { + return new IdAutocompleteComponent(name, parent, true); + }, + 'fields': function (name, parent, endpoint) { + return new FieldAutocompleteComponent(name, parent, true); + }, + 'field': function (name, parent, endpoint) { + return new FieldAutocompleteComponent(name, parent, false); + }, + 'nodes': function (name, parent, endpoint) { + return new autocomplete_engine.ListComponent(name, ["_local", "_master", "data:true", "data:false", + "master:true", "master:false"], parent) + }, + 'node': function (name, parent, endpoint) { + return new autocomplete_engine.ListComponent(name, [], parent, false) + } +}; + + +function expandAliases(indices) { + if (indices && indices.length > 0) { + indices = mappings.expandAliases(indices); + } + return indices; +} + +function getUnmatchedEndpointComponents() { + return ACTIVE_API.getUnmatchedEndpointComponents(); +} + +function getEndpointDescriptionByEndpoint(endpoint) { + return ACTIVE_API.getEndpointDescriptionByEndpoint(endpoint) +} + +function getEndpointBodyCompleteComponents(endpoint) { + var desc = getEndpointDescriptionByEndpoint(endpoint); + if (!desc) { + throw new Error("failed to resolve endpoint ['" + endpoint + "']"); + } + return desc.bodyAutocompleteRootComponents; +} + +function getTopLevelUrlCompleteComponents() { + return ACTIVE_API.getTopLevelUrlCompleteComponents(); +} + +function getGlobalAutocompleteComponents(term, throwOnMissing) { + return ACTIVE_API.getGlobalAutocompleteComponents(term, throwOnMissing); +} + +function loadApisFromJson(json, urlParametrizedComponentFactories, bodyParametrizedComponentFactories) { + urlParametrizedComponentFactories = urlParametrizedComponentFactories || parametrizedComponentFactories; + bodyParametrizedComponentFactories = bodyParametrizedComponentFactories || urlParametrizedComponentFactories; + let api = new Api(urlParametrizedComponentFactories, bodyParametrizedComponentFactories); + let names = []; + _.each(json, function (apiJson, name) { + names.unshift(name); + _.each(apiJson.globals || {}, function (globalJson, globalName) { + api.addGlobalAutocompleteRules(globalName, globalJson); + }); + _.each(apiJson.endpoints || {}, function (endpointJson, endpointName) { + api.addEndpointDescription(endpointName, endpointJson); + }); + }); + api.name = names.join(","); + return api; +} + +function setActiveApi(api) { + if (_.isString(api)) { + $.ajax({ + url: '../api/sense/api_server?sense_version=' + encodeURIComponent('@@SENSE_VERSION') + "&apis=" + encodeURIComponent(api), + dataType: "json", // disable automatic guessing + } + ).then( + function (data, textStatus, jqXHR) { + setActiveApi(loadApisFromJson(data)); + }, + function (jqXHR) { + console.log("failed to load API '" + api + "': " + jqXHR.responseText); + }); + return; + + } + console.log("setting active api to [" + api.name + "]"); + + ACTIVE_API = api; +} + +es.addServerChangeListener(function () { + var version = es.getVersion(), api; + if (!version || version.length == 0) { + api = "es_1_0"; + } + else if (version[0] === "1") { + api = "es_1_0"; + } + else if (version[0] === "2") { + api = "es_2_0"; + } + else if (version[0] === "3") { + api = "es_2_0"; // TODO: change :) + } + else { + api = "es_1_0"; + } + + if (api) { + setActiveApi(api); + } + +}); + +module.exports.setActiveApi = setActiveApi; +module.exports.getGlobalAutocompleteComponents = getGlobalAutocompleteComponents; +module.exports.getEndpointDescriptionByEndpoint = getEndpointDescriptionByEndpoint; +module.exports.getEndpointBodyCompleteComponents = getEndpointBodyCompleteComponents; +module.exports.getTopLevelUrlCompleteComponents = getTopLevelUrlCompleteComponents; +module.exports.getUnmatchedEndpointComponents = getUnmatchedEndpointComponents; + +module.exports._test = { + loadApisFromJson: loadApisFromJson +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/kb/api.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/kb/api.js new file mode 100644 index 0000000..6e10849 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/kb/api.js @@ -0,0 +1,76 @@ +let _ = require('lodash'); +let url_pattern_matcher = require('../autocomplete/url_pattern_matcher'); +let url_params = require('../autocomplete/url_params'); +let body_completer = require('../autocomplete/body_completer'); + +/** + * + * @param urlParametrizedComponentFactories a dictionary of factory functions + * that will be used as fallback for parametrized path part (i.e., {indices} ) + * see url_pattern_matcher.UrlPatternMatcher + * @constructor + * @param bodyParametrizedComponentFactories same as urlParametrizedComponentFactories but used for body compilation + */ +function Api(urlParametrizedComponentFactories, bodyParametrizedComponentFactories) { + this.globalRules = {}; + this.endpoints = {}; + this.urlPatternMatcher = new url_pattern_matcher.UrlPatternMatcher(urlParametrizedComponentFactories); + this.globalBodyComponentFactories = bodyParametrizedComponentFactories; + this.name = ""; +} + +(function (cls) { + cls.addGlobalAutocompleteRules = function (parentNode, rules) { + this.globalRules[parentNode] = body_completer.compileBodyDescription( + "GLOBAL." + parentNode, rules, this.globalBodyComponentFactories); + }; + + cls.getGlobalAutocompleteComponents = function (term, throwOnMissing) { + var result = this.globalRules[term]; + if (_.isUndefined(result) && (throwOnMissing || _.isUndefined(throwOnMissing))) { + throw new Error("failed to resolve global components for ['" + term + "']"); + } + return result; + }; + + cls.addEndpointDescription = function (endpoint, description) { + + var copiedDescription = {}; + _.extend(copiedDescription, description || {}); + _.defaults(copiedDescription, { + id: endpoint, + patterns: [endpoint], + methods: ['GET'] + }); + _.each(copiedDescription.patterns, function (p) { + this.urlPatternMatcher.addEndpoint(p, copiedDescription); + }, this); + + copiedDescription.paramsAutocomplete = new url_params.UrlParams(copiedDescription.url_params); + copiedDescription.bodyAutocompleteRootComponents = body_completer.compileBodyDescription( + copiedDescription.id, copiedDescription.data_autocomplete_rules, this.globalBodyComponentFactories); + + this.endpoints[endpoint] = copiedDescription; + }; + + cls.getEndpointDescriptionByEndpoint = function (endpoint) { + return this.endpoints[endpoint]; + }; + + + cls.getTopLevelUrlCompleteComponents = function () { + return this.urlPatternMatcher.getTopLevelComponents(); + }; + + cls.getUnmatchedEndpointComponents = function () { + return body_completer.globalsOnlyAutocompleteComponents(); + }; + + cls.clear = function () { + this.endpoints = {}; + this.globalRules = {}; + }; +}(Api.prototype)); + + +module.exports = Api; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/mappings.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/mappings.js new file mode 100644 index 0000000..f968da8 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/mappings.js @@ -0,0 +1,293 @@ +let $ = require('jquery'); +let _ = require('lodash'); +let utils = require('./utils'); +let es = require('./es'); +let settings = require('./settings'); + + +var per_index_types = {}; +var per_alias_indexes = []; + +var mappingObj = {}; + +function expandAliases(indicesOrAliases) { + // takes a list of indices or aliases or a string which may be either and returns a list of indices + // returns a list for multiple values or a string for a single. + + if (!indicesOrAliases) { + return indicesOrAliases; + } + + if (typeof indicesOrAliases === "string") { + indicesOrAliases = [indicesOrAliases]; + } + indicesOrAliases = $.map(indicesOrAliases, function (iOrA) { + if (per_alias_indexes[iOrA]) { + return per_alias_indexes[iOrA]; + } + return [iOrA]; + }); + var ret = [].concat.apply([], indicesOrAliases); + ret.sort(); + var last; + ret = $.map(ret, function (v) { + var r = last == v ? null : v; + last = v; + return r; + }); + return ret.length > 1 ? ret : ret[0]; +} + +function getFields(indices, types) { + // get fields for indices and types. Both can be a list, a string or null (meaning all). + var ret = []; + indices = expandAliases(indices); + if (typeof indices == "string") { + + var type_dict = per_index_types[indices]; + if (!type_dict) { + return []; + } + + if (typeof types == "string") { + var f = type_dict[types]; + ret = f ? f : []; + } + else { + // filter what we need + $.each(type_dict, function (type, fields) { + if (!types || types.length == 0 || $.inArray(type, types) != -1) { + ret.push(fields); + } + }); + + ret = [].concat.apply([], ret); + } + } + else { + // multi index mode. + $.each(per_index_types, function (index) { + if (!indices || indices.length == 0 || $.inArray(index, indices) != -1) { + ret.push(getFields(index, types)); + } + }); + ret = [].concat.apply([], ret); + } + + return _.uniq(ret, function (f) { + return f.name + ":" + f.type + }); +} + +function getTypes(indices) { + var ret = []; + indices = expandAliases(indices); + if (typeof indices == "string") { + var type_dict = per_index_types[indices]; + if (!type_dict) { + return []; + } + + // filter what we need + $.each(type_dict, function (type, fields) { + ret.push(type); + }); + + } + else { + // multi index mode. + $.each(per_index_types, function (index) { + if (!indices || $.inArray(index, indices) != -1) { + ret.push(getTypes(index)); + } + }); + ret = [].concat.apply([], ret); + } + + return _.uniq(ret); + +} + + +function getIndices(include_aliases) { + var ret = []; + $.each(per_index_types, function (index) { + ret.push(index); + }); + if (typeof include_aliases === "undefined" ? true : include_aliases) { + $.each(per_alias_indexes, function (alias) { + ret.push(alias); + }); + } + return ret; +} + +function getFieldNamesFromFieldMapping(field_name, field_mapping) { + if (field_mapping['enabled'] == false) { + return []; + } + var nested_fields; + + function applyPathSettings(nested_field_names) { + var path_type = field_mapping['path'] || "full"; + if (path_type == "full") { + return $.map(nested_field_names, function (f) { + f.name = field_name + "." + f.name; + return f; + }); + } + return nested_field_names; + } + + if (field_mapping["properties"]) { + // derived object type + nested_fields = getFieldNamesFromTypeMapping(field_mapping); + return applyPathSettings(nested_fields); + } + + var field_type = field_mapping['type']; + + if (field_type === 'multi_field') { + nested_fields = $.map(field_mapping['fields'], function (field_mapping, field_name) { + return getFieldNamesFromFieldMapping(field_name, field_mapping); + }); + + return applyPathSettings(nested_fields); + } + + var ret = {name: field_name, type: field_type}; + + if (field_mapping["index_name"]) { + ret.name = field_mapping["index_name"]; + } + + if (field_mapping["fields"]) { + nested_fields = $.map(field_mapping['fields'], function (field_mapping, field_name) { + return getFieldNamesFromFieldMapping(field_name, field_mapping); + }); + nested_fields = applyPathSettings(nested_fields); + nested_fields.unshift(ret); + return nested_fields; + } + + return [ret]; +} + +function getFieldNamesFromTypeMapping(type_mapping) { + var field_list = + $.map(type_mapping['properties'] || {}, function (field_mapping, field_name) { + return getFieldNamesFromFieldMapping(field_name, field_mapping); + }); + + // deduping + return _.uniq(field_list, function (f) { + return f.name + ":" + f.type + }); +} + +function loadMappings(mappings) { + per_index_types = {}; + $.each(mappings, function (index, index_mapping) { + var normalized_index_mappings = {}; + // 1.0.0 mapping format has changed, extract underlying mapping + if (index_mapping.mappings && _.keys(index_mapping).length === 1) { + index_mapping = index_mapping.mappings; + } + $.each(index_mapping, function (type_name, type_mapping) { + var field_list = getFieldNamesFromTypeMapping(type_mapping); + normalized_index_mappings[type_name] = field_list; + }); + per_index_types[index] = normalized_index_mappings; + }); +} + +function loadAliases(aliases) { + per_alias_indexes = {}; + $.each(aliases || {}, function (index, index_aliases) { + // verify we have an index defined. usefull when mapping loading is disabled + per_index_types[index] = per_index_types[index] || {}; + + $.each(index_aliases.aliases || {}, function (alias) { + if (alias === index) { + return; + } // alias which is identical to index means no index. + var cur_aliases = per_alias_indexes[alias]; + if (!cur_aliases) { + cur_aliases = []; + per_alias_indexes[alias] = cur_aliases; + } + cur_aliases.push(index); + }); + }); + + per_alias_indexes['_all'] = getIndices(false); +} + +function clear() { + per_index_types = {}; + per_alias_indexes = {}; +} + +function retrieveAutocompleteInfoFromServer() { + var autocompleteSettings = settings.getAutocomplete(), + mappingPromise, aliasesPromise; + if (autocompleteSettings.fields) { + mappingPromise = es.send("GET", "_mapping", null, null, true); + } + else { + mappingPromise = new $.Deferred(); + mappingPromise.resolve(); + } + if (autocompleteSettings.indices) { + aliasesPromise = es.send("GET", "_aliases", null, null, true); + } + else { + aliasesPromise = new $.Deferred(); + aliasesPromise.resolve(); + } + + $.when(mappingPromise, aliasesPromise) + .done(function (mappings, aliases) { + if (!mappings) { + mappings = {} + } + else if (mappings[0].length < 10 * 1024 * 1024) { + mappings = JSON.parse(mappings[0]); + } + else { + console.warn("mapping size is larger than 10MB (" + mappings[0].length / 1024 / 1024 + " MB). ignoring.."); + mappings = {}; + } + loadMappings(mappings); + if (aliases) { + loadAliases(JSON.parse(aliases[0])); + } else { + aliases = [{}]; + loadAliases({}); + } + // Trigger an update event with the mappings and aliases + $(mappingObj).trigger('update', [mappings[0], aliases[0]]); + } + ) + ; +} + +function autocomplete_retriever() { + retrieveAutocompleteInfoFromServer(); + setTimeout(function () { + autocomplete_retriever(); + }, 60000); +} + +es.addServerChangeListener(retrieveAutocompleteInfoFromServer); + +module.exports = _.assign(mappingObj, { + getFields: getFields, + getIndices: getIndices, + getTypes: getTypes, + loadMappings: loadMappings, + loadAliases: loadAliases, + expandAliases: expandAliases, + clear: clear, + retrieveAutocompleteInfoFromServer: retrieveAutocompleteInfoFromServer +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/output.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/output.js new file mode 100644 index 0000000..0df7426 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/output.js @@ -0,0 +1,66 @@ +let ace = require('ace'); +let $ = require('jquery'); +let settings = require('./settings'); +let OutputMode = require('./sense_editor/mode/output'); +const smartResize = require('./smart_resize'); + +var $el = $("#output"); +var output = ace.require('ace/ace').edit($el[0]); + +var outputMode = new OutputMode.Mode(); + +output.resize = smartResize(output); +output.update = function (val, mode, cb) { + if (typeof mode === 'function') { + cb = mode; + mode = void 0; + } + + var session = output.getSession(); + + session.setMode(val ? (mode || outputMode) : 'ace/mode/text'); + session.setValue(val); + if (typeof cb === 'function') { + setTimeout(cb); + } +}; + +output.append = function (val, fold_previous, cb) { + if (typeof fold_previous === 'function') { + cb = fold_previous; + fold_previous = true; + } + if (_.isUndefined(fold_previous)) { + fold_previous = true; + } + var session = output.getSession(); + var lastLine = session.getLength(); + if (fold_previous) { + output.moveCursorTo(Math.max(0, lastLine - 1), 0); + session.toggleFold(false); + + } + session.insert({row: lastLine, column: 0}, "\n" + val); + output.moveCursorTo(lastLine + 1, 0); + if (typeof cb === 'function') { + setTimeout(cb); + } +}; + +output.$el = $el; + +(function (session) { + session.setMode("ace/mode/text"); + session.setFoldStyle('markbeginend'); + session.setTabSize(2); + session.setUseWrapMode(true); +}(output.getSession())); + +output.setShowPrintMargin(false); +output.setReadOnly(true); + +if (settings) { + settings.applyCurrentSettings(output); +} + +module.exports = output; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/editor.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/editor.js new file mode 100644 index 0000000..ed89a95 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/editor.js @@ -0,0 +1,635 @@ +let _ = require('lodash'); +let ace = require('ace'); +let $ = require('jquery'); +let curl = require('../curl'); +let RowParser = require('./row_parser'); +let InputMode = require('./mode/input'); +let utils = require('../utils'); +let es = require('../es'); +const smartResize = require('../smart_resize'); + +function isInt(x) { + return !isNaN(parseInt(x, 10)); +} + +function createInstance($el) { + var aceEditor = ace.edit($el[0]); + + // we must create a custom class for each instance, so that the prototype + // can be the unique aceEditor it extends + var CustomSenseEditor = function () { + }; + CustomSenseEditor.prototype = {}; + + function bindProp(key) { + Object.defineProperty(CustomSenseEditor.prototype, key, { + get: function () { + return aceEditor[key]; + }, + set: function (val) { + aceEditor[key] = val; + } + }); + } + + // iterate all of the accessible properties/method, on the prototype and beyond + for (var key in aceEditor) { + switch (typeof aceEditor[key]) { + case 'function': + CustomSenseEditor.prototype[key] = _.bindKey(aceEditor, key); + break; + default: + bindProp(key); + break; + } + } + + var editor = new CustomSenseEditor(); + editor.__ace = aceEditor; + return editor; +} + +function SenseEditor($el) { + var editor = createInstance($el); + var CURRENT_REQ_RANGE = null; + + editor.$el = $el; + // place holder for an action bar, needs to be set externally. + editor.$actions = null; + + // mixin the RowParser + editor.parser = new RowParser(editor); + editor.resize = smartResize(editor); + + // dirty check for tokenizer state, uses a lot less cycles + // than listening for tokenizerUpdate + var onceDoneTokenizing = function (func, cancelAlreadyScheduledCalls) { + var session = editor.getSession(); + var timer = false; + var checkInterval = 25; + + return function () { + var self = this; + var args = [].slice.call(arguments, 0); + + if (cancelAlreadyScheduledCalls) { + timer = clearTimeout(timer); + } + + setTimeout(function check() { + if (session.bgTokenizer.running) { + timer = setTimeout(check, checkInterval); + } + else { + func.apply(self, args); + } + }); + }; + }; + + editor.setShowPrintMargin(false); + (function (session) { + session.setMode(new InputMode.Mode()); + session.setFoldStyle('markbeginend'); + session.setTabSize(2); + session.setUseWrapMode(true); + })(editor.getSession()); + + editor.prevRequestStart = function (rowOrPos) { + rowOrPos = _.isUndefined(rowOrPos) || rowOrPos == null ? editor.getCursorPosition() : rowOrPos; + + var curRow = _.isObject(rowOrPos) ? rowOrPos.row : rowOrPos; + while (curRow > 0 && !editor.parser.isStartRequestRow(curRow, editor)) curRow--; + + return { + row: curRow, + column: 0 + }; + }; + + editor.nextRequestStart = function (rowOrPos) { + rowOrPos = _.isUndefined(rowOrPos) || rowOrPos == null ? editor.getCursorPosition() : rowOrPos; + var session = editor.getSession(); + var curRow = _.isObject(rowOrPos) ? rowOrPos.row : rowOrPos; + var maxLines = session.getLength(); + for (; curRow < maxLines - 1; curRow++) { + if (editor.parser.isStartRequestRow(curRow, editor)) { + break; + } + } + return { + row: curRow, + column: 0 + }; + }; + + editor.autoIndent = onceDoneTokenizing(function () { + editor.getRequestRange(function (req_range) { + if (!req_range) { + return; + } + editor.getRequest(function (parsed_req) { + if (parsed_req.data && parsed_req.data.length > 0) { + var indent = parsed_req.data.length == 1; // unindent multi docs by default + var formatted_data = utils.reformatData(parsed_req.data, indent); + if (!formatted_data.changed) { + // toggle. + formatted_data = utils.reformatData(parsed_req.data, !indent); + } + parsed_req.data = formatted_data.data; + + editor.replaceRequestRange(parsed_req, req_range); + } + }); + }); + }, true); + + editor.update = function (data, callback) { + callback = typeof callback === 'function' ? callback : null; + var session = editor.getSession(); + + session.setValue(data); + if (callback) { + // force update of tokens, but not on this thread to allow for ace rendering. + setTimeout(function () { + var i; + for (i = 0; i < session.getLength(); i++) { + session.getTokens(i); + } + callback(); + }); + } + + }; + + editor.replaceRequestRange = function (newRequest, requestRange) { + var text = utils.textFromRequest(newRequest); + if (requestRange) { + var pos = editor.getCursorPosition(); + editor.getSession().replace(requestRange, text); + var max_row = Math.max(requestRange.start.row + text.split('\n').length - 1, 0); + pos.row = Math.min(pos.row, max_row); + editor.moveCursorToPosition(pos); + // ACE UPGRADE - check if needed - at the moment the above may trigger a selection. + editor.clearSelection(); + } + else { + // just insert where we are + editor.insert(text); + } + }; + + editor.iterForCurrentLoc = function () { + var pos = editor.getCursorPosition(); + return editor.iterForPosition(pos.row, pos.column, editor); + }; + + editor.iterForPosition = function (row, column) { + return new (ace.require("ace/token_iterator").TokenIterator)(editor.getSession(), row, column); + }; + + editor.getRequestRange = onceDoneTokenizing(function (row, cb) { + if (_.isUndefined(cb)) { + cb = row; + row = null; + } + if (typeof cb !== 'function') { + return; + } + + if (editor.parser.isInBetweenRequestsRow(row)) { + cb(null); + return + } + + var reqStart = editor.prevRequestStart(row, editor); + var reqEnd = editor.nextRequestEnd(reqStart, editor); + cb(new (ace.require("ace/range").Range)( + reqStart.row, reqStart.column, + reqEnd.row, reqEnd.column + )); + }); + + editor.getEngulfingRequestsRange = onceDoneTokenizing(function (range, cb) { + if (_.isUndefined(cb)) { + cb = range; + range = null; + } + + range = range || editor.getSelectionRange(); + + var session = editor.getSession(); + var startRow = range.start.row; + var endRow = range.end.row; + var maxLine = Math.max(0, session.getLength() - 1); + + // move start row to the previous request start if in body, o.w. forward + if (editor.parser.isInBetweenRequestsRow(startRow)) { + //for (; startRow <= endRow; startRow++) { + // if (editor.parser.isStartRequestRow(startRow)) { + // break; + // } + //} + } + else { + for (; startRow >= 0; startRow--) { + if (editor.parser.isStartRequestRow(startRow)) { + break; + } + } + } + + if (startRow < 0 || startRow > endRow) { + cb(null); + return; + } + // move end row to the previous request end if between requests, o.w. walk forward + if (editor.parser.isInBetweenRequestsRow(endRow)) { + for (; endRow >= startRow; endRow--) { + if (editor.parser.isEndRequestRow(endRow)) { + break; + } + } + } + else { + + for (; endRow <= maxLine; endRow++) { + if (editor.parser.isEndRequestRow(endRow)) { + break; + } + } + + } + + if (endRow < startRow || endRow > maxLine) { + cb(null); + return; + } + + var endColumn = (session.getLine(endRow) || "").replace(/\s+$/, "").length; + cb(new (ace.require("ace/range").Range)(startRow, 0, endRow, endColumn)); + }); + + + editor.getRequestInRange = onceDoneTokenizing(function (range, cb) { + var request = { + method: "", + data: [], + url: null, + range: range + }; + + var pos = range.start; + var tokenIter = editor.iterForPosition(pos.row, pos.column, editor); + var t = tokenIter.getCurrentToken(); + if (editor.parser.isEmptyToken(t)) { + // if the row starts with some spaces, skip them. + t = editor.parser.nextNonEmptyToken(tokenIter); + } + request.method = t.value; + t = editor.parser.nextNonEmptyToken(tokenIter); + if (!t || t.type == "method") { + return null; + } + request.url = ""; + while (t && t.type && t.type.indexOf("url") == 0) { + request.url += t.value; + t = tokenIter.stepForward(); + } + if (editor.parser.isEmptyToken(t)) { + // if the url row ends with some spaces, skip them. + t = editor.parser.nextNonEmptyToken(tokenIter); + } + + var bodyStartRow = (t ? 0 : 1) + tokenIter.getCurrentTokenRow(); // artificially increase end of docs. + var dataEndPos; + while (bodyStartRow < range.end.row || ( + bodyStartRow == range.end.row && 0 < range.end.column + )) { + dataEndPos = editor.nextDataDocEnd({ + row: bodyStartRow, + column: 0 + }); + var bodyRange = new (ace.require("ace/range").Range)( + bodyStartRow, 0, + dataEndPos.row, dataEndPos.column + ); + var data = editor.getSession().getTextRange(bodyRange); + request.data.push(data.trim()); + bodyStartRow = dataEndPos.row + 1; + } + + cb(request); + }); + + editor.getRequestsInRange = function (range, includeNonRequestBlocks, cb) { + if (_.isUndefined(includeNonRequestBlocks)) { + includeNonRequestBlocks = false; + cb = range; + range = null; + } else if (_.isUndefined(cb)) { + cb = includeNonRequestBlocks; + includeNonRequestBlocks = false; + } + + function explicitRangeToRequests(requestsRange, tempCb) { + if (!requestsRange) { + tempCb([]); + return; + } + + var startRow = requestsRange.start.row; + var endRow = requestsRange.end.row; + + // move to the next request start (during the second iterations this may not be exactly on a request + var currentRow = startRow; + for (; currentRow <= endRow; currentRow++) { + if (editor.parser.isStartRequestRow(currentRow)) { + break; + } + } + + var nonRequestPrefixBlock = null; + if (includeNonRequestBlocks && currentRow != startRow) { + nonRequestPrefixBlock = editor.getSession().getLines(startRow, currentRow - 1).join("\n"); + } + + if (currentRow > endRow) { + tempCb(nonRequestPrefixBlock ? [nonRequestPrefixBlock] : []); + return; + } + + editor.getRequest(currentRow, function (request) { + explicitRangeToRequests({ + start: { + row: request.range.end.row + 1 + }, + end: { + row: requestsRange.end.row + } + }, + function (rest_of_requests) { + rest_of_requests.unshift(request); + if (nonRequestPrefixBlock != null) { + rest_of_requests.unshift(nonRequestPrefixBlock); + } + tempCb(rest_of_requests); + } + ) + }) + } + + editor.getEngulfingRequestsRange(range, function (requestRange) { + explicitRangeToRequests(requestRange, cb); + }); + }; + + editor.getRequest = onceDoneTokenizing(function (row, cb) { + if (_.isUndefined(cb)) { + cb = row; + row = null; + } + if (typeof cb !== 'function') { + return; + } + if (editor.parser.isInBetweenRequestsRow(row)) { + cb(null); + return; + } + editor.getRequestRange(row, function (range) { + editor.getRequestInRange(range, cb); + }); + }); + + editor.moveToPreviousRequestEdge = onceDoneTokenizing(function () { + var pos = editor.getCursorPosition(); + for (pos.row--; pos.row > 0 && !editor.parser.isRequestEdge(pos.row); pos.row--) { + } + editor.moveCursorTo(pos.row, 0); + }); + + editor.moveToNextRequestEdge = onceDoneTokenizing(function (moveOnlyIfNotOnEdge) { + var pos = editor.getCursorPosition(); + var maxRow = editor.getSession().getLength(); + if (!moveOnlyIfNotOnEdge) { + pos.row++; + } + for (; pos.row < maxRow && !editor.parser.isRequestEdge(pos.row); pos.row++) { + } + editor.moveCursorTo(pos.row, 0); + }); + + editor.nextRequestEnd = function (pos) { + pos = pos || editor.getCursorPosition(); + var session = editor.getSession(); + var curRow = pos.row; + var maxLines = session.getLength(); + for (; curRow < maxLines - 1; curRow++) { + var curRowMode = editor.parser.getRowParseMode(curRow, editor); + if ((curRowMode & editor.parser.MODE.REQUEST_END) > 0) { + break; + } + if (curRow != pos.row && (curRowMode & editor.parser.MODE.REQUEST_START) > 0) { + break; + } + } + + var column = (session.getLine(curRow) || "").replace(/\s+$/, "").length; + + return { + row: curRow, + column: column + }; + }; + + editor.nextDataDocEnd = function (pos) { + pos = pos || editor.getCursorPosition(); + var session = editor.getSession(); + var curRow = pos.row; + var maxLines = session.getLength(); + for (; curRow < maxLines - 1; curRow++) { + var curRowMode = editor.parser.getRowParseMode(curRow, editor); + if ((curRowMode & RowParser.REQUEST_END) > 0) { + break; + } + if ((curRowMode & editor.parser.MODE.MULTI_DOC_CUR_DOC_END) > 0) { + break; + } + if (curRow != pos.row && (curRowMode & editor.parser.MODE.REQUEST_START) > 0) { + break; + } + } + + var column = (session.getLine(curRow) || "").length; + + return { + row: curRow, + column: column + }; + }; + + // overwrite the actual aceEditor's onPaste method + var origOnPaste = editor.__ace.onPaste; + editor.__ace.onPaste = function (text) { + if (text && curl.detectCURL(text)) { + editor.handleCURLPaste(text); + return; + } + origOnPaste.call(this, text); + }; + + editor.handleCURLPaste = function (text) { + var curlInput = curl.parseCURL(text); + + editor.insert(curlInput); + }; + + editor.highlightCurrentRequestsAndUpdateActionBar = onceDoneTokenizing(function () { + var session = editor.getSession(); + editor.getEngulfingRequestsRange(function (new_current_req_range) { + if (new_current_req_range == null && CURRENT_REQ_RANGE == null) { + return; + } + if (new_current_req_range != null && CURRENT_REQ_RANGE != null && + new_current_req_range.start.row == CURRENT_REQ_RANGE.start.row && + new_current_req_range.end.row == CURRENT_REQ_RANGE.end.row + ) { + // same request, now see if we are on the first line and update the action bar + var cursorRow = editor.getCursorPosition().row; + if (cursorRow == CURRENT_REQ_RANGE.start.row) { + editor.updateActionsBar(); + } + return; // nothing to do.. + } + + if (CURRENT_REQ_RANGE) { + session.removeMarker(CURRENT_REQ_RANGE.marker_id); + } + + CURRENT_REQ_RANGE = new_current_req_range; + if (CURRENT_REQ_RANGE) { + CURRENT_REQ_RANGE.marker_id = session.addMarker(CURRENT_REQ_RANGE, "ace_snippet-marker", "fullLine"); + } + editor.updateActionsBar(); + }); + }, true); + + editor.getRequestsAsCURL = function (range, cb) { + if (_.isUndefined(cb)) { + cb = range; + range = null; + } + + if (_.isUndefined(cb)) { + cb = $.noop; + } + + editor.getRequestsInRange(range, true, function (requests) { + + var result = _.map(requests, function requestToCurl(req) { + + if (typeof req === "string") { + // no request block + return req; + } + + var + es_path = req.url, + es_method = req.method, + es_data = req.data; + + var url = es.constructESUrl(es.getBaseUrl() || "localhost:9200", es_path); + + var ret = 'curl -X' + es_method + ' "' + url + '"'; + if (es_data && es_data.length) { + ret += " -d'\n"; + // since Sense doesn't allow single quote json string any single qoute is within a string. + ret += es_data.join("\n").replace(/'/g, '\\"'); + if (es_data.length > 1) { + ret += "\n"; + } // end with a new line + ret += "'"; + } + return ret; + }); + + cb(result.join("\n")); + }); + }; + + editor.getSession().on('tokenizerUpdate', function (e) { + editor.highlightCurrentRequestsAndUpdateActionBar(); + }); + + editor.getSession().selection.on('changeCursor', function (e) { + editor.highlightCurrentRequestsAndUpdateActionBar(); + }); + + editor.updateActionsBar = (function () { + var set = function (top) { + if (top == null) { + editor.$actions.css('visibility', 'hidden'); + } + else { + editor.$actions.css({ + top: top, + visibility: 'visible' + }); + } + }; + + var hide = function () { + set(); + }; + + return function () { + if (!editor.$actions) { + return; + } + if (CURRENT_REQ_RANGE) { + // elements are positioned relative to the editor's container + // pageY is relative to page, so subtract the offset + // from pageY to get the new top value + var offsetFromPage = editor.$el.offset().top; + var startRow = CURRENT_REQ_RANGE.start.row; + var startColumn = CURRENT_REQ_RANGE.start.column; + var session = editor.session; + var firstLine = session.getLine(startRow); + + if (firstLine.length > session.getScreenWidth() - 5) { + // overlap first row + if (startRow > 0) { + startRow--; + } + else { + startRow++; + } + } + + + var topOfReq = editor.renderer.textToScreenCoordinates(startRow, startColumn).pageY - offsetFromPage; + + if (topOfReq >= 0) { + return set(topOfReq); + } + + var bottomOfReq = editor.renderer.textToScreenCoordinates( + CURRENT_REQ_RANGE.end.row, + CURRENT_REQ_RANGE.end.column + ).pageY - offsetFromPage; + + if (bottomOfReq >= 0) { + return set(0); + } + } + + hide(); + } + }()); + + editor.getSession().on("changeScrollTop", editor.updateActionsBar); + + return editor; +} + +module.exports = SenseEditor; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/input.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/input.js new file mode 100644 index 0000000..9b197b9 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/input.js @@ -0,0 +1,72 @@ +let ace = require('ace'); +let acequire = require('acequire'); +let mode_json = require('ace/mode-json'); + +var oop = acequire("ace/lib/oop"); +var TextMode = acequire("ace/mode/text").Mode; +var MatchingBraceOutdent = acequire("ace/mode/matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = acequire("ace/mode/behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = acequire("ace/mode/folding/cstyle").FoldMode; +var WorkerClient = acequire("ace/worker/worker_client").WorkerClient; +var AceTokenizer = acequire("ace/tokenizer").Tokenizer; + +var HighlightRules = require("./input_highlight_rules").InputHighlightRules; + +acequire("ace/config").setModuleUrl("sense_editor/mode/worker", require("file!./worker.js")); + + +var Mode = function () { + this.$tokenizer = new AceTokenizer(new HighlightRules().getRules()); + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function () { + this.getCompletions = function (editor, session, pos, prefix) { + // autocomplete is done by the autocomplete module. + return []; + }; + + this.getNextLineIndent = function (state, line, tab) { + var indent = this.$getIndent(line); + + if (state != "double_q_string") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function (state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function (state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function (session) { + var worker = new WorkerClient(["ace", "sense_editor"], "sense_editor/mode/worker", "SenseWorker"); + worker.attachToDocument(session.getDocument()); + + + worker.on("error", function (e) { + session.setAnnotations([e.data]); + }); + + worker.on("ok", function (anno) { + session.setAnnotations(anno.data); + }); + + return worker; + }; + + +}).call(Mode.prototype); + +module.exports.Mode = Mode; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/input_highlight_rules.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/input_highlight_rules.js new file mode 100644 index 0000000..da25659 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/input_highlight_rules.js @@ -0,0 +1,155 @@ +let ace = require('ace'); + +var oop = ace.require("ace/lib/oop"); +var TextHighlightRules = ace.require("ace/mode/text_highlight_rules").TextHighlightRules; + +var InputHighlightRules = function () { + + function mergeTokens(/* ... */) { + return [].concat.apply([], arguments); + } + + function addEOL(tokens, reg, nextIfEOL, normalNext) { + if (typeof reg == "object") { + reg = reg.source; + } + return [ + {token: tokens.concat(["whitespace"]), regex: reg + "(\\s*)$", next: nextIfEOL}, + {token: tokens, regex: reg, next: normalNext} + ]; + } + + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + /*jshint -W015 */ + this.$rules = { + "start": mergeTokens([ + {token: "comment", regex: /^#.*$/}, + {token: "paren.lparen", regex: "{", next: "json", push: true} + ], + addEOL(["method"], /([a-zA-Z]+)/, "start", "method_sep") + , + [ + { + token: "whitespace", + regex: "\\s+" + }, + { + token: "text", + regex: ".+?" + } + ]), + "method_sep": mergeTokens( + addEOL(["whitespace", "url.protocol_host", "url.slash"], /(\s+)(https?:\/\/[^?\/,]+)(\/)/, "start", "url"), + addEOL(["whitespace", "url.protocol_host"], /(\s+)(https?:\/\/[^?\/,]+)/, "start", "url"), + addEOL(["whitespace", "url.slash"], /(\s+)(\/)/, "start", "url"), + addEOL(["whitespace"], /(\s+)/, "start", "url") + ), + "url": mergeTokens( + addEOL(["url.part"], /([^?\/,\s]+)/, "start"), + addEOL(["url.comma"], /(,)/, "start"), + addEOL(["url.slash"], /(\/)/, "start"), + addEOL(["url.questionmark"], /(\?)/, "start", "urlParams") + ), + "urlParams": mergeTokens( + addEOL(["url.param", "url.equal", "url.value"], /([^&=]+)(=)([^&]*)/, "start"), + addEOL(["url.param"], /([^&=]+)/, "start"), + addEOL(["url.amp"], /(&)/, "start") + ), + + + "json": [ + { + token: "variable", // single line + regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' + }, + { + token: "string", // single line + regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, + { + token: "constant.numeric", // hex + regex: "0[xX][0-9a-fA-F]+\\b" + }, + { + token: "constant.numeric", // float + regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, + { + token: "constant.language.boolean", + regex: "(?:true|false)\\b" + }, + { + token: "invalid.illegal", // single quoted strings are not allowed + regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, + { + token: "invalid.illegal", // comments are not allowed + regex: "\\/\\/.*$" + }, + { + token: "paren.lparen", + merge: false, + regex: "{", + next: "json", + push: true + }, + { + token: "paren.lparen", + merge: false, + regex: "[[(]" + }, + { + token: "paren.rparen", + merge: false, + regex: "[\\])]" + }, + { + token: "paren.rparen", + regex: "}", + merge: false, + next: "pop" + }, + { + token: "punctuation.comma", + regex: "," + }, + { + token: "punctuation.colon", + regex: ":" + }, + { + token: "whitespace", + regex: "\\s+" + }, + { + token: "text", + regex: ".+?" + } + ], + "double_q_string": [ + { + token: "string", + regex: '[^"]+' + }, + { + token: "punctuation.end_quote", + regex: '"', + next: "json" + }, + { + token: "string", + regex: "", + next: "json" + } + ] + }; + + if (this.constructor === InputHighlightRules) { + this.normalizeRules(); + } +}; + +oop.inherits(InputHighlightRules, TextHighlightRules); + +module.exports.InputHighlightRules = InputHighlightRules; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/output.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/output.js new file mode 100644 index 0000000..d4edebc --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/output.js @@ -0,0 +1,32 @@ +let ace = require('ace'); +let acequire = require('acequire'); +let mode_json = require('ace/mode-json'); +let output_highlighting_rules = require('./output_highlight_rules'); + + +var oop = ace.require("ace/lib/oop"); +var JSONMode = ace.require("ace/mode/json").Mode; +var HighlightRules = require("./output_highlight_rules").OutputJsonHighlightRules; +var MatchingBraceOutdent = ace.require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = ace.require("ace/mode/behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = ace.require("ace/mode/folding/cstyle").FoldMode; +var WorkerClient = ace.require("ace/worker/worker_client").WorkerClient; +var AceTokenizer = ace.require("ace/tokenizer").Tokenizer; + +var Mode = function () { + this.$tokenizer = new AceTokenizer(new HighlightRules().getRules()); + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, JSONMode); + +(function () { + this.createWorker = function (session) { + return null; + }; + + this.$id = "sense/mode/input"; +}).call(Mode.prototype); + +module.exports.Mode = Mode; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/output_highlight_rules.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/output_highlight_rules.js new file mode 100644 index 0000000..97b76cf --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/output_highlight_rules.js @@ -0,0 +1,24 @@ +let ace = require('ace'); +let ace_mode_json = require('ace/mode-json'); + +var oop = ace.require("ace/lib/oop"); +var JsonHighlightRules = ace.require("ace/mode/json_highlight_rules").JsonHighlightRules; + +var OutputJsonHighlightRules = function () { + + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + this.$rules = new JsonHighlightRules().getRules(); + + this.$rules.start.unshift( + { + "token": "comment", + "regex": "#.*$" + } + ); + +}; + +oop.inherits(OutputJsonHighlightRules, JsonHighlightRules); + +module.exports.OutputJsonHighlightRules = OutputJsonHighlightRules; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/worker.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/worker.js new file mode 100644 index 0000000..4371f7f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/mode/worker.js @@ -0,0 +1,1793 @@ +(function (window) { + "use strict"; + + if (typeof window.window !== "undefined" && window.document) { + return; + } + + window.console = function () { + var msgs = Array.prototype.slice.call(arguments, 0); + window.postMessage({type: "log", data: msgs}); + }; + window.console.error = + window.console.warn = + window.console.log = + window.console.trace = window.console; + + window.window = window; + window.ace = window; + + window.onerror = function (message, file, line, col, err) { + console.error("Worker " + err.stack); + }; + + window.normalizeModule = function (parentId, moduleName) { + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); + } + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = (base ? base + "/" : "") + moduleName; + + var previous; + while (moduleName.indexOf(".") !== -1 && previous != moduleName) { + previous = moduleName; + moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + + return moduleName; + }; + + window.require = function (parentId, id) { + if (!id) { + id = parentId + parentId = null; + } + if (!id.charAt) + throw new Error("worker.js require() accepts only (parentId, id) as arguments"); + + id = window.normalizeModule(parentId, id); + + var module = window.require.modules[id]; + if (module) { + if (!module.initialized) { + module.initialized = true; + module.exports = module.factory().exports; + } + return module.exports; + } + + var chunks = id.split("/"); + if (!window.require.tlns) + return console.log("unable to load " + id); + chunks[0] = window.require.tlns[chunks[0]] || chunks[0]; + var path = chunks.join("/") + ".js"; + + window.require.id = id; + window.importScripts(path); + return window.require(parentId, id); + }; + window.require.modules = {}; + window.require.tlns = {}; + + window.define = function (id, deps, factory) { + if (arguments.length == 2) { + factory = deps; + if (typeof id != "string") { + deps = id; + id = window.require.id; + } + } else if (arguments.length == 1) { + factory = id; + deps = [] + id = window.require.id; + } + + if (!deps.length) + deps = ['require', 'exports', 'module'] + + if (id.indexOf("text!") === 0) + return; + + var req = function (childId) { + return window.require(id, childId); + }; + + window.require.modules[id] = { + exports: {}, + factory: function () { + var module = this; + var returnExports = factory.apply(this, deps.map(function (dep) { + switch (dep) { + case 'require': + return req + case 'exports': + return module.exports + case 'module': + return module + default: + return req(dep) + } + })); + if (returnExports) + module.exports = returnExports; + return module; + } + }; + }; + window.define.amd = {} + + window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { + require.tlns = topLevelNamespaces; + } + + window.initSender = function initSender() { + + var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; + var oop = window.require("ace/lib/oop"); + + var Sender = function () { + }; + + (function () { + + oop.implement(this, EventEmitter); + + this.callback = function (data, callbackId) { + window.postMessage({ + type: "call", + id: callbackId, + data: data + }); + }; + + this.emit = function (name, data) { + window.postMessage({ + type: "event", + name: name, + data: data + }); + }; + + }).call(Sender.prototype); + + return new Sender(); + } + + window.main = null; + window.sender = null; + + window.onmessage = function (e) { + var msg = e.data; + if (msg.command) { + if (window.main[msg.command]) + window.main[msg.command].apply(window.main, msg.args); + else + throw new Error("Unknown command:" + msg.command); + } + else if (msg.init) { + window.initBaseUrls(msg.tlns); + require("ace/lib/es5-shim"); + window.sender = window.initSender(); + var clazz = require(msg.module)[msg.classname]; + /*jshint -W055 */ + window.main = new clazz(window.sender); + } + else if (msg.event && window.sender) { + window.sender._emit(msg.event, msg.data); + } + }; +})(this);// https://github.com/kriskowal/es5-shim + +define('ace/lib/oop', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + exports.inherits = function (ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + + exports.mixin = function (obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; + }; + + exports.implement = function (proto, mixin) { + exports.mixin(proto, mixin); + }; + +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function (require, exports, module) { + "use strict"; + + var Document = require("../document").Document; + var lang = require("../lib/lang"); + + var Mirror = exports.Mirror = function (sender) { + this.sender = sender; + var doc = this.doc = new Document(""); + + var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); + + var _self = this; + sender.on("change", function (e) { + doc.applyDeltas(e.data); + if (_self.$timeout) + return deferredUpdate.schedule(_self.$timeout); + _self.onUpdate(); + }); + }; + + (function () { + + this.$timeout = 500; + + this.setTimeout = function (timeout) { + this.$timeout = timeout; + }; + + this.setValue = function (value) { + this.doc.setValue(value); + this.deferredUpdate.schedule(this.$timeout); + }; + + this.getValue = function (callbackId) { + this.sender.callback(this.doc.getValue(), callbackId); + }; + + this.onUpdate = function () { + }; + + this.isPending = function () { + return this.deferredUpdate.isPending(); + }; + + }).call(Mirror.prototype); + +}); + +define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', + 'ace/range', 'ace/anchor'], function (require, exports, module) { + "use strict"; + + var oop = require("./lib/oop"); + var EventEmitter = require("./lib/event_emitter").EventEmitter; + var Range = require("./range").Range; + var Anchor = require("./anchor").Anchor; + + var Document = function (text) { + this.$lines = []; + if (text.length == 0) { + this.$lines = [""]; + } else if (Array.isArray(text)) { + this._insertLines(0, text); + } else { + this.insert({row: 0, column: 0}, text); + } + }; + + (function () { + + oop.implement(this, EventEmitter); + this.setValue = function (text) { + var len = this.getLength(); + this.remove(new Range(0, 0, len, this.getLine(len - 1).length)); + this.insert({row: 0, column: 0}, text); + }; + this.getValue = function () { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function (row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length == 0) + this.$split = function (text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + } + else + this.$split = function (text) { + return text.split(/\r\n|\r|\n/); + }; + + + this.$detectNewLine = function (text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + }; + this.getNewLineCharacter = function () { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine; + } + }; + + this.$autoNewLine = "\n"; + this.$newLineMode = "auto"; + this.setNewLineMode = function (newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + }; + this.getNewLineMode = function () { + return this.$newLineMode; + }; + this.isNewLine = function (text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function (row) { + return this.$lines[row] || ""; + }; + this.getLines = function (firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function () { + return this.getLines(0, this.getLength()); + }; + this.getLength = function () { + return this.$lines.length; + }; + this.getTextRange = function (range) { + if (range.start.row == range.end.row) { + return this.getLine(range.start.row) + .substring(range.start.column, range.end.column); + } + var lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + return lines.join(this.getNewLineCharacter()); + }; + + this.$clipPosition = function (position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length - 1).length; + } else if (position.row < 0) + position.row = 0; + return position; + }; + this.insert = function (position, text) { + if (!text || text.length === 0) + return position; + + position = this.$clipPosition(position); + if (this.getLength() <= 1) + this.$detectNewLine(text); + + var lines = this.$split(text); + var firstLine = lines.splice(0, 1)[0]; + var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; + + position = this.insertInLine(position, firstLine); + if (lastLine !== null) { + position = this.insertNewLine(position); // terminate first line + position = this._insertLines(position.row, lines); + position = this.insertInLine(position, lastLine || ""); + } + return position; + }; + this.insertLines = function (row, lines) { + if (row >= this.getLength()) + return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); + return this._insertLines(Math.max(row, 0), lines); + }; + this._insertLines = function (row, lines) { + if (lines.length == 0) + return {row: row, column: 0}; + var end; + if (lines.length > 0xFFFF) { + end = this._insertLines(row, lines.slice(0xFFFF)); + lines = lines.slice(0, 0xFFFF); + } + + var args = [row, 0]; + args.push.apply(args, lines); + this.$lines.splice.apply(this.$lines, args); + + var range = new Range(row, 0, row + lines.length, 0); + var delta = { + action: "insertLines", + range: range, + lines: lines + }; + this._emit("change", { data: delta }); + return end || range.end; + }; + this.insertNewLine = function (position) { + position = this.$clipPosition(position); + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column); + this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); + + var end = { + row: position.row + 1, + column: 0 + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + + return end; + }; + this.insertInLine = function (position, text) { + if (text.length == 0) + return position; + + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column) + text + + line.substring(position.column); + + var end = { + row: position.row, + column: position.column + text.length + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: text + }; + this._emit("change", { data: delta }); + + return end; + }; + this.remove = function (range) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + range.start = this.$clipPosition(range.start); + range.end = this.$clipPosition(range.end); + + if (range.isEmpty()) + return range.start; + + var firstRow = range.start.row; + var lastRow = range.end.row; + + if (range.isMultiLine()) { + var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; + var lastFullRow = lastRow - 1; + + if (range.end.column > 0) + this.removeInLine(lastRow, 0, range.end.column); + + if (lastFullRow >= firstFullRow) + this._removeLines(firstFullRow, lastFullRow); + + if (firstFullRow != firstRow) { + this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); + this.removeNewLine(range.start.row); + } + } + else { + this.removeInLine(firstRow, range.start.column, range.end.column); + } + return range.start; + }; + this.removeInLine = function (row, startColumn, endColumn) { + if (startColumn == endColumn) + return; + + var range = new Range(row, startColumn, row, endColumn); + var line = this.getLine(row); + var removed = line.substring(startColumn, endColumn); + var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); + this.$lines.splice(row, 1, newLine); + + var delta = { + action: "removeText", + range: range, + text: removed + }; + this._emit("change", { data: delta }); + return range.start; + }; + this.removeLines = function (firstRow, lastRow) { + if (firstRow < 0 || lastRow >= this.getLength()) + return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); + return this._removeLines(firstRow, lastRow); + }; + + this._removeLines = function (firstRow, lastRow) { + var range = new Range(firstRow, 0, lastRow + 1, 0); + var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); + + var delta = { + action: "removeLines", + range: range, + nl: this.getNewLineCharacter(), + lines: removed + }; + this._emit("change", { data: delta }); + return removed; + }; + this.removeNewLine = function (row) { + var firstLine = this.getLine(row); + var secondLine = this.getLine(row + 1); + + var range = new Range(row, firstLine.length, row + 1, 0); + var line = firstLine + secondLine; + + this.$lines.splice(row, 2, line); + + var delta = { + action: "removeText", + range: range, + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + }; + this.replace = function (range, text) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + if (text.length == 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + var end; + if (text) { + end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function (deltas) { + for (var i = 0; i < deltas.length; i++) { + var delta = deltas[i]; + var range = Range.fromPoints(delta.range.start, delta.range.end); + + if (delta.action == "insertLines") + this.insertLines(range.start.row, delta.lines); + else if (delta.action == "insertText") + this.insert(range.start, delta.text); + else if (delta.action == "removeLines") + this._removeLines(range.start.row, range.end.row - 1); + else if (delta.action == "removeText") + this.remove(range); + } + }; + this.revertDeltas = function (deltas) { + for (var i = deltas.length - 1; i >= 0; i--) { + var delta = deltas[i]; + + var range = Range.fromPoints(delta.range.start, delta.range.end); + + if (delta.action == "insertLines") + this._removeLines(range.start.row, range.end.row - 1); + else if (delta.action == "insertText") + this.remove(range); + else if (delta.action == "removeLines") + this._insertLines(range.start.row, delta.lines); + else if (delta.action == "removeText") + this.insert(range.start, delta.text); + } + }; + this.indexToPosition = function (index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l - 1, column: lines[l - 1].length}; + }; + this.positionToIndex = function (pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + + }).call(Document.prototype); + + exports.Document = Document; +}); + +define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + var EventEmitter = {}; + var stopPropagation = function () { + this.propagationStopped = true; + }; + var preventDefault = function () { + this.defaultPrevented = true; + }; + + EventEmitter._emit = + EventEmitter._dispatchEvent = function (eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + + if (typeof e != "object" || !e) + e = {}; + + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + + listeners = listeners.slice(); + for (var i = 0; i < listeners.length; i++) { + listeners[i](e, this); + if (e.propagationStopped) + break; + } + + if (defaultHandler && !e.defaultPrevented) + return defaultHandler(e, this); + }; + + + EventEmitter._signal = function (eventName, e) { + var listeners = (this._eventRegistry || {})[eventName]; + if (!listeners) + return; + listeners = listeners.slice(); + for (var i = 0; i < listeners.length; i++) + listeners[i](e, this); + }; + + EventEmitter.once = function (eventName, callback) { + var _self = this; + callback && this.addEventListener(eventName, function newCallback() { + _self.removeEventListener(eventName, newCallback); + callback.apply(null, arguments); + }); + }; + + + EventEmitter.setDefaultHandler = function (eventName, callback) { + var handlers = this._defaultHandlers + if (!handlers) + handlers = this._defaultHandlers = {_disabled_: {}}; + + if (handlers[eventName]) { + var old = handlers[eventName]; + var disabled = handlers._disabled_[eventName]; + if (!disabled) + handlers._disabled_[eventName] = disabled = []; + disabled.push(old); + var i = disabled.indexOf(callback); + if (i != -1) + disabled.splice(i, 1); + } + handlers[eventName] = callback; + }; + EventEmitter.removeDefaultHandler = function (eventName, callback) { + var handlers = this._defaultHandlers + if (!handlers) + return; + var disabled = handlers._disabled_[eventName]; + + if (handlers[eventName] == callback) { + var old = handlers[eventName]; + if (disabled) + this.setDefaultHandler(eventName, disabled.pop()); + } else if (disabled) { + var i = disabled.indexOf(callback); + if (i != -1) + disabled.splice(i, 1); + } + }; + + EventEmitter.on = + EventEmitter.addEventListener = function (eventName, callback, capturing) { + this._eventRegistry = this._eventRegistry || {}; + + var listeners = this._eventRegistry[eventName]; + if (!listeners) + listeners = this._eventRegistry[eventName] = []; + + if (listeners.indexOf(callback) == -1) + listeners[capturing ? "unshift" : "push"](callback); + return callback; + }; + + EventEmitter.off = + EventEmitter.removeListener = + EventEmitter.removeEventListener = function (eventName, callback) { + this._eventRegistry = this._eventRegistry || {}; + + var listeners = this._eventRegistry[eventName]; + if (!listeners) + return; + + var index = listeners.indexOf(callback); + if (index !== -1) + listeners.splice(index, 1); + }; + + EventEmitter.removeAllListeners = function (eventName) { + if (this._eventRegistry) this._eventRegistry[eventName] = []; + }; + + exports.EventEmitter = EventEmitter; + +}); + +define('ace/range', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + var comparePoints = function (p1, p2) { + return p1.row - p2.row || p1.column - p2.column; + }; + var Range = function (startRow, startColumn, endRow, endColumn) { + this.start = { + row: startRow, + column: startColumn + }; + + this.end = { + row: endRow, + column: endColumn + }; + }; + + (function () { + this.isEqual = function (range) { + return this.start.row === range.start.row && + this.end.row === range.end.row && + this.start.column === range.start.column && + this.end.column === range.end.column; + }; + this.toString = function () { + return ("Range: [" + this.start.row + "/" + this.start.column + + "] -> [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function (row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function (range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function (p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function (range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function (range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function (row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function (row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function (row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function (row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function (row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function (row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function (row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function (row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + } + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function (row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function (row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function (row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function (firstRow, lastRow) { + var start, end; + if (this.end.row > lastRow) + end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function (row, column) { + var cmp = this.compare(row, column); + var start, end; + if (cmp == 0) + return this; + else if (cmp == -1) + start = {row: row, column: column}; + else + end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function () { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function () { + return (this.start.row !== this.end.row); + }; + this.clone = function () { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function () { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function (session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function (row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + + }).call(Range.prototype); + Range.fromPoints = function (start, end) { + return new Range(start.row, start.column, end.row, end.column); + }; + Range.comparePoints = comparePoints; + + Range.comparePoints = function (p1, p2) { + return p1.row - p2.row || p1.column - p2.column; + }; + + + exports.Range = Range; +}); + +define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function (require, exports, module) { + "use strict"; + + var oop = require("./lib/oop"); + var EventEmitter = require("./lib/event_emitter").EventEmitter; + + var Anchor = exports.Anchor = function (doc, row, column) { + this.$onChange = this.onChange.bind(this); + this.attach(doc); + + if (typeof column == "undefined") + this.setPosition(row.row, row.column); + else + this.setPosition(row, column); + }; + + (function () { + + oop.implement(this, EventEmitter); + this.getPosition = function () { + return this.$clipPositionToDocument(this.row, this.column); + }; + this.getDocument = function () { + return this.document; + }; + this.$insertRight = false; + this.onChange = function (e) { + var delta = e.data; + var range = delta.range; + + if (range.start.row == range.end.row && range.start.row != this.row) + return; + + if (range.start.row > this.row) + return; + + if (range.start.row == this.row && range.start.column > this.column) + return; + + var row = this.row; + var column = this.column; + var start = range.start; + var end = range.end; + + if (delta.action === "insertText") { + if (start.row === row && start.column <= column) { + if (start.column === column && this.$insertRight) { + } else if (start.row === end.row) { + column += end.column - start.column; + } else { + column -= start.column; + row += end.row - start.row; + } + } else if (start.row !== end.row && start.row < row) { + row += end.row - start.row; + } + } else if (delta.action === "insertLines") { + if (start.row <= row) { + row += end.row - start.row; + } + } else if (delta.action === "removeText") { + if (start.row === row && start.column < column) { + if (end.column >= column) + column = start.column; + else + column = Math.max(0, column - (end.column - start.column)); + + } else if (start.row !== end.row && start.row < row) { + if (end.row === row) + column = Math.max(0, column - end.column) + start.column; + row -= (end.row - start.row); + } else if (end.row === row) { + row -= end.row - start.row; + column = Math.max(0, column - end.column) + start.column; + } + } else if (delta.action == "removeLines") { + if (start.row <= row) { + if (end.row <= row) + row -= end.row - start.row; + else { + row = start.row; + column = 0; + } + } + } + + this.setPosition(row, column, true); + }; + this.setPosition = function (row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._emit("change", { + old: old, + value: pos + }); + }; + this.detach = function () { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function (doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function (row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + + }).call(Anchor.prototype); + +}); + +define('ace/lib/lang', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + exports.stringReverse = function (string) { + return string.split("").reverse().join(""); + }; + + exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; + }; + + var trimBeginRegexp = /^\s\s*/; + var trimEndRegexp = /\s\s*$/; + + exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); + }; + + exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); + }; + + exports.copyObject = function (obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; + }; + + exports.copyArray = function (array) { + var copy = []; + for (var i = 0, l = array.length; i < l; i++) { + if (array[i] && typeof array[i] == "object") + copy[i] = this.copyObject(array[i]); + else + copy[i] = array[i]; + } + return copy; + }; + + exports.deepCopy = function (obj) { + if (typeof obj !== "object" || !obj) + return obj; + var cons = obj.constructor; + if (cons === RegExp) + return obj; + + var copy = cons(); + for (var key in obj) { + if (typeof obj[key] === "object") { + copy[key] = exports.deepCopy(obj[key]); + } else { + copy[key] = obj[key]; + } + } + return copy; + }; + + exports.arrayToMap = function (arr) { + var map = {}; + for (var i = 0; i < arr.length; i++) { + map[arr[i]] = 1; + } + return map; + + }; + + exports.createMap = function (props) { + var map = Object.create(null); + for (var i in props) { + map[i] = props[i]; + } + return map; + }; + exports.arrayRemove = function (array, value) { + for (var i = 0; i <= array.length; i++) { + if (value === array[i]) { + array.splice(i, 1); + } + } + }; + + exports.escapeRegExp = function (str) { + return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); + }; + + exports.escapeHTML = function (str) { + return str.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (isNaN(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + + var hex, + i, + string = '', + uffff; + + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + + while (ch && ch <= ' ') { + next(); + } + }, + + strictWhite = function () { + + while (ch && ( ch == ' ' || ch == '\t')) { + next(); + } + }, + + newLine = function () { + if (ch == '\n') next(); + }, + + word = function () { + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + // parses and returns the method + method = function () { + switch (ch) { + case 'G': + next('G'); + next('E'); + next('T'); + return "GET"; + case 'H': + next('H'); + next('E'); + next('A'); + next('D'); + return "HEAD"; + case 'D': + next('D'); + next('E'); + next('L'); + next('E'); + next('T'); + next('E'); + return "DELETE"; + case 'P': + next('P'); + switch (ch) { + case 'U': + next('U'); + next('T'); + return "PUT"; + case 'O': + next('O'); + next('S'); + next('T'); + return "POST"; + default: + error("Unexpected '" + ch + "'"); + } + break; + default: + error("Expected one of GET/POST/PUT/DELETE/HEAD"); + } + + }, + + value, // Place holder for the value function. + + array = function () { + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + + value = function () { + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } + }; + + var url = function () { + + var url = ''; + while (ch && ch != '\n') { + url += ch; + next(); + } + if (url == '') + error('Missing url'); + return url; + }, + + request = function () { + white(); + var meth = method(); + strictWhite(); + url(); + strictWhite(); // advance to one new line + newLine(); + strictWhite(); + if (ch == '{') { + object(); + } + // multi doc request + strictWhite(); // advance to one new line + newLine(); + strictWhite(); + while (ch == '{') { + // another object + object(); + strictWhite(); + newLine(); + strictWhite(); + } + + }, + + comment = function () { + while (ch == '#') { + while (ch && ch !== '\n') { + next(); + } + white(); + } + }, + + multi_request = function () { + while (ch && ch != '') { + white(); + if (!ch) { + continue; + } + try { + comment(); + white(); + if (!ch) { + continue; + } + request(); + white(); + } + catch (e) { + annotate("error", e.message); + // snap + var substring = text.substr(at); + var nextMatch = substring.search(/^POST|HEAD|GET|PUT|DELETE/m); + if (nextMatch < 1) return; + reset(at + nextMatch); + } + } + }; + + + return function (source, reviver) { + var result; + + text = source; + at = 0; + annos = []; + next(); + multi_request(); + white(); + if (ch) { + annotate("error", "Syntax error"); + } + + result = { "annotations": annos }; + + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + })({'': result}, '') : result; + }; +}); + + +define("sense_editor/mode/worker", ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', + 'sense_editor/mode/worker_parser'], function (require, exports, module) { + "use strict"; + + + var oop = require("ace/lib/oop"); + var Mirror = require("ace/worker/mirror").Mirror; + var parse = require("sense_editor/mode/worker_parser"); + + var SenseWorker = exports.SenseWorker = function (sender) { + Mirror.call(this, sender); + this.setTimeout(200); + }; + + oop.inherits(SenseWorker, Mirror); + + (function () { + + this.onUpdate = function () { + var value = this.doc.getValue(); + var pos, result; + try { + result = parse(value); + } catch (e) { + pos = this.charToDocumentPosition(e.at - 1); + this.sender.emit("error", { + row: pos.row, + column: pos.column, + text: e.message, + type: "error" + }); + return; + } + for (var i = 0; i < result.annotations.length; i++) { + pos = this.charToDocumentPosition(result.annotations[i].at - 1); + result.annotations[i].row = pos.row; + result.annotations[i].column = pos.column; + + } + this.sender.emit("ok", result.annotations); + }; + + this.charToDocumentPosition = function (charPos) { + var i = 0; + var len = this.doc.getLength(); + var nl = this.doc.getNewLineCharacter().length; + + if (!len) { + return { row: 0, column: 0}; + } + + var lineStart = 0, line; + while (i < len) { + line = this.doc.getLine(i); + var lineLength = line.length + nl; + if (lineStart + lineLength > charPos) + return { + row: i, + column: charPos - lineStart + }; + + lineStart += lineLength; + i += 1; + } + + return { + row: i - 1, + column: line.length + }; + }; + + }).call(SenseWorker.prototype); + +}); + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/row_parser.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/row_parser.js new file mode 100644 index 0000000..f7cbbe4 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/row_parser.js @@ -0,0 +1,123 @@ +let MODE = { + REQUEST_START: 2, + IN_REQUEST: 4, + MULTI_DOC_CUR_DOC_END: 8, + REQUEST_END: 16, + BETWEEN_REQUESTS: 32 + +}; + +function RowParser(editor) { + var defaultEditor = editor; + + this.getRowParseMode = function (row) { + if (row == null || typeof row == "undefined") { + row = editor.getCursorPosition().row; + } + + var session = editor.getSession(); + if (row >= session.getLength() || row < 0) { + return MODE.BETWEEN_REQUESTS; + } + var mode = session.getState(row); + if (!mode) { + return MODE.BETWEEN_REQUESTS; + } // shouldn't really happen + + if (mode !== "start") { + return MODE.IN_REQUEST; + } + var line = (session.getLine(row) || "").trim(); + if (!line || line[0] === '#') { + return MODE.BETWEEN_REQUESTS; + } // empty line or a comment waiting for a new req to start + + if (line.indexOf("}", line.length - 1) >= 0) { + // check for a multi doc request (must start a new json doc immediately after this one end. + row++; + if (row < session.getLength()) { + line = (session.getLine(row) || "").trim(); + if (line.indexOf("{") === 0) { // next line is another doc in a multi doc + return MODE.MULTI_DOC_CUR_DOC_END | MODE.IN_REQUEST; + } + + } + return MODE.REQUEST_END | MODE.MULTI_DOC_CUR_DOC_END; // end of request + } + + // check for single line requests + row++; + if (row >= session.getLength()) { + return MODE.REQUEST_START | MODE.REQUEST_END; + } + line = (session.getLine(row) || "").trim(); + if (line.indexOf("{") !== 0) { // next line is another request + return MODE.REQUEST_START | MODE.REQUEST_END; + } + + return MODE.REQUEST_START; + }; + + this.rowPredicate = function (row, editor, value) { + var mode = this.getRowParseMode(row, editor); + return (mode & value) > 0; + }; + + this.isEndRequestRow = function (row, _e) { + var editor = _e || defaultEditor; + return this.rowPredicate(row, editor, MODE.REQUEST_END); + }; + + this.isRequestEdge = function (row, _e) { + var editor = _e || defaultEditor; + return this.rowPredicate(row, editor, MODE.REQUEST_END | MODE.REQUEST_START); + }; + + this.isStartRequestRow = function (row, _e) { + var editor = _e || defaultEditor; + return this.rowPredicate(row, editor, MODE.REQUEST_START); + }; + + this.isInBetweenRequestsRow = function (row, _e) { + var editor = _e || defaultEditor; + return this.rowPredicate(row, editor, MODE.BETWEEN_REQUESTS); + }; + + this.isInRequestsRow = function (row, _e) { + var editor = _e || defaultEditor; + return this.rowPredicate(row, editor, MODE.IN_REQUEST); + }; + + this.isMultiDocDocEndRow = function (row, _e) { + var editor = _e || defaultEditor; + return this.rowPredicate(row, editor, MODE.MULTI_DOC_CUR_DOC_END); + }; + + this.isEmptyToken = function (tokenOrTokenIter) { + var token = tokenOrTokenIter && tokenOrTokenIter.getCurrentToken ? tokenOrTokenIter.getCurrentToken() : tokenOrTokenIter; + return !token || token.type == "whitespace" + }; + + this.isUrlOrMethodToken = function (tokenOrTokenIter) { + var t = tokenOrTokenIter.getCurrentToken ? tokenOrTokenIter.getCurrentToken() : tokenOrTokenIter; + return t && t.type && (t.type == "method" || t.type.indexOf("url") === 0); + }; + + + this.nextNonEmptyToken = function (tokenIter) { + var t = tokenIter.stepForward(); + while (t && this.isEmptyToken(t)) t = tokenIter.stepForward(); + return t; + }; + + this.prevNonEmptyToken = function (tokenIter) { + var t = tokenIter.stepBackward(); + // empty rows return null token. + while ((t || tokenIter.getCurrentTokenRow() > 0) && this.isEmptyToken(t)) t = tokenIter.stepBackward(); + return t; + }; +} + +RowParser.prototype.MODE = MODE; + +module.exports = RowParser; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/theme-sense-dark.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/theme-sense-dark.js new file mode 100644 index 0000000..bf25de1 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/sense_editor/theme-sense-dark.js @@ -0,0 +1,115 @@ +let ace = require('ace'); + +ace.define("ace/theme/sense-dark", ['require', 'exports', 'module'], + function (require, exports, module) { + exports.isDark = true; + exports.cssClass = "ace-sense-dark"; + exports.cssText = ".ace-sense-dark .ace_gutter {\ +background: #2e3236;\ +color: #bbbfc2;\ +}\ +.ace-sense-dark .ace_print-margin {\ +width: 1px;\ +background: #555651\ +}\ +.ace-sense-dark .ace_scroller {\ +background-color: #202328;\ +}\ +.ace-sense-dark .ace_content {\ +}\ +.ace-sense-dark .ace_text-layer {\ +color: #F8F8F2\ +}\ +.ace-sense-dark .ace_cursor {\ +border-left: 2px solid #F8F8F0\ +}\ +.ace-sense-dark .ace_overwrite-cursors .ace_cursor {\ +border-left: 0px;\ +border-bottom: 1px solid #F8F8F0\ +}\ +.ace-sense-dark .ace_marker-layer .ace_selection {\ +background: #222\ +}\ +.ace-sense-dark.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #272822;\ +border-radius: 2px\ +}\ +.ace-sense-dark .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-sense-dark .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #49483E\ +}\ +.ace-sense-dark .ace_marker-layer .ace_active-line {\ +background: #202020\ +}\ +.ace-sense-dark .ace_gutter-active-line {\ +background-color: #272727\ +}\ +.ace-sense-dark .ace_marker-layer .ace_selected-word {\ +border: 1px solid #49483E\ +}\ +.ace-sense-dark .ace_invisible {\ +color: #49483E\ +}\ +.ace-sense-dark .ace_entity.ace_name.ace_tag,\ +.ace-sense-dark .ace_keyword,\ +.ace-sense-dark .ace_meta,\ +.ace-sense-dark .ace_storage {\ +color: #F92672\ +}\ +.ace-sense-dark .ace_constant.ace_character,\ +.ace-sense-dark .ace_constant.ace_language,\ +.ace-sense-dark .ace_constant.ace_numeric,\ +.ace-sense-dark .ace_constant.ace_other {\ +color: #AE81FF\ +}\ +.ace-sense-dark .ace_invalid {\ +color: #F8F8F0;\ +background-color: #F92672\ +}\ +.ace-sense-dark .ace_invalid.ace_deprecated {\ +color: #F8F8F0;\ +background-color: #AE81FF\ +}\ +.ace-sense-dark .ace_support.ace_constant,\ +.ace-sense-dark .ace_support.ace_function {\ +color: #66D9EF\ +}\ +.ace-sense-dark .ace_fold {\ +background-color: #A6E22E;\ +border-color: #F8F8F2\ +}\ +.ace-sense-dark .ace_storage.ace_type,\ +.ace-sense-dark .ace_support.ace_class,\ +.ace-sense-dark .ace_support.ace_type {\ +font-style: italic;\ +color: #66D9EF\ +}\ +.ace-sense-dark .ace_entity.ace_name.ace_function,\ +.ace-sense-dark .ace_entity.ace_other.ace_attribute-name,\ +.ace-sense-dark .ace_variable {\ +color: #A6E22E\ +}\ +.ace-sense-dark .ace_variable.ace_parameter {\ +font-style: italic;\ +color: #FD971F\ +}\ +.ace-sense-dark .ace_string {\ +color: #E6DB74\ +}\ +.ace-sense-dark .ace_comment {\ +color: #629755\ +}\ +.ace-sense-dark .ace_markup.ace_underline {\ +text-decoration: underline\ +}\ +.ace-sense-dark .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ11D6z7Bq1ar/ABCKBG6g04U2AAAAAElFTkSuQmCC) right repeat-y\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); + }); + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/settings.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/settings.js new file mode 100644 index 0000000..79cbc4a --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/settings.js @@ -0,0 +1,74 @@ +let $ = require('jquery'); +let es = require('./es'); +const storage = require('./storage'); + +function getFontSize() { + return storage.get('font_size', 12); +} + +function setFontSize(size) { + storage.set('font_size', size); + applyCurrentSettings(); + return true; +} + +function getWrapMode() { + return storage.get('wrap_mode', true); +} + +function setWrapMode(mode) { + storage.set('wrap_mode', mode); + applyCurrentSettings(); + return true; +} + +function setBasicAuth(mode) { + storage.set('basic_auth', mode); + applyCurrentSettings(); + return true; +} + +function getAutocomplete() { + return storage.get('autocomplete_settings', { fields: true, indices: true }); +} + +function setAutocomplete(settings) { + storage.set('autocomplete_settings', settings); + return true; +} + +function applyCurrentSettings(editor) { + if (typeof editor === 'undefined') { + applyCurrentSettings(require('./input')); + applyCurrentSettings(require('./output')); + } + if (editor) { + editor.getSession().setUseWrapMode(getWrapMode()); + editor.$el.css('font-size', getFontSize() + 'px'); + } +} + +function getCurrentSettings() { + return { + autocomplete: getAutocomplete(), + wrapMode: getWrapMode(), + fontSize: parseFloat(getFontSize()), + }; +} + +function updateSettings({ fontSize, wrapMode, autocomplete}) { + setFontSize(fontSize); + setWrapMode(wrapMode); + setAutocomplete(autocomplete); + require('./input').focus(); + es.forceRefresh(); + return getCurrentSettings(); +} + +module.exports = { + getAutocomplete, + applyCurrentSettings, + + getCurrentSettings, + updateSettings, +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/smart_resize.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/smart_resize.js new file mode 100644 index 0000000..099b2fa --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/smart_resize.js @@ -0,0 +1,43 @@ +import { throttle } from 'lodash'; + +module.exports = function (editor) { + let resize = editor.resize; + let lastDemensions = []; + let timeout = null; + + let checkDelay = 250; + let stableChecks = 0; + let maxStableChecks = 20; + + function check() { + clearTimeout(timeout); + + const $container = editor.$el.parent(); + const demensions = [$container.width(), $container.height()]; + const [ width, height ] = demensions; + const [ lastWidth, lastHieght ] = lastDemensions; + lastDemensions = demensions; + + if (width !== lastWidth || height !== lastHieght) { + resize.call(editor, true); + stableChecks = 0; + } else { + stableChecks += 1; + } + + if (stableChecks < maxStableChecks) { + scheduleCheck(); + } + } + + function scheduleCheck() { + if (!timeout) timeout = setTimeout(check, checkDelay); + } + + function requestResize() { + stableChecks = 0; + scheduleCheck(); + } + + return requestResize; +}; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/storage.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/storage.js new file mode 100644 index 0000000..c23a11f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/storage.js @@ -0,0 +1,58 @@ +const { transform, keys, startsWith } = require('lodash'); + +class Storage { + constructor(engine, prefix) { + this.engine = engine; + this.prefix = prefix; + } + + encode(val) { + return JSON.stringify(val); + } + + decode(val) { + if (typeof val === 'string') { + return JSON.parse(val); + } + } + + encodeKey(key) { + return `${this.prefix}${key}`; + } + + decodeKey(key) { + if (startsWith(key, this.prefix)) { + return `${key.slice(this.prefix.length)}`; + } + } + + set(key, val) { + this.engine.setItem(this.encodeKey(key), this.encode(val)); + return val; + } + + has(key) { + return this.engine.getItem(this.encodeKey(key)) != null; + } + + get(key, _default) { + if (this.has(key)) { + return this.decode(this.engine.getItem(this.encodeKey(key))); + } else { + return _default; + } + } + + delete(key) { + return this.engine.removeItem(this.encodeKey(key)); + } + + keys() { + return transform(keys(this.engine), (ours, key) => { + const ourKey = this.decodeKey(key); + if (ourKey != null) ours.push(ourKey); + }); + } +} + +module.exports = new Storage(localStorage, 'sense:'); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/utils.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/utils.js new file mode 100644 index 0000000..0c6425d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/src/utils.js @@ -0,0 +1,45 @@ +var utils = {}; + +utils.textFromRequest = function (request) { + var data = request.data; + if (typeof data != "string") { + data = data.join("\n"); + } + return request.method + " " + request.url + "\n" + data; +}; + +utils.getUrlParam = function (name) { + name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); +}; + +utils.jsonToString = function (data, indent) { + return JSON.stringify(data, null, indent ? 2 : 0); +}; + +utils.reformatData = function (data, indent) { + var changed = false; + var formatted_data = []; + for (var i = 0; i < data.length; i++) { + var cur_doc = data[i]; + try { + var new_doc = utils.jsonToString(JSON.parse(cur_doc), indent ? 2 : 0); + changed = changed || new_doc != cur_doc; + formatted_data.push(new_doc); + } + catch (e) { + console.log(e); + formatted_data.push(cur_doc); + } + } + + return { + changed: changed, + data: formatted_data + }; +}; + + +module.exports = utils; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace.js new file mode 100644 index 0000000..0dae3d3 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace.js @@ -0,0 +1,2 @@ +require('ace/ace.js'); +module.exports = window.ace; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ace.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ace.js new file mode 100644 index 0000000..acf403b --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ace.js @@ -0,0 +1,17310 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +(function() { + +var ACE_NAMESPACE = "ace"; + +var global = (function() { + return this; +})(); + + +if (!ACE_NAMESPACE && typeof requirejs !== "undefined") + return; + + +var _define = function(module, deps, payload) { + if (typeof module !== 'string') { + if (_define.original) + _define.original.apply(window, arguments); + else { + console.error('dropping module because define wasn\'t a string.'); + console.trace(); + } + return; + } + + if (arguments.length == 2) + payload = deps; + + if (!_define.modules) { + _define.modules = {}; + _define.payloads = {}; + } + + _define.payloads[module] = payload; + _define.modules[module] = null; +}; +var _require = function(parentId, module, callback) { + if (Object.prototype.toString.call(module) === "[object Array]") { + var params = []; + for (var i = 0, l = module.length; i < l; ++i) { + var dep = lookup(parentId, module[i]); + if (!dep && _require.original) + return _require.original.apply(window, arguments); + params.push(dep); + } + if (callback) { + callback.apply(null, params); + } + } + else if (typeof module === 'string') { + var payload = lookup(parentId, module); + if (!payload && _require.original) + return _require.original.apply(window, arguments); + + if (callback) { + callback(); + } + + return payload; + } + else { + if (_require.original) + return _require.original.apply(window, arguments); + } +}; + +var normalizeModule = function(parentId, moduleName) { + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]); + } + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = base + "/" + moduleName; + + while(moduleName.indexOf(".") !== -1 && previous != moduleName) { + var previous = moduleName; + moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + + return moduleName; +}; +var lookup = function(parentId, moduleName) { + + moduleName = normalizeModule(parentId, moduleName); + + var module = _define.modules[moduleName]; + if (!module) { + module = _define.payloads[moduleName]; + if (typeof module === 'function') { + var exports = {}; + var mod = { + id: moduleName, + uri: '', + exports: exports, + packaged: true + }; + + var req = function(module, callback) { + return _require(moduleName, module, callback); + }; + + var returnValue = module(req, exports, mod); + exports = returnValue || mod.exports; + _define.modules[moduleName] = exports; + delete _define.payloads[moduleName]; + } + module = _define.modules[moduleName] = exports || module; + } + return module; +}; + +function exportAce(ns) { + var require = function(module, callback) { + return _require("", module, callback); + }; + + var root = global; + if (ns) { + if (!global[ns]) + global[ns] = {}; + root = global[ns]; + } + + if (!root.define || !root.define.packaged) { + _define.original = root.define; + root.define = _define; + root.define.packaged = true; + } + + if (!root.require || !root.require.packaged) { + _require.original = root.require; + root.require = require; + root.require.packaged = true; + } +} + +exportAce(ACE_NAMESPACE); + +})(); + +ace.define('ace/ace', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/lib/dom', 'ace/lib/event', 'ace/editor', 'ace/edit_session', 'ace/undomanager', 'ace/virtual_renderer', 'ace/multi_select', 'ace/worker/worker_client', 'ace/keyboard/hash_handler', 'ace/placeholder', 'ace/mode/folding/fold_mode', 'ace/theme/textmate', 'ace/ext/error_marker', 'ace/config'], function(require, exports, module) { + + +require("./lib/fixoldbrowsers"); + +var dom = require("./lib/dom"); +var event = require("./lib/event"); + +var Editor = require("./editor").Editor; +var EditSession = require("./edit_session").EditSession; +var UndoManager = require("./undomanager").UndoManager; +var Renderer = require("./virtual_renderer").VirtualRenderer; +var MultiSelect = require("./multi_select").MultiSelect; +require("./worker/worker_client"); +require("./keyboard/hash_handler"); +require("./placeholder"); +require("./mode/folding/fold_mode"); +require("./theme/textmate"); +require("./ext/error_marker"); + +exports.config = require("./config"); +exports.require = require; +exports.edit = function(el) { + if (typeof(el) == "string") { + var _id = el; + var el = document.getElementById(_id); + if (!el) + throw new Error("ace.edit can't find div #" + _id); + } + + if (el.env && el.env.editor instanceof Editor) + return el.env.editor; + + var doc = exports.createEditSession(dom.getInnerText(el)); + el.innerHTML = ''; + + var editor = new Editor(new Renderer(el)); + new MultiSelect(editor); + editor.setSession(doc); + + var env = { + document: doc, + editor: editor, + onResize: editor.resize.bind(editor, null) + }; + event.addListener(window, "resize", env.onResize); + editor.on("destroy", function() { + event.removeListener(window, "resize", env.onResize); + }); + el.env = editor.env = env; + return editor; +}; +exports.createEditSession = function(text, mode) { + var doc = new EditSession(text, mode); + doc.setUndoManager(new UndoManager()); + return doc; +} +exports.EditSession = EditSession; +exports.UndoManager = UndoManager; +}); + +ace.define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/regexp', 'ace/lib/es5-shim'], function(require, exports, module) { + + +require("./regexp"); +require("./es5-shim"); + +}); + +ace.define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, exports, module) { + + var real = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups + compliantLastIndexIncrement = function () { + var x = /^/g; + real.test.call(x, ""); + return !x.lastIndex; + }(); + + if (compliantLastIndexIncrement && compliantExecNpcg) + return; + RegExp.prototype.exec = function (str) { + var match = real.exec.apply(this, arguments), + name, r2; + if ( typeof(str) == 'string' && match) { + if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { + r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", "")); + real.replace.call(str.slice(match.index), r2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) + match[i] = undefined; + } + }); + } + if (this._xregexp && this._xregexp.captureNames) { + for (var i = 1; i < match.length; i++) { + name = this._xregexp.captureNames[i - 1]; + if (name) + match[name] = match[i]; + } + } + if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + } + return match; + }; + if (!compliantLastIndexIncrement) { + RegExp.prototype.test = function (str) { + var match = real.exec.call(this, str); + if (match && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + return !!match; + }; + } + + function getNativeFlags (regex) { + return (regex.global ? "g" : "") + + (regex.ignoreCase ? "i" : "") + + (regex.multiline ? "m" : "") + + (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 + (regex.sticky ? "y" : ""); + } + + function indexOf (array, item, from) { + if (Array.prototype.indexOf) // Use the native array method if available + return array.indexOf(item, from); + for (var i = from || 0; i < array.length; i++) { + if (array[i] === item) + return i; + } + return -1; + } + +}); + +ace.define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) { + +function Empty() {} + +if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { // .length is 1 + var target = this; + if (typeof target != "function") { + throw new TypeError("Function.prototype.bind called on incompatible " + target); + } + var args = slice.call(arguments, 1); // for normal call + var bound = function () { + + if (this instanceof bound) { + + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + if(target.prototype) { + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; +} +var call = Function.prototype.call; +var prototypeOfArray = Array.prototype; +var prototypeOfObject = Object.prototype; +var slice = prototypeOfArray.slice; +var _toString = call.bind(prototypeOfObject.toString); +var owns = call.bind(prototypeOfObject.hasOwnProperty); +var defineGetter; +var defineSetter; +var lookupGetter; +var lookupSetter; +var supportsAccessors; +if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { + defineGetter = call.bind(prototypeOfObject.__defineGetter__); + defineSetter = call.bind(prototypeOfObject.__defineSetter__); + lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); + lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); +} +if ([1,2].splice(0).length != 2) { + if(function() { // test IE < 9 to splice bug - see issue #138 + function makeArray(l) { + var a = new Array(l+2); + a[0] = a[1] = 0; + return a; + } + var array = [], lengthBefore; + + array.splice.apply(array, makeArray(20)); + array.splice.apply(array, makeArray(26)); + + lengthBefore = array.length; //46 + array.splice(5, 0, "XXX"); // add one element + + lengthBefore + 1 == array.length + + if (lengthBefore + 1 == array.length) { + return true;// has right splice implementation without bugs + } + }()) {//IE 6/7 + var array_splice = Array.prototype.splice; + Array.prototype.splice = function(start, deleteCount) { + if (!arguments.length) { + return []; + } else { + return array_splice.apply(this, [ + start === void 0 ? 0 : start, + deleteCount === void 0 ? (this.length - start) : deleteCount + ].concat(slice.call(arguments, 2))) + } + }; + } else {//IE8 + Array.prototype.splice = function(pos, removeCount){ + var length = this.length; + if (pos > 0) { + if (pos > length) + pos = length; + } else if (pos == void 0) { + pos = 0; + } else if (pos < 0) { + pos = Math.max(length + pos, 0); + } + + if (!(pos+removeCount < length)) + removeCount = length - pos; + + var removed = this.slice(pos, pos+removeCount); + var insert = slice.call(arguments, 2); + var add = insert.length; + if (pos === length) { + if (add) { + this.push.apply(this, insert); + } + } else { + var remove = Math.min(removeCount, length - pos); + var tailOldPos = pos + remove; + var tailNewPos = tailOldPos + add - remove; + var tailCount = length - tailOldPos; + var lengthAfterRemove = length - remove; + + if (tailNewPos < tailOldPos) { // case A + for (var i = 0; i < tailCount; ++i) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } else if (tailNewPos > tailOldPos) { // case B + for (i = tailCount; i--; ) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } // else, add == remove (nothing to do) + + if (add && pos === lengthAfterRemove) { + this.length = lengthAfterRemove; // truncate array + this.push.apply(this, insert); + } else { + this.length = lengthAfterRemove + add; // reserves space + for (i = 0; i < add; ++i) { + this[pos+i] = insert[i]; + } + } + } + return removed; + }; + } +} +if (!Array.isArray) { + Array.isArray = function isArray(obj) { + return _toString(obj) == "[object Array]"; + }; +} +var boxedString = Object("a"), + splitString = boxedString[0] != "a" || !(0 in boxedString); + +if (!Array.prototype.forEach) { + Array.prototype.forEach = function forEach(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + thisp = arguments[1], + i = -1, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(); // TODO message + } + + while (++i < length) { + if (i in self) { + fun.call(thisp, self[i], i, object); + } + } + }; +} +if (!Array.prototype.map) { + Array.prototype.map = function map(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = Array(length), + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) + result[i] = fun.call(thisp, self[i], i, object); + } + return result; + }; +} +if (!Array.prototype.filter) { + Array.prototype.filter = function filter(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = [], + value, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) { + value = self[i]; + if (fun.call(thisp, value, i, object)) { + result.push(value); + } + } + } + return result; + }; +} +if (!Array.prototype.every) { + Array.prototype.every = function every(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && !fun.call(thisp, self[i], i, object)) { + return false; + } + } + return true; + }; +} +if (!Array.prototype.some) { + Array.prototype.some = function some(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && fun.call(thisp, self[i], i, object)) { + return true; + } + } + return false; + }; +} +if (!Array.prototype.reduce) { + Array.prototype.reduce = function reduce(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduce of empty array with no initial value"); + } + + var i = 0; + var result; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i++]; + break; + } + if (++i >= length) { + throw new TypeError("reduce of empty array with no initial value"); + } + } while (true); + } + + for (; i < length; i++) { + if (i in self) { + result = fun.call(void 0, result, self[i], i, object); + } + } + + return result; + }; +} +if (!Array.prototype.reduceRight) { + Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + + var result, i = length - 1; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i--]; + break; + } + if (--i < 0) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + } while (true); + } + + do { + if (i in this) { + result = fun.call(void 0, result, self[i], i, object); + } + } while (i--); + + return result; + }; +} +if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { + Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + + var i = 0; + if (arguments.length > 1) { + i = toInteger(arguments[1]); + } + i = i >= 0 ? i : Math.max(0, length + i); + for (; i < length; i++) { + if (i in self && self[i] === sought) { + return i; + } + } + return -1; + }; +} +if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { + Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + var i = length - 1; + if (arguments.length > 1) { + i = Math.min(i, toInteger(arguments[1])); + } + i = i >= 0 ? i : length - Math.abs(i); + for (; i >= 0; i--) { + if (i in self && sought === self[i]) { + return i; + } + } + return -1; + }; +} +if (!Object.getPrototypeOf) { + Object.getPrototypeOf = function getPrototypeOf(object) { + return object.__proto__ || ( + object.constructor ? + object.constructor.prototype : + prototypeOfObject + ); + }; +} +if (!Object.getOwnPropertyDescriptor) { + var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + + "non-object: "; + Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT + object); + if (!owns(object, property)) + return; + + var descriptor, getter, setter; + descriptor = { enumerable: true, configurable: true }; + if (supportsAccessors) { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + + var getter = lookupGetter(object, property); + var setter = lookupSetter(object, property); + object.__proto__ = prototype; + + if (getter || setter) { + if (getter) descriptor.get = getter; + if (setter) descriptor.set = setter; + return descriptor; + } + } + descriptor.value = object[property]; + return descriptor; + }; +} +if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + return Object.keys(object); + }; +} +if (!Object.create) { + var createEmpty; + if (Object.prototype.__proto__ === null) { + createEmpty = function () { + return { "__proto__": null }; + }; + } else { + createEmpty = function () { + var empty = {}; + for (var i in empty) + empty[i] = null; + empty.constructor = + empty.hasOwnProperty = + empty.propertyIsEnumerable = + empty.isPrototypeOf = + empty.toLocaleString = + empty.toString = + empty.valueOf = + empty.__proto__ = null; + return empty; + } + } + + Object.create = function create(prototype, properties) { + var object; + if (prototype === null) { + object = createEmpty(); + } else { + if (typeof prototype != "object") + throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); + var Type = function () {}; + Type.prototype = prototype; + object = new Type(); + object.__proto__ = prototype; + } + if (properties !== void 0) + Object.defineProperties(object, properties); + return object; + }; +} + +function doesDefinePropertyWork(object) { + try { + Object.defineProperty(object, "sentinel", {}); + return "sentinel" in object; + } catch (exception) { + } +} +if (Object.defineProperty) { + var definePropertyWorksOnObject = doesDefinePropertyWork({}); + var definePropertyWorksOnDom = typeof document == "undefined" || + doesDefinePropertyWork(document.createElement("div")); + if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { + var definePropertyFallback = Object.defineProperty; + } +} + +if (!Object.defineProperty || definePropertyFallback) { + var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; + var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " + var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + + "on this javascript engine"; + + Object.defineProperty = function defineProperty(object, property, descriptor) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT_TARGET + object); + if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) + throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); + if (definePropertyFallback) { + try { + return definePropertyFallback.call(Object, object, property, descriptor); + } catch (exception) { + } + } + if (owns(descriptor, "value")) { + + if (supportsAccessors && (lookupGetter(object, property) || + lookupSetter(object, property))) + { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + delete object[property]; + object[property] = descriptor.value; + object.__proto__ = prototype; + } else { + object[property] = descriptor.value; + } + } else { + if (!supportsAccessors) + throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); + if (owns(descriptor, "get")) + defineGetter(object, property, descriptor.get); + if (owns(descriptor, "set")) + defineSetter(object, property, descriptor.set); + } + + return object; + }; +} +if (!Object.defineProperties) { + Object.defineProperties = function defineProperties(object, properties) { + for (var property in properties) { + if (owns(properties, property)) + Object.defineProperty(object, property, properties[property]); + } + return object; + }; +} +if (!Object.seal) { + Object.seal = function seal(object) { + return object; + }; +} +if (!Object.freeze) { + Object.freeze = function freeze(object) { + return object; + }; +} +try { + Object.freeze(function () {}); +} catch (exception) { + Object.freeze = (function freeze(freezeObject) { + return function freeze(object) { + if (typeof object == "function") { + return object; + } else { + return freezeObject(object); + } + }; + })(Object.freeze); +} +if (!Object.preventExtensions) { + Object.preventExtensions = function preventExtensions(object) { + return object; + }; +} +if (!Object.isSealed) { + Object.isSealed = function isSealed(object) { + return false; + }; +} +if (!Object.isFrozen) { + Object.isFrozen = function isFrozen(object) { + return false; + }; +} +if (!Object.isExtensible) { + Object.isExtensible = function isExtensible(object) { + if (Object(object) === object) { + throw new TypeError(); // TODO message + } + var name = ''; + while (owns(object, name)) { + name += '?'; + } + object[name] = true; + var returnValue = owns(object, name); + delete object[name]; + return returnValue; + }; +} +if (!Object.keys) { + var hasDontEnumBug = true, + dontEnums = [ + "toString", + "toLocaleString", + "valueOf", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "constructor" + ], + dontEnumsLength = dontEnums.length; + + for (var key in {"toString": null}) { + hasDontEnumBug = false; + } + + Object.keys = function keys(object) { + + if ( + (typeof object != "object" && typeof object != "function") || + object === null + ) { + throw new TypeError("Object.keys called on a non-object"); + } + + var keys = []; + for (var name in object) { + if (owns(object, name)) { + keys.push(name); + } + } + + if (hasDontEnumBug) { + for (var i = 0, ii = dontEnumsLength; i < ii; i++) { + var dontEnum = dontEnums[i]; + if (owns(object, dontEnum)) { + keys.push(dontEnum); + } + } + } + return keys; + }; + +} +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + + "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + + "\u2029\uFEFF"; +if (!String.prototype.trim || ws.trim()) { + ws = "[" + ws + "]"; + var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), + trimEndRegexp = new RegExp(ws + ws + "*$"); + String.prototype.trim = function trim() { + return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); + }; +} + +function toInteger(n) { + n = +n; + if (n !== n) { // isNaN + n = 0; + } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + return n; +} + +function isPrimitive(input) { + var type = typeof input; + return ( + input === null || + type === "undefined" || + type === "boolean" || + type === "number" || + type === "string" + ); +} + +function toPrimitive(input) { + var val, valueOf, toString; + if (isPrimitive(input)) { + return input; + } + valueOf = input.valueOf; + if (typeof valueOf === "function") { + val = valueOf.call(input); + if (isPrimitive(val)) { + return val; + } + } + toString = input.toString; + if (typeof toString === "function") { + val = toString.call(input); + if (isPrimitive(val)) { + return val; + } + } + throw new TypeError(); +} +var toObject = function (o) { + if (o == null) { // this matches both null and undefined + throw new TypeError("can't convert "+o+" to object"); + } + return Object(o); +}; + +}); + +ace.define('ace/lib/dom', ['require', 'exports', 'module' ], function(require, exports, module) { + + +if (typeof document == "undefined") + return; + +var XHTML_NS = "http://www.w3.org/1999/xhtml"; + +exports.getDocumentHead = function(doc) { + if (!doc) + doc = document; + return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; +} + +exports.createElement = function(tag, ns) { + return document.createElementNS ? + document.createElementNS(ns || XHTML_NS, tag) : + document.createElement(tag); +}; + +exports.hasCssClass = function(el, name) { + var classes = el.className.split(/\s+/g); + return classes.indexOf(name) !== -1; +}; +exports.addCssClass = function(el, name) { + if (!exports.hasCssClass(el, name)) { + el.className += " " + name; + } +}; +exports.removeCssClass = function(el, name) { + var classes = el.className.split(/\s+/g); + while (true) { + var index = classes.indexOf(name); + if (index == -1) { + break; + } + classes.splice(index, 1); + } + el.className = classes.join(" "); +}; + +exports.toggleCssClass = function(el, name) { + var classes = el.className.split(/\s+/g), add = true; + while (true) { + var index = classes.indexOf(name); + if (index == -1) { + break; + } + add = false; + classes.splice(index, 1); + } + if(add) + classes.push(name); + + el.className = classes.join(" "); + return add; +}; +exports.setCssClass = function(node, className, include) { + if (include) { + exports.addCssClass(node, className); + } else { + exports.removeCssClass(node, className); + } +}; + +exports.hasCssString = function(id, doc) { + var index = 0, sheets; + doc = doc || document; + + if (doc.createStyleSheet && (sheets = doc.styleSheets)) { + while (index < sheets.length) + if (sheets[index++].owningElement.id === id) return true; + } else if ((sheets = doc.getElementsByTagName("style"))) { + while (index < sheets.length) + if (sheets[index++].id === id) return true; + } + + return false; +}; + +exports.importCssString = function importCssString(cssText, id, doc) { + doc = doc || document; + if (id && exports.hasCssString(id, doc)) + return null; + + var style; + + if (doc.createStyleSheet) { + style = doc.createStyleSheet(); + style.cssText = cssText; + if (id) + style.owningElement.id = id; + } else { + style = doc.createElementNS + ? doc.createElementNS(XHTML_NS, "style") + : doc.createElement("style"); + + style.appendChild(doc.createTextNode(cssText)); + if (id) + style.id = id; + + exports.getDocumentHead(doc).appendChild(style); + } +}; + +exports.importCssStylsheet = function(uri, doc) { + if (doc.createStyleSheet) { + doc.createStyleSheet(uri); + } else { + var link = exports.createElement('link'); + link.rel = 'stylesheet'; + link.href = uri; + + exports.getDocumentHead(doc).appendChild(link); + } +}; + +exports.getInnerWidth = function(element) { + return ( + parseInt(exports.computedStyle(element, "paddingLeft"), 10) + + parseInt(exports.computedStyle(element, "paddingRight"), 10) + + element.clientWidth + ); +}; + +exports.getInnerHeight = function(element) { + return ( + parseInt(exports.computedStyle(element, "paddingTop"), 10) + + parseInt(exports.computedStyle(element, "paddingBottom"), 10) + + element.clientHeight + ); +}; + +if (window.pageYOffset !== undefined) { + exports.getPageScrollTop = function() { + return window.pageYOffset; + }; + + exports.getPageScrollLeft = function() { + return window.pageXOffset; + }; +} +else { + exports.getPageScrollTop = function() { + return document.body.scrollTop; + }; + + exports.getPageScrollLeft = function() { + return document.body.scrollLeft; + }; +} + +if (window.getComputedStyle) + exports.computedStyle = function(element, style) { + if (style) + return (window.getComputedStyle(element, "") || {})[style] || ""; + return window.getComputedStyle(element, "") || {}; + }; +else + exports.computedStyle = function(element, style) { + if (style) + return element.currentStyle[style]; + return element.currentStyle; + }; + +exports.scrollbarWidth = function(document) { + var inner = exports.createElement("ace_inner"); + inner.style.width = "100%"; + inner.style.minWidth = "0px"; + inner.style.height = "200px"; + inner.style.display = "block"; + + var outer = exports.createElement("ace_outer"); + var style = outer.style; + + style.position = "absolute"; + style.left = "-10000px"; + style.overflow = "hidden"; + style.width = "200px"; + style.minWidth = "0px"; + style.height = "150px"; + style.display = "block"; + + outer.appendChild(inner); + + var body = document.documentElement; + body.appendChild(outer); + + var noScrollbar = inner.offsetWidth; + + style.overflow = "scroll"; + var withScrollbar = inner.offsetWidth; + + if (noScrollbar == withScrollbar) { + withScrollbar = outer.clientWidth; + } + + body.removeChild(outer); + + return noScrollbar-withScrollbar; +}; +exports.setInnerHtml = function(el, innerHtml) { + var element = el.cloneNode(false);//document.createElement("div"); + element.innerHTML = innerHtml; + el.parentNode.replaceChild(element, el); + return element; +}; + +if ("textContent" in document.documentElement) { + exports.setInnerText = function(el, innerText) { + el.textContent = innerText; + }; + + exports.getInnerText = function(el) { + return el.textContent; + }; +} +else { + exports.setInnerText = function(el, innerText) { + el.innerText = innerText; + }; + + exports.getInnerText = function(el) { + return el.innerText; + }; +} + +exports.getParentWindow = function(document) { + return document.defaultView || document.parentWindow; +}; + +}); + +ace.define('ace/lib/event', ['require', 'exports', 'module' , 'ace/lib/keys', 'ace/lib/useragent', 'ace/lib/dom'], function(require, exports, module) { + + +var keys = require("./keys"); +var useragent = require("./useragent"); +var dom = require("./dom"); + +exports.addListener = function(elem, type, callback) { + if (elem.addEventListener) { + return elem.addEventListener(type, callback, false); + } + if (elem.attachEvent) { + var wrapper = function() { + callback.call(elem, window.event); + }; + callback._wrapper = wrapper; + elem.attachEvent("on" + type, wrapper); + } +}; + +exports.removeListener = function(elem, type, callback) { + if (elem.removeEventListener) { + return elem.removeEventListener(type, callback, false); + } + if (elem.detachEvent) { + elem.detachEvent("on" + type, callback._wrapper || callback); + } +}; +exports.stopEvent = function(e) { + exports.stopPropagation(e); + exports.preventDefault(e); + return false; +}; + +exports.stopPropagation = function(e) { + if (e.stopPropagation) + e.stopPropagation(); + else + e.cancelBubble = true; +}; + +exports.preventDefault = function(e) { + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; +}; +exports.getButton = function(e) { + if (e.type == "dblclick") + return 0; + if (e.type == "contextmenu" || (e.ctrlKey && useragent.isMac)) + return 2; + if (e.preventDefault) { + return e.button; + } + else { + return {1:0, 2:2, 4:1}[e.button]; + } +}; + +exports.capture = function(el, eventHandler, releaseCaptureHandler) { + function onMouseUp(e) { + eventHandler && eventHandler(e); + releaseCaptureHandler && releaseCaptureHandler(e); + + exports.removeListener(document, "mousemove", eventHandler, true); + exports.removeListener(document, "mouseup", onMouseUp, true); + exports.removeListener(document, "dragstart", onMouseUp, true); + } + + exports.addListener(document, "mousemove", eventHandler, true); + exports.addListener(document, "mouseup", onMouseUp, true); + exports.addListener(document, "dragstart", onMouseUp, true); + + return onMouseUp; +}; + +exports.addMouseWheelListener = function(el, callback) { + if ("onmousewheel" in el) { + exports.addListener(el, "mousewheel", function(e) { + var factor = 8; + if (e.wheelDeltaX !== undefined) { + e.wheelX = -e.wheelDeltaX / factor; + e.wheelY = -e.wheelDeltaY / factor; + } else { + e.wheelX = 0; + e.wheelY = -e.wheelDelta / factor; + } + callback(e); + }); + } else if ("onwheel" in el) { + exports.addListener(el, "wheel", function(e) { + var factor = 0.35; + switch (e.deltaMode) { + case e.DOM_DELTA_PIXEL: + e.wheelX = e.deltaX * factor || 0; + e.wheelY = e.deltaY * factor || 0; + break; + case e.DOM_DELTA_LINE: + case e.DOM_DELTA_PAGE: + e.wheelX = (e.deltaX || 0) * 5; + e.wheelY = (e.deltaY || 0) * 5; + break; + } + + callback(e); + }); + } else { + exports.addListener(el, "DOMMouseScroll", function(e) { + if (e.axis && e.axis == e.HORIZONTAL_AXIS) { + e.wheelX = (e.detail || 0) * 5; + e.wheelY = 0; + } else { + e.wheelX = 0; + e.wheelY = (e.detail || 0) * 5; + } + callback(e); + }); + } +}; + +exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) { + var clicks = 0; + var startX, startY, timer; + var eventNames = { + 2: "dblclick", + 3: "tripleclick", + 4: "quadclick" + }; + + exports.addListener(el, "mousedown", function(e) { + if (exports.getButton(e) != 0) { + clicks = 0; + } else if (e.detail > 1) { + clicks++; + if (clicks > 4) + clicks = 1; + } else { + clicks = 1; + } + if (useragent.isIE) { + var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; + if (isNewClick) { + clicks = 1; + } + if (clicks == 1) { + startX = e.clientX; + startY = e.clientY; + } + } + + eventHandler[callbackName]("mousedown", e); + + if (clicks > 4) + clicks = 0; + else if (clicks > 1) + return eventHandler[callbackName](eventNames[clicks], e); + }); + + if (useragent.isOldIE) { + exports.addListener(el, "dblclick", function(e) { + clicks = 2; + if (timer) + clearTimeout(timer); + timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); + eventHandler[callbackName]("mousedown", e); + eventHandler[callbackName](eventNames[clicks], e); + }); + } +}; + +function normalizeCommandKeys(callback, e, keyCode) { + var hashId = 0; + if ((useragent.isOpera && !("KeyboardEvent" in window)) && useragent.isMac) { + hashId = 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) + | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); + } else { + hashId = 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) + | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); + } + + if (!useragent.isMac && pressedKeys) { + if (pressedKeys[91] || pressedKeys[92]) + hashId |= 8; + if (pressedKeys.altGr) { + if ((3 & hashId) != 3) + pressedKeys.altGr = 0 + else + return; + } + if (keyCode === 18 || keyCode === 17) { + var location = e.location || e.keyLocation; + if (keyCode === 17 && location === 1) { + ts = e.timeStamp; + } else if (keyCode === 18 && hashId === 3 && location === 2) { + var dt = -ts; + ts = e.timeStamp; + dt += ts; + if (dt < 3) + pressedKeys.altGr = true; + } + } + } + + if (keyCode in keys.MODIFIER_KEYS) { + switch (keys.MODIFIER_KEYS[keyCode]) { + case "Alt": + hashId = 2; + break; + case "Shift": + hashId = 4; + break; + case "Ctrl": + hashId = 1; + break; + default: + hashId = 8; + break; + } + keyCode = 0; + } + + if (hashId & 8 && (keyCode === 91 || keyCode === 93)) { + keyCode = 0; + } + + if (!hashId && keyCode === 13) { + if (e.location || e.keyLocation === 3) { + callback(e, hashId, -keyCode) + if (e.defaultPrevented) + return; + } + } + if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { + return false; + } + + + + return callback(e, hashId, keyCode); +} + +var pressedKeys = null; +var ts = 0; +exports.addCommandKeyListener = function(el, callback) { + var addListener = exports.addListener; + if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { + var lastKeyDownKeyCode = null; + addListener(el, "keydown", function(e) { + lastKeyDownKeyCode = e.keyCode; + }); + addListener(el, "keypress", function(e) { + return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); + }); + } else { + var lastDefaultPrevented = null; + + addListener(el, "keydown", function(e) { + pressedKeys[e.keyCode] = true; + var result = normalizeCommandKeys(callback, e, e.keyCode); + lastDefaultPrevented = e.defaultPrevented; + return result; + }); + + addListener(el, "keypress", function(e) { + if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { + exports.stopEvent(e); + lastDefaultPrevented = null; + } + }); + + addListener(el, "keyup", function(e) { + pressedKeys[e.keyCode] = null; + }); + + if (!pressedKeys) { + pressedKeys = Object.create(null); + addListener(window, "focus", function(e) { + pressedKeys = Object.create(null); + }); + } + } +}; + +if (window.postMessage && !useragent.isOldIE) { + var postMessageId = 1; + exports.nextTick = function(callback, win) { + win = win || window; + var messageName = "zero-timeout-message-" + postMessageId; + exports.addListener(win, "message", function listener(e) { + if (e.data == messageName) { + exports.stopPropagation(e); + exports.removeListener(win, "message", listener); + callback(); + } + }); + win.postMessage(messageName, "*"); + }; +} + + +exports.nextFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame || + window.oRequestAnimationFrame; + +if (exports.nextFrame) + exports.nextFrame = exports.nextFrame.bind(window); +else + exports.nextFrame = function(callback) { + setTimeout(callback, 17); + }; +}); + +ace.define('ace/lib/keys', ['require', 'exports', 'module' , 'ace/lib/oop'], function(require, exports, module) { + + +var oop = require("./oop"); +var Keys = (function() { + var ret = { + MODIFIER_KEYS: { + 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta' + }, + + KEY_MODS: { + "ctrl": 1, "alt": 2, "option" : 2, + "shift": 4, "meta": 8, "command": 8, "cmd": 8 + }, + + FUNCTION_KEYS : { + 8 : "Backspace", + 9 : "Tab", + 13 : "Return", + 19 : "Pause", + 27 : "Esc", + 32 : "Space", + 33 : "PageUp", + 34 : "PageDown", + 35 : "End", + 36 : "Home", + 37 : "Left", + 38 : "Up", + 39 : "Right", + 40 : "Down", + 44 : "Print", + 45 : "Insert", + 46 : "Delete", + 96 : "Numpad0", + 97 : "Numpad1", + 98 : "Numpad2", + 99 : "Numpad3", + 100: "Numpad4", + 101: "Numpad5", + 102: "Numpad6", + 103: "Numpad7", + 104: "Numpad8", + 105: "Numpad9", + '-13': "NumpadEnter", + 112: "F1", + 113: "F2", + 114: "F3", + 115: "F4", + 116: "F5", + 117: "F6", + 118: "F7", + 119: "F8", + 120: "F9", + 121: "F10", + 122: "F11", + 123: "F12", + 144: "Numlock", + 145: "Scrolllock" + }, + + PRINTABLE_KEYS: { + 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', + 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a', + 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', + 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', + 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', + 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.', + 188: ',', 190: '.', 191: '/', 192: '`', 219: '[', 220: '\\', + 221: ']', 222: '\'' + } + }; + for (var i in ret.FUNCTION_KEYS) { + var name = ret.FUNCTION_KEYS[i].toLowerCase(); + ret[name] = parseInt(i, 10); + } + oop.mixin(ret, ret.MODIFIER_KEYS); + oop.mixin(ret, ret.PRINTABLE_KEYS); + oop.mixin(ret, ret.FUNCTION_KEYS); + ret.enter = ret["return"]; + ret.escape = ret.esc; + ret.del = ret["delete"]; + ret[173] = '-'; + + return ret; +})(); +oop.mixin(exports, Keys); + +exports.keyCodeToString = function(keyCode) { + return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); +} + +}); + +ace.define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) { + + +exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); +}; + +exports.mixin = function(obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; +}; + +exports.implement = function(proto, mixin) { + exports.mixin(proto, mixin); +}; + +}); + +ace.define('ace/lib/useragent', ['require', 'exports', 'module' ], function(require, exports, module) { +exports.OS = { + LINUX: "LINUX", + MAC: "MAC", + WINDOWS: "WINDOWS" +}; +exports.getOS = function() { + if (exports.isMac) { + return exports.OS.MAC; + } else if (exports.isLinux) { + return exports.OS.LINUX; + } else { + return exports.OS.WINDOWS; + } +}; +if (typeof navigator != "object") + return; + +var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); +var ua = navigator.userAgent; +exports.isWin = (os == "win"); +exports.isMac = (os == "mac"); +exports.isLinux = (os == "linux"); +exports.isIE = + (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) + && parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]); + +exports.isOldIE = exports.isIE && exports.isIE < 9; +exports.isGecko = exports.isMozilla = window.controllers && window.navigator.product === "Gecko"; +exports.isOldGecko = exports.isGecko && parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1], 10) < 4; +exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; +exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; + +exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; + +exports.isAIR = ua.indexOf("AdobeAIR") >= 0; + +exports.isIPad = ua.indexOf("iPad") >= 0; + +exports.isTouchPad = ua.indexOf("TouchPad") >= 0; + +}); + +ace.define('ace/editor', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/useragent', 'ace/keyboard/textinput', 'ace/mouse/mouse_handler', 'ace/mouse/fold_handler', 'ace/keyboard/keybinding', 'ace/edit_session', 'ace/search', 'ace/range', 'ace/lib/event_emitter', 'ace/commands/command_manager', 'ace/commands/default_commands', 'ace/config'], function(require, exports, module) { + + +require("./lib/fixoldbrowsers"); + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var lang = require("./lib/lang"); +var useragent = require("./lib/useragent"); +var TextInput = require("./keyboard/textinput").TextInput; +var MouseHandler = require("./mouse/mouse_handler").MouseHandler; +var FoldHandler = require("./mouse/fold_handler").FoldHandler; +var KeyBinding = require("./keyboard/keybinding").KeyBinding; +var EditSession = require("./edit_session").EditSession; +var Search = require("./search").Search; +var Range = require("./range").Range; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var CommandManager = require("./commands/command_manager").CommandManager; +var defaultCommands = require("./commands/default_commands").commands; +var config = require("./config"); +var Editor = function(renderer, session) { + var container = renderer.getContainerElement(); + this.container = container; + this.renderer = renderer; + + this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); + this.textInput = new TextInput(renderer.getTextAreaContainer(), this); + this.renderer.textarea = this.textInput.getElement(); + this.keyBinding = new KeyBinding(this); + this.$mouseHandler = new MouseHandler(this); + new FoldHandler(this); + + this.$blockScrolling = 0; + this.$search = new Search().set({ + wrap: true + }); + + this.$historyTracker = this.$historyTracker.bind(this); + this.commands.on("exec", this.$historyTracker); + + this.$initOperationListeners(); + + this._$emitInputEvent = lang.delayedCall(function() { + this._signal("input", {}); + this.session.bgTokenizer && this.session.bgTokenizer.scheduleStart(); + }.bind(this)); + + this.on("change", function(_, _self) { + _self._$emitInputEvent.schedule(31); + }); + + this.setSession(session || new EditSession("")); + config.resetOptions(this); + config._emit("editor", this); +}; + +(function(){ + + oop.implement(this, EventEmitter); + + this.$initOperationListeners = function() { + function last(a) {return a[a.length - 1]} + + this.selections = []; + this.commands.on("exec", function(e) { + this.startOperation(e); + + var command = e.command; + if (command.aceCommandGroup == "fileJump") { + var prev = this.prevOp; + if (!prev || prev.command.aceCommandGroup != "fileJump") { + this.lastFileJumpPos = last(this.selections); + } + } else { + this.lastFileJumpPos = null; + } + }.bind(this), true); + + this.commands.on("afterExec", function(e) { + var command = e.command; + + if (command.aceCommandGroup == "fileJump") { + if (this.lastFileJumpPos && !this.curOp.selectionChanged) { + this.selection.fromJSON(this.lastFileJumpPos); + } + } + this.endOperation(e); + }.bind(this), true); + + this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this)); + + this.on("change", function() { + this.curOp || this.startOperation(); + this.curOp.docChanged = true; + }.bind(this), true); + + this.on("changeSelection", function() { + this.curOp || this.startOperation(); + this.curOp.selectionChanged = true; + }.bind(this), true); + }; + + this.curOp = null; + this.prevOp = {}; + this.startOperation = function(commadEvent) { + if (this.curOp) { + if (!commadEvent || this.curOp.command) + return; + this.prevOp = this.curOp; + } + if (!commadEvent) { + this.previousCommand = null; + commadEvent = {}; + } + + this.$opResetTimer.schedule(); + this.curOp = { + command: commadEvent.command || {}, + args: commadEvent.args, + scrollTop: this.renderer.scrollTop + }; + + var command = this.curOp.command; + if (command && command.scrollIntoView) + this.$blockScrolling++; + + this.selections.push(this.selection.toJSON()); + }; + + this.endOperation = function() { + if (this.curOp) { + var command = this.curOp.command; + if (command && command.scrollIntoView) { + this.$blockScrolling--; + switch (command.scrollIntoView) { + case "center": + this.renderer.scrollCursorIntoView(null, 0.5); + break; + case "animate": + case "cursor": + this.renderer.scrollCursorIntoView(); + break; + case "selectionPart": + var range = this.selection.getRange(); + var config = this.renderer.layerConfig; + if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) { + this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead); + } + break; + default: + break; + } + if (command.scrollIntoView == "animate") + this.renderer.animateScrolling(this.curOp.scrollTop); + } + + this.prevOp = this.curOp; + this.curOp = null; + } + }; + + this.$historyTracker = function(e) { + if (!this.$mergeUndoDeltas) + return; + + + var prev = this.prevOp; + var mergeableCommands = ["backspace", "del", "insertstring"]; + var shouldMerge = prev.command && (e.command.name == prev.command.name); + if (e.command.name == "insertstring") { + var text = e.args; + if (this.mergeNextCommand === undefined) + this.mergeNextCommand = true; + + shouldMerge = shouldMerge + && this.mergeNextCommand // previous command allows to coalesce with + && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type + + this.mergeNextCommand = true; + } else { + shouldMerge = shouldMerge + && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable + } + + if ( + this.$mergeUndoDeltas != "always" + && Date.now() - this.sequenceStartTime > 2000 + ) { + shouldMerge = false; // the sequence is too long + } + + if (shouldMerge) + this.session.mergeUndoDeltas = true; + else if (mergeableCommands.indexOf(e.command.name) !== -1) + this.sequenceStartTime = Date.now(); + }; + this.setKeyboardHandler = function(keyboardHandler) { + if (!keyboardHandler) { + this.keyBinding.setKeyboardHandler(null); + } else if (typeof keyboardHandler === "string") { + this.$keybindingId = keyboardHandler; + var _self = this; + config.loadModule(["keybinding", keyboardHandler], function(module) { + if (_self.$keybindingId == keyboardHandler) + _self.keyBinding.setKeyboardHandler(module && module.handler); + }); + } else { + this.$keybindingId = null; + this.keyBinding.setKeyboardHandler(keyboardHandler); + } + }; + this.getKeyboardHandler = function() { + return this.keyBinding.getKeyboardHandler(); + }; + this.setSession = function(session) { + if (this.session == session) + return; + + if (this.session) { + var oldSession = this.session; + this.session.removeEventListener("change", this.$onDocumentChange); + this.session.removeEventListener("changeMode", this.$onChangeMode); + this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate); + this.session.removeEventListener("changeTabSize", this.$onChangeTabSize); + this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit); + this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode); + this.session.removeEventListener("onChangeFold", this.$onChangeFold); + this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker); + this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker); + this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint); + this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation); + this.session.removeEventListener("changeOverwrite", this.$onCursorChange); + this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange); + this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange); + + var selection = this.session.getSelection(); + selection.removeEventListener("changeCursor", this.$onCursorChange); + selection.removeEventListener("changeSelection", this.$onSelectionChange); + } + + this.session = session; + + this.$onDocumentChange = this.onDocumentChange.bind(this); + session.addEventListener("change", this.$onDocumentChange); + this.renderer.setSession(session); + + this.$onChangeMode = this.onChangeMode.bind(this); + session.addEventListener("changeMode", this.$onChangeMode); + + this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); + session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate); + + this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer); + session.addEventListener("changeTabSize", this.$onChangeTabSize); + + this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); + session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit); + + this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); + session.addEventListener("changeWrapMode", this.$onChangeWrapMode); + + this.$onChangeFold = this.onChangeFold.bind(this); + session.addEventListener("changeFold", this.$onChangeFold); + + this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); + this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker); + + this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); + this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker); + + this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); + this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint); + + this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); + this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation); + + this.$onCursorChange = this.onCursorChange.bind(this); + this.session.addEventListener("changeOverwrite", this.$onCursorChange); + + this.$onScrollTopChange = this.onScrollTopChange.bind(this); + this.session.addEventListener("changeScrollTop", this.$onScrollTopChange); + + this.$onScrollLeftChange = this.onScrollLeftChange.bind(this); + this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange); + + this.selection = session.getSelection(); + this.selection.addEventListener("changeCursor", this.$onCursorChange); + + this.$onSelectionChange = this.onSelectionChange.bind(this); + this.selection.addEventListener("changeSelection", this.$onSelectionChange); + + this.onChangeMode(); + + this.$blockScrolling += 1; + this.onCursorChange(); + this.$blockScrolling -= 1; + + this.onScrollTopChange(); + this.onScrollLeftChange(); + this.onSelectionChange(); + this.onChangeFrontMarker(); + this.onChangeBackMarker(); + this.onChangeBreakpoint(); + this.onChangeAnnotation(); + this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); + this.renderer.updateFull(); + + this._emit("changeSession", { + session: session, + oldSession: oldSession + }); + }; + this.getSession = function() { + return this.session; + }; + this.setValue = function(val, cursorPos) { + this.session.doc.setValue(val); + + if (!cursorPos) + this.selectAll(); + else if (cursorPos == 1) + this.navigateFileEnd(); + else if (cursorPos == -1) + this.navigateFileStart(); + + return val; + }; + this.getValue = function() { + return this.session.getValue(); + }; + this.getSelection = function() { + return this.selection; + }; + this.resize = function(force) { + this.renderer.onResize(force); + }; + this.setTheme = function(theme) { + this.renderer.setTheme(theme); + }; + this.getTheme = function() { + return this.renderer.getTheme(); + }; + this.setStyle = function(style) { + this.renderer.setStyle(style); + }; + this.unsetStyle = function(style) { + this.renderer.unsetStyle(style); + }; + this.getFontSize = function () { + return this.getOption("fontSize") || + dom.computedStyle(this.container, "fontSize"); + }; + this.setFontSize = function(size) { + this.setOption("fontSize", size); + }; + + this.$highlightBrackets = function() { + if (this.session.$bracketHighlight) { + this.session.removeMarker(this.session.$bracketHighlight); + this.session.$bracketHighlight = null; + } + + if (this.$highlightPending) { + return; + } + var self = this; + this.$highlightPending = true; + setTimeout(function() { + self.$highlightPending = false; + + var pos = self.session.findMatchingBracket(self.getCursorPosition()); + if (pos) { + var range = new Range(pos.row, pos.column, pos.row, pos.column+1); + } else if (self.session.$mode.getMatching) { + var range = self.session.$mode.getMatching(self.session); + } + if (range) + self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket", "text"); + }, 50); + }; + this.focus = function() { + var _self = this; + setTimeout(function() { + _self.textInput.focus(); + }); + this.textInput.focus(); + }; + this.isFocused = function() { + return this.textInput.isFocused(); + }; + this.blur = function() { + this.textInput.blur(); + }; + this.onFocus = function() { + if (this.$isFocused) + return; + this.$isFocused = true; + this.renderer.showCursor(); + this.renderer.visualizeFocus(); + this._emit("focus"); + }; + this.onBlur = function() { + if (!this.$isFocused) + return; + this.$isFocused = false; + this.renderer.hideCursor(); + this.renderer.visualizeBlur(); + this._emit("blur"); + }; + + this.$cursorChange = function() { + this.renderer.updateCursor(); + }; + this.onDocumentChange = function(e) { + var delta = e.data; + var range = delta.range; + var lastRow; + + if (range.start.row == range.end.row && delta.action != "insertLines" && delta.action != "removeLines") + lastRow = range.end.row; + else + lastRow = Infinity; + this.renderer.updateLines(range.start.row, lastRow); + + this._emit("change", e); + this.$cursorChange(); + }; + + this.onTokenizerUpdate = function(e) { + var rows = e.data; + this.renderer.updateLines(rows.first, rows.last); + }; + + + this.onScrollTopChange = function() { + this.renderer.scrollToY(this.session.getScrollTop()); + }; + + this.onScrollLeftChange = function() { + this.renderer.scrollToX(this.session.getScrollLeft()); + }; + this.onCursorChange = function() { + this.$cursorChange(); + + if (!this.$blockScrolling) { + this.renderer.scrollCursorIntoView(); + } + + this.$highlightBrackets(); + this.$updateHighlightActiveLine(); + this._emit("changeSelection"); + }; + + this.$updateHighlightActiveLine = function() { + var session = this.getSession(); + + var highlight; + if (this.$highlightActiveLine) { + if ((this.$selectionStyle != "line" || !this.selection.isMultiLine())) + highlight = this.getCursorPosition(); + if (this.renderer.$maxLines && this.session.getLength() === 1) + highlight = false; + } + + if (session.$highlightLineMarker && !highlight) { + session.removeMarker(session.$highlightLineMarker.id); + session.$highlightLineMarker = null; + } else if (!session.$highlightLineMarker && highlight) { + var range = new Range(highlight.row, highlight.column, highlight.row, Infinity); + range.id = session.addMarker(range, "ace_active-line", "screenLine"); + session.$highlightLineMarker = range; + } else if (highlight) { + session.$highlightLineMarker.start.row = highlight.row; + session.$highlightLineMarker.end.row = highlight.row; + session.$highlightLineMarker.start.column = highlight.column; + session._emit("changeBackMarker"); + } + }; + + this.onSelectionChange = function(e) { + var session = this.session; + + if (session.$selectionMarker) { + session.removeMarker(session.$selectionMarker); + } + session.$selectionMarker = null; + + if (!this.selection.isEmpty()) { + var range = this.selection.getRange(); + var style = this.getSelectionStyle(); + session.$selectionMarker = session.addMarker(range, "ace_selection", style); + } else { + this.$updateHighlightActiveLine(); + } + + var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp(); + this.session.highlight(re); + + this._emit("changeSelection"); + }; + + this.$getSelectionHighLightRegexp = function() { + var session = this.session; + + var selection = this.getSelectionRange(); + if (selection.isEmpty() || selection.isMultiLine()) + return; + + var startOuter = selection.start.column - 1; + var endOuter = selection.end.column + 1; + var line = session.getLine(selection.start.row); + var lineCols = line.length; + var needle = line.substring(Math.max(startOuter, 0), + Math.min(endOuter, lineCols)); + if ((startOuter >= 0 && /^[\w\d]/.test(needle)) || + (endOuter <= lineCols && /[\w\d]$/.test(needle))) + return; + + needle = line.substring(selection.start.column, selection.end.column); + if (!/^[\w\d]+$/.test(needle)) + return; + + var re = this.$search.$assembleRegExp({ + wholeWord: true, + caseSensitive: true, + needle: needle + }); + + return re; + }; + + + this.onChangeFrontMarker = function() { + this.renderer.updateFrontMarkers(); + }; + + this.onChangeBackMarker = function() { + this.renderer.updateBackMarkers(); + }; + + + this.onChangeBreakpoint = function() { + this.renderer.updateBreakpoints(); + }; + + this.onChangeAnnotation = function() { + this.renderer.setAnnotations(this.session.getAnnotations()); + }; + + + this.onChangeMode = function(e) { + this.renderer.updateText(); + this._emit("changeMode", e); + }; + + + this.onChangeWrapLimit = function() { + this.renderer.updateFull(); + }; + + this.onChangeWrapMode = function() { + this.renderer.onResize(true); + }; + + + this.onChangeFold = function() { + this.$updateHighlightActiveLine(); + this.renderer.updateFull(); + }; + this.getSelectedText = function() { + return this.session.getTextRange(this.getSelectionRange()); + }; + this.getCopyText = function() { + var text = this.getSelectedText(); + this._signal("copy", text); + return text; + }; + this.onCopy = function() { + this.commands.exec("copy", this); + }; + this.onCut = function() { + this.commands.exec("cut", this); + }; + this.onPaste = function(text) { + if (this.$readOnly) + return; + this._emit("paste", text); + this.insert(text); + }; + + + this.execCommand = function(command, args) { + this.commands.exec(command, this, args); + }; + this.insert = function(text) { + var session = this.session; + var mode = session.getMode(); + var cursor = this.getCursorPosition(); + + if (this.getBehavioursEnabled()) { + var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); + if (transform) { + if (text !== transform.text) { + this.session.mergeUndoDeltas = false; + this.$mergeNextCommand = false; + } + text = transform.text; + + } + } + + if (text == "\t") + text = this.session.getTabString(); + if (!this.selection.isEmpty()) { + var range = this.getSelectionRange(); + cursor = this.session.remove(range); + this.clearSelection(); + } + else if (this.session.getOverwrite()) { + var range = new Range.fromPoints(cursor, cursor); + range.end.column += text.length; + this.session.remove(range); + } + + if (text == "\n" || text == "\r\n") { + var line = session.getLine(cursor.row); + if (cursor.column > line.search(/\S|$/)) { + var d = line.substr(cursor.column).search(/\S|$/); + session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d); + } + } + this.clearSelection(); + + var start = cursor.column; + var lineState = session.getState(cursor.row); + var line = session.getLine(cursor.row); + var shouldOutdent = mode.checkOutdent(lineState, line, text); + var end = session.insert(cursor, text); + + if (transform && transform.selection) { + if (transform.selection.length == 2) { // Transform relative to the current column + this.selection.setSelectionRange( + new Range(cursor.row, start + transform.selection[0], + cursor.row, start + transform.selection[1])); + } else { // Transform relative to the current row. + this.selection.setSelectionRange( + new Range(cursor.row + transform.selection[0], + transform.selection[1], + cursor.row + transform.selection[2], + transform.selection[3])); + } + } + + if (session.getDocument().isNewLine(text)) { + var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); + + session.insert({row: cursor.row+1, column: 0}, lineIndent); + } + if (shouldOutdent) + mode.autoOutdent(lineState, session, cursor.row); + }; + + this.onTextInput = function(text) { + this.keyBinding.onTextInput(text); + }; + + this.onCommandKey = function(e, hashId, keyCode) { + this.keyBinding.onCommandKey(e, hashId, keyCode); + }; + this.setOverwrite = function(overwrite) { + this.session.setOverwrite(overwrite); + }; + this.getOverwrite = function() { + return this.session.getOverwrite(); + }; + this.toggleOverwrite = function() { + this.session.toggleOverwrite(); + }; + this.setScrollSpeed = function(speed) { + this.setOption("scrollSpeed", speed); + }; + this.getScrollSpeed = function() { + return this.getOption("scrollSpeed"); + }; + this.setDragDelay = function(dragDelay) { + this.setOption("dragDelay", dragDelay); + }; + this.getDragDelay = function() { + return this.getOption("dragDelay"); + }; + this.setSelectionStyle = function(val) { + this.setOption("selectionStyle", val); + }; + this.getSelectionStyle = function() { + return this.getOption("selectionStyle"); + }; + this.setHighlightActiveLine = function(shouldHighlight) { + this.setOption("highlightActiveLine", shouldHighlight); + }; + this.getHighlightActiveLine = function() { + return this.getOption("highlightActiveLine"); + }; + this.setHighlightGutterLine = function(shouldHighlight) { + this.setOption("highlightGutterLine", shouldHighlight); + }; + + this.getHighlightGutterLine = function() { + return this.getOption("highlightGutterLine"); + }; + this.setHighlightSelectedWord = function(shouldHighlight) { + this.setOption("highlightSelectedWord", shouldHighlight); + }; + this.getHighlightSelectedWord = function() { + return this.$highlightSelectedWord; + }; + + this.setAnimatedScroll = function(shouldAnimate){ + this.renderer.setAnimatedScroll(shouldAnimate); + }; + + this.getAnimatedScroll = function(){ + return this.renderer.getAnimatedScroll(); + }; + this.setShowInvisibles = function(showInvisibles) { + this.renderer.setShowInvisibles(showInvisibles); + }; + this.getShowInvisibles = function() { + return this.renderer.getShowInvisibles(); + }; + + this.setDisplayIndentGuides = function(display) { + this.renderer.setDisplayIndentGuides(display); + }; + + this.getDisplayIndentGuides = function() { + return this.renderer.getDisplayIndentGuides(); + }; + this.setShowPrintMargin = function(showPrintMargin) { + this.renderer.setShowPrintMargin(showPrintMargin); + }; + this.getShowPrintMargin = function() { + return this.renderer.getShowPrintMargin(); + }; + this.setPrintMarginColumn = function(showPrintMargin) { + this.renderer.setPrintMarginColumn(showPrintMargin); + }; + this.getPrintMarginColumn = function() { + return this.renderer.getPrintMarginColumn(); + }; + this.setReadOnly = function(readOnly) { + this.setOption("readOnly", readOnly); + }; + this.getReadOnly = function() { + return this.getOption("readOnly"); + }; + this.setBehavioursEnabled = function (enabled) { + this.setOption("behavioursEnabled", enabled); + }; + this.getBehavioursEnabled = function () { + return this.getOption("behavioursEnabled"); + }; + this.setWrapBehavioursEnabled = function (enabled) { + this.setOption("wrapBehavioursEnabled", enabled); + }; + this.getWrapBehavioursEnabled = function () { + return this.getOption("wrapBehavioursEnabled"); + }; + this.setShowFoldWidgets = function(show) { + this.setOption("showFoldWidgets", show); + + }; + this.getShowFoldWidgets = function() { + return this.getOption("showFoldWidgets"); + }; + + this.setFadeFoldWidgets = function(fade) { + this.setOption("fadeFoldWidgets", fade); + }; + + this.getFadeFoldWidgets = function() { + return this.getOption("fadeFoldWidgets"); + }; + this.remove = function(dir) { + if (this.selection.isEmpty()){ + if (dir == "left") + this.selection.selectLeft(); + else + this.selection.selectRight(); + } + + var range = this.getSelectionRange(); + if (this.getBehavioursEnabled()) { + var session = this.session; + var state = session.getState(range.start.row); + var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); + + if (range.end.column === 0) { + var text = session.getTextRange(range); + if (text[text.length - 1] == "\n") { + var line = session.getLine(range.end.row); + if (/^\s+$/.test(line)) { + range.end.column = line.length; + } + } + } + if (new_range) + range = new_range; + } + + this.session.remove(range); + this.clearSelection(); + }; + this.removeWordRight = function() { + if (this.selection.isEmpty()) + this.selection.selectWordRight(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeWordLeft = function() { + if (this.selection.isEmpty()) + this.selection.selectWordLeft(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeToLineStart = function() { + if (this.selection.isEmpty()) + this.selection.selectLineStart(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeToLineEnd = function() { + if (this.selection.isEmpty()) + this.selection.selectLineEnd(); + + var range = this.getSelectionRange(); + if (range.start.column == range.end.column && range.start.row == range.end.row) { + range.end.column = 0; + range.end.row++; + } + + this.session.remove(range); + this.clearSelection(); + }; + this.splitLine = function() { + if (!this.selection.isEmpty()) { + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + } + + var cursor = this.getCursorPosition(); + this.insert("\n"); + this.moveCursorToPosition(cursor); + }; + this.transposeLetters = function() { + if (!this.selection.isEmpty()) { + return; + } + + var cursor = this.getCursorPosition(); + var column = cursor.column; + if (column === 0) + return; + + var line = this.session.getLine(cursor.row); + var swap, range; + if (column < line.length) { + swap = line.charAt(column) + line.charAt(column-1); + range = new Range(cursor.row, column-1, cursor.row, column+1); + } + else { + swap = line.charAt(column-1) + line.charAt(column-2); + range = new Range(cursor.row, column-2, cursor.row, column); + } + this.session.replace(range, swap); + }; + this.toLowerCase = function() { + var originalRange = this.getSelectionRange(); + if (this.selection.isEmpty()) { + this.selection.selectWord(); + } + + var range = this.getSelectionRange(); + var text = this.session.getTextRange(range); + this.session.replace(range, text.toLowerCase()); + this.selection.setSelectionRange(originalRange); + }; + this.toUpperCase = function() { + var originalRange = this.getSelectionRange(); + if (this.selection.isEmpty()) { + this.selection.selectWord(); + } + + var range = this.getSelectionRange(); + var text = this.session.getTextRange(range); + this.session.replace(range, text.toUpperCase()); + this.selection.setSelectionRange(originalRange); + }; + this.indent = function() { + var session = this.session; + var range = this.getSelectionRange(); + + if (range.start.row < range.end.row) { + var rows = this.$getSelectedRows(); + session.indentRows(rows.first, rows.last, "\t"); + return; + } else if (range.start.column < range.end.column) { + var text = session.getTextRange(range); + if (!/^\s+$/.test(text)) { + var rows = this.$getSelectedRows(); + session.indentRows(rows.first, rows.last, "\t"); + return; + } + } + + var line = session.getLine(range.start.row); + var position = range.start; + var size = session.getTabSize(); + var column = session.documentToScreenColumn(position.row, position.column); + + if (this.session.getUseSoftTabs()) { + var count = (size - column % size); + var indentString = lang.stringRepeat(" ", count); + } else { + var count = column % size; + while (line[range.start.column] == " " && count) { + range.start.column--; + count--; + } + this.selection.setSelectionRange(range); + indentString = "\t"; + } + return this.insert(indentString); + }; + this.blockIndent = function() { + var rows = this.$getSelectedRows(); + this.session.indentRows(rows.first, rows.last, "\t"); + }; + this.blockOutdent = function() { + var selection = this.session.getSelection(); + this.session.outdentRows(selection.getRange()); + }; + this.sortLines = function() { + var rows = this.$getSelectedRows(); + var session = this.session; + + var lines = []; + for (i = rows.first; i <= rows.last; i++) + lines.push(session.getLine(i)); + + lines.sort(function(a, b) { + if (a.toLowerCase() < b.toLowerCase()) return -1; + if (a.toLowerCase() > b.toLowerCase()) return 1; + return 0; + }); + + var deleteRange = new Range(0, 0, 0, 0); + for (var i = rows.first; i <= rows.last; i++) { + var line = session.getLine(i); + deleteRange.start.row = i; + deleteRange.end.row = i; + deleteRange.end.column = line.length; + session.replace(deleteRange, lines[i-rows.first]); + } + }; + this.toggleCommentLines = function() { + var state = this.session.getState(this.getCursorPosition().row); + var rows = this.$getSelectedRows(); + this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); + }; + + this.toggleBlockComment = function() { + var cursor = this.getCursorPosition(); + var state = this.session.getState(cursor.row); + var range = this.getSelectionRange(); + this.session.getMode().toggleBlockComment(state, this.session, range, cursor); + }; + this.getNumberAt = function(row, column) { + var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; + _numberRx.lastIndex = 0; + + var s = this.session.getLine(row); + while (_numberRx.lastIndex < column) { + var m = _numberRx.exec(s); + if(m.index <= column && m.index+m[0].length >= column){ + var number = { + value: m[0], + start: m.index, + end: m.index+m[0].length + }; + return number; + } + } + return null; + }; + this.modifyNumber = function(amount) { + var row = this.selection.getCursor().row; + var column = this.selection.getCursor().column; + var charRange = new Range(row, column-1, row, column); + + var c = this.session.getTextRange(charRange); + if (!isNaN(parseFloat(c)) && isFinite(c)) { + var nr = this.getNumberAt(row, column); + if (nr) { + var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end; + var decimals = nr.start + nr.value.length - fp; + + var t = parseFloat(nr.value); + t *= Math.pow(10, decimals); + + + if(fp !== nr.end && column < fp){ + amount *= Math.pow(10, nr.end - column - 1); + } else { + amount *= Math.pow(10, nr.end - column); + } + + t += amount; + t /= Math.pow(10, decimals); + var nnr = t.toFixed(decimals); + var replaceRange = new Range(row, nr.start, row, nr.end); + this.session.replace(replaceRange, nnr); + this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length)); + + } + } + }; + this.removeLines = function() { + var rows = this.$getSelectedRows(); + var range; + if (rows.first === 0 || rows.last+1 < this.session.getLength()) + range = new Range(rows.first, 0, rows.last+1, 0); + else + range = new Range( + rows.first-1, this.session.getLine(rows.first-1).length, + rows.last, this.session.getLine(rows.last).length + ); + this.session.remove(range); + this.clearSelection(); + }; + + this.duplicateSelection = function() { + var sel = this.selection; + var doc = this.session; + var range = sel.getRange(); + var reverse = sel.isBackwards(); + if (range.isEmpty()) { + var row = range.start.row; + doc.duplicateLines(row, row); + } else { + var point = reverse ? range.start : range.end; + var endPoint = doc.insert(point, doc.getTextRange(range), false); + range.start = point; + range.end = endPoint; + + sel.setSelectionRange(range, reverse); + } + }; + this.moveLinesDown = function() { + this.$moveLines(function(firstRow, lastRow) { + return this.session.moveLinesDown(firstRow, lastRow); + }); + }; + this.moveLinesUp = function() { + this.$moveLines(function(firstRow, lastRow) { + return this.session.moveLinesUp(firstRow, lastRow); + }); + }; + this.moveText = function(range, toPosition, copy) { + return this.session.moveText(range, toPosition, copy); + }; + this.copyLinesUp = function() { + this.$moveLines(function(firstRow, lastRow) { + this.session.duplicateLines(firstRow, lastRow); + return 0; + }); + }; + this.copyLinesDown = function() { + this.$moveLines(function(firstRow, lastRow) { + return this.session.duplicateLines(firstRow, lastRow); + }); + }; + this.$moveLines = function(mover) { + var selection = this.selection; + if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) { + var range = selection.toOrientedRange(); + var rows = this.$getSelectedRows(range); + var linesMoved = mover.call(this, rows.first, rows.last); + range.moveBy(linesMoved, 0); + selection.fromOrientedRange(range); + } else { + var ranges = selection.rangeList.ranges; + selection.rangeList.detach(this.session); + + for (var i = ranges.length; i--; ) { + var rangeIndex = i; + var rows = ranges[i].collapseRows(); + var last = rows.end.row; + var first = rows.start.row; + while (i--) { + rows = ranges[i].collapseRows(); + if (first - rows.end.row <= 1) + first = rows.end.row; + else + break; + } + i++; + + var linesMoved = mover.call(this, first, last); + while (rangeIndex >= i) { + ranges[rangeIndex].moveBy(linesMoved, 0); + rangeIndex--; + } + } + selection.fromOrientedRange(selection.ranges[0]); + selection.rangeList.attach(this.session); + } + }; + this.$getSelectedRows = function() { + var range = this.getSelectionRange().collapseRows(); + + return { + first: this.session.getRowFoldStart(range.start.row), + last: this.session.getRowFoldEnd(range.end.row) + }; + }; + + this.onCompositionStart = function(text) { + this.renderer.showComposition(this.getCursorPosition()); + }; + + this.onCompositionUpdate = function(text) { + this.renderer.setCompositionText(text); + }; + + this.onCompositionEnd = function() { + this.renderer.hideComposition(); + }; + this.getFirstVisibleRow = function() { + return this.renderer.getFirstVisibleRow(); + }; + this.getLastVisibleRow = function() { + return this.renderer.getLastVisibleRow(); + }; + this.isRowVisible = function(row) { + return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); + }; + this.isRowFullyVisible = function(row) { + return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow()); + }; + this.$getVisibleRowCount = function() { + return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; + }; + + this.$moveByPage = function(dir, select) { + var renderer = this.renderer; + var config = this.renderer.layerConfig; + var rows = dir * Math.floor(config.height / config.lineHeight); + + this.$blockScrolling++; + if (select === true) { + this.selection.$moveSelection(function(){ + this.moveCursorBy(rows, 0); + }); + } else if (select === false) { + this.selection.moveCursorBy(rows, 0); + this.selection.clearSelection(); + } + this.$blockScrolling--; + + var scrollTop = renderer.scrollTop; + + renderer.scrollBy(0, rows * config.lineHeight); + if (select != null) + renderer.scrollCursorIntoView(null, 0.5); + + renderer.animateScrolling(scrollTop); + }; + this.selectPageDown = function() { + this.$moveByPage(1, true); + }; + this.selectPageUp = function() { + this.$moveByPage(-1, true); + }; + this.gotoPageDown = function() { + this.$moveByPage(1, false); + }; + this.gotoPageUp = function() { + this.$moveByPage(-1, false); + }; + this.scrollPageDown = function() { + this.$moveByPage(1); + }; + this.scrollPageUp = function() { + this.$moveByPage(-1); + }; + this.scrollToRow = function(row) { + this.renderer.scrollToRow(row); + }; + this.scrollToLine = function(line, center, animate, callback) { + this.renderer.scrollToLine(line, center, animate, callback); + }; + this.centerSelection = function() { + var range = this.getSelectionRange(); + var pos = { + row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2), + column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2) + }; + this.renderer.alignCursor(pos, 0.5); + }; + this.getCursorPosition = function() { + return this.selection.getCursor(); + }; + this.getCursorPositionScreen = function() { + return this.session.documentToScreenPosition(this.getCursorPosition()); + }; + this.getSelectionRange = function() { + return this.selection.getRange(); + }; + this.selectAll = function() { + this.$blockScrolling += 1; + this.selection.selectAll(); + this.$blockScrolling -= 1; + }; + this.clearSelection = function() { + this.selection.clearSelection(); + }; + this.moveCursorTo = function(row, column) { + this.selection.moveCursorTo(row, column); + }; + this.moveCursorToPosition = function(pos) { + this.selection.moveCursorToPosition(pos); + }; + this.jumpToMatching = function(select) { + var cursor = this.getCursorPosition(); + + var range = this.session.getBracketRange(cursor); + if (!range) { + range = this.find({ + needle: /[{}()\[\]]/g, + preventScroll:true, + start: {row: cursor.row, column: cursor.column - 1} + }); + if (!range) + return; + var pos = range.start; + if (pos.row == cursor.row && Math.abs(pos.column - cursor.column) < 2) + range = this.session.getBracketRange(pos); + } + + pos = range && range.cursor || pos; + if (pos) { + if (select) { + if (range && range.isEqual(this.getSelectionRange())) + this.clearSelection(); + else + this.selection.selectTo(pos.row, pos.column); + } else { + this.clearSelection(); + this.moveCursorTo(pos.row, pos.column); + } + } + }; + this.gotoLine = function(lineNumber, column, animate) { + this.selection.clearSelection(); + this.session.unfold({row: lineNumber - 1, column: column || 0}); + + this.$blockScrolling += 1; + this.exitMultiSelectMode && this.exitMultiSelectMode(); + this.moveCursorTo(lineNumber - 1, column || 0); + this.$blockScrolling -= 1; + + if (!this.isRowFullyVisible(lineNumber - 1)) + this.scrollToLine(lineNumber - 1, true, animate); + }; + this.navigateTo = function(row, column) { + this.clearSelection(); + this.moveCursorTo(row, column); + }; + this.navigateUp = function(times) { + if (this.selection.isMultiLine() && !this.selection.isBackwards()) { + var selectionStart = this.selection.anchor.getPosition(); + return this.moveCursorToPosition(selectionStart); + } + this.selection.clearSelection(); + times = times || 1; + this.selection.moveCursorBy(-times, 0); + }; + this.navigateDown = function(times) { + if (this.selection.isMultiLine() && this.selection.isBackwards()) { + var selectionEnd = this.selection.anchor.getPosition(); + return this.moveCursorToPosition(selectionEnd); + } + this.selection.clearSelection(); + times = times || 1; + this.selection.moveCursorBy(times, 0); + }; + this.navigateLeft = function(times) { + if (!this.selection.isEmpty()) { + var selectionStart = this.getSelectionRange().start; + this.moveCursorToPosition(selectionStart); + } + else { + times = times || 1; + while (times--) { + this.selection.moveCursorLeft(); + } + } + this.clearSelection(); + }; + this.navigateRight = function(times) { + if (!this.selection.isEmpty()) { + var selectionEnd = this.getSelectionRange().end; + this.moveCursorToPosition(selectionEnd); + } + else { + times = times || 1; + while (times--) { + this.selection.moveCursorRight(); + } + } + this.clearSelection(); + }; + this.navigateLineStart = function() { + this.selection.moveCursorLineStart(); + this.clearSelection(); + }; + this.navigateLineEnd = function() { + this.selection.moveCursorLineEnd(); + this.clearSelection(); + }; + this.navigateFileEnd = function() { + this.selection.moveCursorFileEnd(); + this.clearSelection(); + }; + this.navigateFileStart = function() { + this.selection.moveCursorFileStart(); + this.clearSelection(); + }; + this.navigateWordRight = function() { + this.selection.moveCursorWordRight(); + this.clearSelection(); + }; + this.navigateWordLeft = function() { + this.selection.moveCursorWordLeft(); + this.clearSelection(); + }; + this.replace = function(replacement, options) { + if (options) + this.$search.set(options); + + var range = this.$search.find(this.session); + var replaced = 0; + if (!range) + return replaced; + + if (this.$tryReplace(range, replacement)) { + replaced = 1; + } + if (range !== null) { + this.selection.setSelectionRange(range); + this.renderer.scrollSelectionIntoView(range.start, range.end); + } + + return replaced; + }; + this.replaceAll = function(replacement, options) { + if (options) { + this.$search.set(options); + } + + var ranges = this.$search.findAll(this.session); + var replaced = 0; + if (!ranges.length) + return replaced; + + this.$blockScrolling += 1; + + var selection = this.getSelectionRange(); + this.clearSelection(); + this.selection.moveCursorTo(0, 0); + + for (var i = ranges.length - 1; i >= 0; --i) { + if(this.$tryReplace(ranges[i], replacement)) { + replaced++; + } + } + + this.selection.setSelectionRange(selection); + this.$blockScrolling -= 1; + + return replaced; + }; + + this.$tryReplace = function(range, replacement) { + var input = this.session.getTextRange(range); + replacement = this.$search.replace(input, replacement); + if (replacement !== null) { + range.end = this.session.replace(range, replacement); + return range; + } else { + return null; + } + }; + this.getLastSearchOptions = function() { + return this.$search.getOptions(); + }; + this.find = function(needle, options, animate) { + if (!options) + options = {}; + + if (typeof needle == "string" || needle instanceof RegExp) + options.needle = needle; + else if (typeof needle == "object") + oop.mixin(options, needle); + + var range = this.selection.getRange(); + if (options.needle == null) { + needle = this.session.getTextRange(range) + || this.$search.$options.needle; + if (!needle) { + range = this.session.getWordRange(range.start.row, range.start.column); + needle = this.session.getTextRange(range); + } + this.$search.set({needle: needle}); + } + + this.$search.set(options); + if (!options.start) + this.$search.set({start: range}); + + var newRange = this.$search.find(this.session); + if (options.preventScroll) + return newRange; + if (newRange) { + this.revealRange(newRange, animate); + return newRange; + } + if (options.backwards) + range.start = range.end; + else + range.end = range.start; + this.selection.setRange(range); + }; + this.findNext = function(options, animate) { + this.find({skipCurrent: true, backwards: false}, options, animate); + }; + this.findPrevious = function(options, animate) { + this.find(options, {skipCurrent: true, backwards: true}, animate); + }; + + this.revealRange = function(range, animate) { + this.$blockScrolling += 1; + this.session.unfold(range); + this.selection.setSelectionRange(range); + this.$blockScrolling -= 1; + + var scrollTop = this.renderer.scrollTop; + this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); + if (animate !== false) + this.renderer.animateScrolling(scrollTop); + }; + this.undo = function() { + this.$blockScrolling++; + this.session.getUndoManager().undo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); + }; + this.redo = function() { + this.$blockScrolling++; + this.session.getUndoManager().redo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); + }; + this.destroy = function() { + this.renderer.destroy(); + this._emit("destroy", this); + }; + this.setAutoScrollEditorIntoView = function(enable) { + if (enable === false) + return; + var rect; + var self = this; + var shouldScroll = false; + if (!this.$scrollAnchor) + this.$scrollAnchor = document.createElement("div"); + var scrollAnchor = this.$scrollAnchor; + scrollAnchor.style.cssText = "position:absolute"; + this.container.insertBefore(scrollAnchor, this.container.firstChild); + var onChangeSelection = this.on("changeSelection", function() { + shouldScroll = true; + }); + var onBeforeRender = this.renderer.on("beforeRender", function() { + if (shouldScroll) + rect = self.renderer.container.getBoundingClientRect(); + }); + var onAfterRender = this.renderer.on("afterRender", function() { + if (shouldScroll && rect && self.isFocused()) { + var renderer = self.renderer; + var pos = renderer.$cursorLayer.$pixelPos; + var config = renderer.layerConfig; + var top = pos.top - config.offset; + if (pos.top >= 0 && top + rect.top < 0) { + shouldScroll = true; + } else if (pos.top < config.height && + pos.top + rect.top + config.lineHeight > window.innerHeight) { + shouldScroll = false; + } else { + shouldScroll = null; + } + if (shouldScroll != null) { + scrollAnchor.style.top = top + "px"; + scrollAnchor.style.left = pos.left + "px"; + scrollAnchor.style.height = config.lineHeight + "px"; + scrollAnchor.scrollIntoView(shouldScroll); + } + shouldScroll = rect = null; + } + }); + this.setAutoScrollEditorIntoView = function(enable) { + if (enable === true) + return; + delete this.setAutoScrollEditorIntoView; + this.removeEventListener("changeSelection", onChangeSelection); + this.renderer.removeEventListener("afterRender", onAfterRender); + this.renderer.removeEventListener("beforeRender", onBeforeRender); + }; + }; + + + this.$resetCursorStyle = function() { + var style = this.$cursorStyle || "ace"; + var cursorLayer = this.renderer.$cursorLayer; + if (!cursorLayer) + return; + cursorLayer.setSmoothBlinking(style == "smooth"); + cursorLayer.isBlinking = !this.$readOnly && style != "wide"; + }; + +}).call(Editor.prototype); + + + +config.defineOptions(Editor.prototype, "editor", { + selectionStyle: { + set: function(style) { + this.onSelectionChange(); + this._emit("changeSelectionStyle", {data: style}); + }, + initialValue: "line" + }, + highlightActiveLine: { + set: function() {this.$updateHighlightActiveLine();}, + initialValue: true + }, + highlightSelectedWord: { + set: function(shouldHighlight) {this.$onSelectionChange();}, + initialValue: true + }, + readOnly: { + set: function(readOnly) { + this.textInput.setReadOnly(readOnly); + this.$resetCursorStyle(); + }, + initialValue: false + }, + cursorStyle: { + set: function(val) { this.$resetCursorStyle(); }, + values: ["ace", "slim", "smooth", "wide"], + initialValue: "ace" + }, + mergeUndoDeltas: { + values: [false, true, "always"], + initialValue: true + }, + behavioursEnabled: {initialValue: true}, + wrapBehavioursEnabled: {initialValue: true}, + + hScrollBarAlwaysVisible: "renderer", + vScrollBarAlwaysVisible: "renderer", + highlightGutterLine: "renderer", + animatedScroll: "renderer", + showInvisibles: "renderer", + showPrintMargin: "renderer", + printMarginColumn: "renderer", + printMargin: "renderer", + fadeFoldWidgets: "renderer", + showFoldWidgets: "renderer", + showGutter: "renderer", + displayIndentGuides: "renderer", + fontSize: "renderer", + fontFamily: "renderer", + maxLines: "renderer", + minLines: "renderer", + scrollPastEnd: "renderer", + fixedWidthGutter: "renderer", + theme: "renderer", + + scrollSpeed: "$mouseHandler", + dragDelay: "$mouseHandler", + dragEnabled: "$mouseHandler", + focusTimout: "$mouseHandler", + + firstLineNumber: "session", + overwrite: "session", + newLineMode: "session", + useWorker: "session", + useSoftTabs: "session", + tabSize: "session", + wrap: "session", + foldStyle: "session", + mode: "session" +}); + +exports.Editor = Editor; +}); + +ace.define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) { + + +exports.stringReverse = function(string) { + return string.split("").reverse().join(""); +}; + +exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; +}; + +var trimBeginRegexp = /^\s\s*/; +var trimEndRegexp = /\s\s*$/; + +exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); +}; + +exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); +}; + +exports.copyObject = function(obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; +}; + +exports.copyArray = function(array){ + var copy = []; + for (var i=0, l=array.length; i= 0) { + anchor = this.$clickSelection.start; + if (range.start.row != cursor.row || range.start.column != cursor.column) + cursor = range.end; + } else if (cmpStart == -1 && cmpEnd == 1) { + cursor = range.end; + anchor = range.start; + } else { + var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); + cursor = orientedRange.cursor; + anchor = orientedRange.anchor; + } + editor.selection.setSelectionAnchor(anchor.row, anchor.column); + } + editor.selection.selectToPosition(cursor); + + editor.renderer.scrollCursorIntoView(); + }; + + this.selectEnd = + this.selectAllEnd = + this.selectByWordsEnd = + this.selectByLinesEnd = function() { + this.editor.unsetStyle("ace_selecting"); + if (this.editor.renderer.scroller.releaseCapture) { + this.editor.renderer.scroller.releaseCapture(); + } + }; + + this.focusWait = function() { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + var time = Date.now(); + + if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimout) + this.startSelect(this.mousedownEvent.getDocumentPosition()); + }; + + this.onDoubleClick = function(ev) { + var pos = ev.getDocumentPosition(); + var editor = this.editor; + var session = editor.session; + + var range = session.getBracketRange(pos); + if (range) { + if (range.isEmpty()) { + range.start.column--; + range.end.column++; + } + this.setState("select"); + } else { + range = editor.selection.getWordRange(pos.row, pos.column); + this.setState("selectByWords"); + } + this.$clickSelection = range; + this[this.state] && this[this.state](ev); + }; + + this.onTripleClick = function(ev) { + var pos = ev.getDocumentPosition(); + var editor = this.editor; + + this.setState("selectByLines"); + this.$clickSelection = editor.selection.getLineRange(pos.row); + this[this.state] && this[this.state](ev); + }; + + this.onQuadClick = function(ev) { + var editor = this.editor; + + editor.selectAll(); + this.$clickSelection = editor.getSelectionRange(); + this.setState("selectAll"); + }; + + this.onMouseWheel = function(ev) { + if (ev.getShiftKey() || ev.getAccelKey()) + return; + var t = ev.domEvent.timeStamp; + var dt = t - (this.$lastScrollTime||0); + + var editor = this.editor; + var isScrolable = editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + if (isScrolable || dt < 200) { + this.$lastScrollTime = t; + editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + return ev.stop(); + } + }; + +}).call(DefaultHandlers.prototype); + +exports.DefaultHandlers = DefaultHandlers; + +function calcDistance(ax, ay, bx, by) { + return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); +} + +function calcRangeOrientation(range, cursor) { + if (range.start.row == range.end.row) + var cmp = 2 * cursor.column - range.start.column - range.end.column; + else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column) + var cmp = cursor.column - 4; + else + var cmp = 2 * cursor.row - range.start.row - range.end.row; + + if (cmp < 0) + return {cursor: range.start, anchor: range.end}; + else + return {cursor: range.end, anchor: range.start}; +} + +}); + +ace.define('ace/mouse/default_gutter_handler', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/event'], function(require, exports, module) { + +var dom = require("../lib/dom"); +var event = require("../lib/event"); + +function GutterHandler(mouseHandler) { + var editor = mouseHandler.editor; + var gutter = editor.renderer.$gutterLayer; + + mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) { + if (!editor.isFocused() || e.getButton() != 0) + return; + var gutterRegion = gutter.getRegion(e); + + if (gutterRegion == "foldWidgets") + return; + + var row = e.getDocumentPosition().row; + var selection = editor.session.selection; + + if (e.getShiftKey()) + selection.selectTo(row, 0); + else { + if (e.domEvent.detail == 2) { + editor.selectAll(); + return e.preventDefault(); + } + mouseHandler.$clickSelection = editor.selection.getLineRange(row); + } + mouseHandler.setState("selectByLines"); + mouseHandler.captureMouse(e); + return e.preventDefault(); + }); + + + var tooltipTimeout, mouseEvent, tooltip, tooltipAnnotation; + function createTooltip() { + tooltip = dom.createElement("div"); + tooltip.className = "ace_gutter-tooltip"; + tooltip.style.display = "none"; + editor.container.appendChild(tooltip); + } + + function showTooltip() { + if (!tooltip) { + createTooltip(); + } + var row = mouseEvent.getDocumentPosition().row; + var annotation = gutter.$annotations[row]; + if (!annotation) + return hideTooltip(); + + var maxRow = editor.session.getLength(); + if (row == maxRow) { + var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row; + var pos = mouseEvent.$pos; + if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column)) + return hideTooltip(); + } + + if (tooltipAnnotation == annotation) + return; + tooltipAnnotation = annotation.text.join("
    "); + + tooltip.style.display = "block"; + tooltip.innerHTML = tooltipAnnotation; + editor.on("mousewheel", hideTooltip); + + moveTooltip(mouseEvent); + } + + function hideTooltip() { + if (tooltipTimeout) + tooltipTimeout = clearTimeout(tooltipTimeout); + if (tooltipAnnotation) { + tooltip.style.display = "none"; + tooltipAnnotation = null; + editor.removeEventListener("mousewheel", hideTooltip); + } + } + + function moveTooltip(e) { + var rect = editor.renderer.$gutter.getBoundingClientRect(); + tooltip.style.left = e.x + 15 + "px"; + if (e.y + 3 * editor.renderer.lineHeight + 15 < rect.bottom) { + tooltip.style.bottom = ""; + tooltip.style.top = e.y + 15 + "px"; + } else { + tooltip.style.top = ""; + var innerHeight = window.innerHeight || document.documentElement.clientHeight; + tooltip.style.bottom = innerHeight - e.y + 5 + "px"; + } + } + + mouseHandler.editor.setDefaultHandler("guttermousemove", function(e) { + var target = e.domEvent.target || e.domEvent.srcElement; + if (dom.hasCssClass(target, "ace_fold-widget")) + return hideTooltip(); + + if (tooltipAnnotation) + moveTooltip(e); + + mouseEvent = e; + if (tooltipTimeout) + return; + tooltipTimeout = setTimeout(function() { + tooltipTimeout = null; + if (mouseEvent && !mouseHandler.isMousePressed) + showTooltip(); + else + hideTooltip(); + }, 50); + }); + + event.addListener(editor.renderer.$gutter, "mouseout", function(e) { + mouseEvent = null; + if (!tooltipAnnotation || tooltipTimeout) + return; + + tooltipTimeout = setTimeout(function() { + tooltipTimeout = null; + hideTooltip(); + }, 50); + }); + + editor.on("changeSession", hideTooltip); +} + +exports.GutterHandler = GutterHandler; + +}); + +ace.define('ace/mouse/mouse_event', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent'], function(require, exports, module) { + + +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); +var MouseEvent = exports.MouseEvent = function(domEvent, editor) { + this.domEvent = domEvent; + this.editor = editor; + + this.x = this.clientX = domEvent.clientX; + this.y = this.clientY = domEvent.clientY; + + this.$pos = null; + this.$inSelection = null; + + this.propagationStopped = false; + this.defaultPrevented = false; +}; + +(function() { + + this.stopPropagation = function() { + event.stopPropagation(this.domEvent); + this.propagationStopped = true; + }; + + this.preventDefault = function() { + event.preventDefault(this.domEvent); + this.defaultPrevented = true; + }; + + this.stop = function() { + this.stopPropagation(); + this.preventDefault(); + }; + this.getDocumentPosition = function() { + if (this.$pos) + return this.$pos; + + this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY); + return this.$pos; + }; + this.inSelection = function() { + if (this.$inSelection !== null) + return this.$inSelection; + + var editor = this.editor; + + + var selectionRange = editor.getSelectionRange(); + if (selectionRange.isEmpty()) + this.$inSelection = false; + else { + var pos = this.getDocumentPosition(); + this.$inSelection = selectionRange.contains(pos.row, pos.column); + } + + return this.$inSelection; + }; + this.getButton = function() { + return event.getButton(this.domEvent); + }; + this.getShiftKey = function() { + return this.domEvent.shiftKey; + }; + + this.getAccelKey = useragent.isMac + ? function() { return this.domEvent.metaKey; } + : function() { return this.domEvent.ctrlKey; }; + +}).call(MouseEvent.prototype); + +}); + +ace.define('ace/mouse/dragdrop_handler', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/event', 'ace/lib/useragent'], function(require, exports, module) { + + +var dom = require("../lib/dom"); +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); + +var AUTOSCROLL_DELAY = 200; +var SCROLL_CURSOR_DELAY = 200; +var SCROLL_CURSOR_HYSTERESIS = 5; + +function DragdropHandler(mouseHandler) { + + var editor = mouseHandler.editor; + + var blankImage = dom.createElement("img"); + blankImage.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (useragent.isOpera) + blankImage.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"; + + var exports = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"]; + + exports.forEach(function(x) { + mouseHandler[x] = this[x]; + }, this); + editor.addEventListener("mousedown", this.onMouseDown.bind(mouseHandler)); + + + var mouseTarget = editor.container; + var dragSelectionMarker, x, y; + var timerId, range; + var dragCursor, counter = 0; + var dragOperation; + var isInternal; + var autoScrollStartTime; + var cursorMovedTime; + var cursorPointOnCaretMoved; + + this.onDragStart = function(e) { + if (this.cancelDrag || !mouseTarget.draggable) { + var self = this; + setTimeout(function(){ + self.startSelect(); + self.captureMouse(e); + }, 0); + return e.preventDefault(); + } + range = editor.getSelectionRange(); + + var dataTransfer = e.dataTransfer; + dataTransfer.effectAllowed = editor.getReadOnly() ? "copy" : "copyMove"; + if (useragent.isOpera) { + editor.container.appendChild(blankImage); + blankImage._top = blankImage.offsetTop; + } + dataTransfer.setDragImage && dataTransfer.setDragImage(blankImage, 0, 0); + if (useragent.isOpera) { + editor.container.removeChild(blankImage); + } + dataTransfer.clearData(); + dataTransfer.setData("Text", editor.session.getTextRange()); + + isInternal = true; + this.setState("drag"); + }; + + this.onDragEnd = function(e) { + mouseTarget.draggable = false; + isInternal = false; + this.setState(null); + if (!editor.getReadOnly()) { + var dropEffect = e.dataTransfer.dropEffect; + if (!dragOperation && dropEffect == "move") + editor.session.remove(editor.getSelectionRange()); + editor.renderer.$cursorLayer.setBlinking(true); + } + this.editor.unsetStyle("ace_dragging"); + }; + + this.onDragEnter = function(e) { + if (editor.getReadOnly() || !canAccept(e.dataTransfer)) + return; + if (!dragSelectionMarker) + addDragMarker(); + counter++; + e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); + return event.preventDefault(e); + }; + + this.onDragOver = function(e) { + if (editor.getReadOnly() || !canAccept(e.dataTransfer)) + return; + if (!dragSelectionMarker) { + addDragMarker(); + counter++; + } + if (onMouseMoveTimer !== null) + onMouseMoveTimer = null; + x = e.clientX; + y = e.clientY; + + e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); + return event.preventDefault(e); + }; + + this.onDragLeave = function(e) { + counter--; + if (counter <= 0 && dragSelectionMarker) { + clearDragMarker(); + dragOperation = null; + return event.preventDefault(e); + } + }; + + this.onDrop = function(e) { + if (!dragSelectionMarker) + return; + var dataTransfer = e.dataTransfer; + if (isInternal) { + switch (dragOperation) { + case "move": + if (range.contains(dragCursor.row, dragCursor.column)) { + range = { + start: dragCursor, + end: dragCursor + }; + } else { + range = editor.moveText(range, dragCursor); + } + break; + case "copy": + range = editor.moveText(range, dragCursor, true); + break; + } + } else { + var dropData = dataTransfer.getData('Text'); + range = { + start: dragCursor, + end: editor.session.insert(dragCursor, dropData) + }; + editor.focus(); + dragOperation = null; + } + clearDragMarker(); + return event.preventDefault(e); + }; + + event.addListener(mouseTarget, "dragstart", this.onDragStart.bind(mouseHandler)); + event.addListener(mouseTarget, "dragend", this.onDragEnd.bind(mouseHandler)); + event.addListener(mouseTarget, "dragenter", this.onDragEnter.bind(mouseHandler)); + event.addListener(mouseTarget, "dragover", this.onDragOver.bind(mouseHandler)); + event.addListener(mouseTarget, "dragleave", this.onDragLeave.bind(mouseHandler)); + event.addListener(mouseTarget, "drop", this.onDrop.bind(mouseHandler)); + + function scrollCursorIntoView(cursor, prevCursor) { + var now = Date.now(); + var vMovement = !prevCursor || cursor.row != prevCursor.row; + var hMovement = !prevCursor || cursor.column != prevCursor.column; + if (!cursorMovedTime || vMovement || hMovement) { + editor.$blockScrolling += 1; + editor.moveCursorToPosition(cursor); + editor.$blockScrolling -= 1; + cursorMovedTime = now; + cursorPointOnCaretMoved = {x: x, y: y}; + } else { + var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y); + if (distance > SCROLL_CURSOR_HYSTERESIS) { + cursorMovedTime = null; + } else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) { + editor.renderer.scrollCursorIntoView(); + cursorMovedTime = null; + } + } + } + + function autoScroll(cursor, prevCursor) { + var now = Date.now(); + var lineHeight = editor.renderer.layerConfig.lineHeight; + var characterWidth = editor.renderer.layerConfig.characterWidth; + var editorRect = editor.renderer.scroller.getBoundingClientRect(); + var offsets = { + x: { + left: x - editorRect.left, + right: editorRect.right - x + }, + y: { + top: y - editorRect.top, + bottom: editorRect.bottom - y + } + }; + var nearestXOffset = Math.min(offsets.x.left, offsets.x.right); + var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom); + var scrollCursor = {row: cursor.row, column: cursor.column}; + if (nearestXOffset / characterWidth <= 2) { + scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2); + } + if (nearestYOffset / lineHeight <= 1) { + scrollCursor.row += (offsets.y.top < offsets.y.bottom ? -1 : +1); + } + var vScroll = cursor.row != scrollCursor.row; + var hScroll = cursor.column != scrollCursor.column; + var vMovement = !prevCursor || cursor.row != prevCursor.row; + if (vScroll || (hScroll && !vMovement)) { + if (!autoScrollStartTime) + autoScrollStartTime = now; + else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY) + editor.renderer.scrollCursorIntoView(scrollCursor); + } else { + autoScrollStartTime = null; + } + } + + function onDragInterval() { + var prevCursor = dragCursor; + dragCursor = editor.renderer.screenToTextCoordinates(x, y); + scrollCursorIntoView(dragCursor, prevCursor); + autoScroll(dragCursor, prevCursor); + } + + function addDragMarker() { + range = editor.selection.toOrientedRange(); + dragSelectionMarker = editor.session.addMarker(range, "ace_selection", editor.getSelectionStyle()); + editor.clearSelection(); + if (editor.isFocused()) + editor.renderer.$cursorLayer.setBlinking(false); + clearInterval(timerId); + timerId = setInterval(onDragInterval, 20); + counter = 0; + event.addListener(document, "mousemove", onMouseMove); + } + + function clearDragMarker() { + clearInterval(timerId); + editor.session.removeMarker(dragSelectionMarker); + dragSelectionMarker = null; + editor.$blockScrolling += 1; + editor.selection.fromOrientedRange(range); + editor.$blockScrolling -= 1; + if (editor.isFocused() && !isInternal) + editor.renderer.$cursorLayer.setBlinking(!editor.getReadOnly()); + range = null; + counter = 0; + autoScrollStartTime = null; + cursorMovedTime = null; + event.removeListener(document, "mousemove", onMouseMove); + } + var onMouseMoveTimer = null; + function onMouseMove() { + if (onMouseMoveTimer == null) { + onMouseMoveTimer = setTimeout(function() { + if (onMouseMoveTimer != null && dragSelectionMarker) + clearDragMarker(); + }, 20); + } + } + + function canAccept(dataTransfer) { + var types = dataTransfer.types; + return !types || Array.prototype.some.call(types, function(type) { + return type == 'text/plain' || type == 'Text'; + }); + } + + function getDropEffect(e) { + var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized']; + var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized']; + + var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey; + var effectAllowed = "uninitialized"; + try { + effectAllowed = e.dataTransfer.effectAllowed.toLowerCase(); + } catch (e) {} + var dropEffect = "none"; + + if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "copy"; + else if (moveAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "move"; + else if (copyAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "copy"; + + return dropEffect; + } +} + +(function() { + + this.dragWait = function() { + var interval = Date.now() - this.mousedownEvent.time; + if (interval > this.editor.getDragDelay()) + this.startDrag(); + }; + + this.dragWaitEnd = function() { + var target = this.editor.container; + target.draggable = false; + this.startSelect(this.mousedownEvent.getDocumentPosition()); + this.selectEnd(); + }; + + this.dragReadyEnd = function(e) { + this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()); + this.editor.unsetStyle("ace_dragging"); + this.dragWaitEnd(); + }; + + this.startDrag = function(){ + this.cancelDrag = false; + var target = this.editor.container; + target.draggable = true; + this.editor.renderer.$cursorLayer.setBlinking(false); + this.editor.setStyle("ace_dragging"); + this.setState("dragReady"); + }; + + this.onMouseDrag = function(e) { + var target = this.editor.container; + if (useragent.isIE && this.state == "dragReady") { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + if (distance > 3) + target.dragDrop(); + } + if (this.state === "dragWait") { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + if (distance > 0) { + target.draggable = false; + this.startSelect(this.mousedownEvent.getDocumentPosition()); + } + } + }; + + this.onMouseDown = function(e) { + if (!this.$dragEnabled) + return; + this.mousedownEvent = e; + var editor = this.editor; + + var inSelection = e.inSelection(); + var button = e.getButton(); + var clickCount = e.domEvent.detail || 1; + if (clickCount === 1 && button === 0 && inSelection) { + if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey())) + return; + this.mousedownEvent.time = Date.now(); + var eventTarget = e.domEvent.target || e.domEvent.srcElement; + if ("unselectable" in eventTarget) + eventTarget.unselectable = "on"; + if (editor.getDragDelay()) { + if (useragent.isWebKit) { + this.cancelDrag = true; + var mouseTarget = editor.container; + mouseTarget.draggable = true; + } + this.setState("dragWait"); + } else { + this.startDrag(); + } + this.captureMouse(e, this.onMouseDrag.bind(this)); + e.defaultPrevented = true; + } + }; + +}).call(DragdropHandler.prototype); + + +function calcDistance(ax, ay, bx, by) { + return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); +} + +exports.DragdropHandler = DragdropHandler; + +}); + +ace.define('ace/config', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/lib/net', 'ace/lib/event_emitter'], function(require, exports, module) { +"no use strict"; + +var lang = require("./lib/lang"); +var oop = require("./lib/oop"); +var net = require("./lib/net"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; + +var global = (function() { + return this; +})(); + +var options = { + packaged: false, + workerPath: null, + modePath: null, + themePath: null, + basePath: "", + suffix: ".js", + $moduleUrls: {} +}; + +exports.get = function(key) { + if (!options.hasOwnProperty(key)) + throw new Error("Unknown config key: " + key); + + return options[key]; +}; + +exports.set = function(key, value) { + if (!options.hasOwnProperty(key)) + throw new Error("Unknown config key: " + key); + + options[key] = value; +}; + +exports.all = function() { + return lang.copyObject(options); +}; +oop.implement(exports, EventEmitter); + +exports.moduleUrl = function(name, component) { + if (options.$moduleUrls[name]) + return options.$moduleUrls[name]; + + var parts = name.split("/"); + component = component || parts[parts.length - 2] || ""; + var sep = component == "snippets" ? "/" : "-"; + var base = parts[parts.length - 1]; + if (sep == "-") { + var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); + base = base.replace(re, ""); + } + + if ((!base || base == component) && parts.length > 1) + base = parts[parts.length - 2]; + var path = options[component + "Path"]; + if (path == null) { + path = options.basePath; + } else if (sep == "/") { + component = sep = ""; + } + if (path && path.slice(-1) != "/") + path += "/"; + return path + component + sep + base + this.get("suffix"); +}; + +exports.setModuleUrl = function(name, subst) { + return options.$moduleUrls[name] = subst; +}; + +exports.$loading = {}; +exports.loadModule = function(moduleName, onLoad) { + var module, moduleType; + if (Array.isArray(moduleName)) { + moduleType = moduleName[0]; + moduleName = moduleName[1]; + } + + try { + module = require(moduleName); + } catch (e) {} + if (module && !exports.$loading[moduleName]) + return onLoad && onLoad(module); + + if (!exports.$loading[moduleName]) + exports.$loading[moduleName] = []; + + exports.$loading[moduleName].push(onLoad); + + if (exports.$loading[moduleName].length > 1) + return; + + var afterLoad = function() { + require([moduleName], function(module) { + exports._emit("load.module", {name: moduleName, module: module}); + var listeners = exports.$loading[moduleName]; + exports.$loading[moduleName] = null; + listeners.forEach(function(onLoad) { + onLoad && onLoad(module); + }); + }); + }; + + if (!exports.get("packaged")) + return afterLoad(); + net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); +}; +exports.init = function() { + options.packaged = require.packaged || module.packaged || (global.define && define.packaged); + + if (!global.document) + return ""; + + var scriptOptions = {}; + var scriptUrl = ""; + + var scripts = document.getElementsByTagName("script"); + for (var i=0; i i) { + this.$docRowCache.splice(i, l); + this.$screenRowCache.splice(i, l); + } + }; + + this.$getRowCacheIndex = function(cacheArray, val) { + var low = 0; + var hi = cacheArray.length - 1; + + while (low <= hi) { + var mid = (low + hi) >> 1; + var c = cacheArray[mid]; + + if (val > c) + low = mid + 1; + else if (val < c) + hi = mid - 1; + else + return mid; + } + + return low -1; + }; + + this.resetCaches = function() { + this.$modified = true; + this.$wrapData = []; + this.$rowLengthCache = []; + this.$resetRowCache(0); + if (this.bgTokenizer) + this.bgTokenizer.start(0); + }; + + this.onChangeFold = function(e) { + var fold = e.data; + this.$resetRowCache(fold.start.row); + }; + + this.onChange = function(e) { + var delta = e.data; + this.$modified = true; + + this.$resetRowCache(delta.range.start.row); + + var removedFolds = this.$updateInternalDataOnChange(e); + if (!this.$fromUndo && this.$undoManager && !delta.ignore) { + this.$deltasDoc.push(delta); + if (removedFolds && removedFolds.length != 0) { + this.$deltasFold.push({ + action: "removeFolds", + folds: removedFolds + }); + } + + this.$informUndoManager.schedule(); + } + + this.bgTokenizer.$updateOnChange(delta); + this._emit("change", e); + }; + this.setValue = function(text) { + this.doc.setValue(text); + this.selection.moveCursorTo(0, 0); + this.selection.clearSelection(); + + this.$resetRowCache(0); + this.$deltas = []; + this.$deltasDoc = []; + this.$deltasFold = []; + this.getUndoManager().reset(); + }; + this.getValue = + this.toString = function() { + return this.doc.getValue(); + }; + this.getSelection = function() { + return this.selection; + }; + this.getState = function(row) { + return this.bgTokenizer.getState(row); + }; + this.getTokens = function(row) { + return this.bgTokenizer.getTokens(row); + }; + this.getTokenAt = function(row, column) { + var tokens = this.bgTokenizer.getTokens(row); + var token, c = 0; + if (column == null) { + i = tokens.length - 1; + c = this.getLine(row).length; + } else { + for (var i = 0; i < tokens.length; i++) { + c += tokens[i].value.length; + if (c >= column) + break; + } + } + token = tokens[i]; + if (!token) + return null; + token.index = i; + token.start = c - token.value.length; + return token; + }; + this.setUndoManager = function(undoManager) { + this.$undoManager = undoManager; + this.$deltas = []; + this.$deltasDoc = []; + this.$deltasFold = []; + + if (this.$informUndoManager) + this.$informUndoManager.cancel(); + + if (undoManager) { + var self = this; + + this.$syncInformUndoManager = function() { + self.$informUndoManager.cancel(); + + if (self.$deltasFold.length) { + self.$deltas.push({ + group: "fold", + deltas: self.$deltasFold + }); + self.$deltasFold = []; + } + + if (self.$deltasDoc.length) { + self.$deltas.push({ + group: "doc", + deltas: self.$deltasDoc + }); + self.$deltasDoc = []; + } + + if (self.$deltas.length > 0) { + undoManager.execute({ + action: "aceupdate", + args: [self.$deltas, self], + merge: self.mergeUndoDeltas + }); + } + self.mergeUndoDeltas = false; + self.$deltas = []; + } + this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); + } + }; + this.markUndoGroup = function() { + if (this.$syncInformUndoManager) + this.$syncInformUndoManager(); + }; + + this.$defaultUndoManager = { + undo: function() {}, + redo: function() {}, + reset: function() {} + }; + this.getUndoManager = function() { + return this.$undoManager || this.$defaultUndoManager; + }; + this.getTabString = function() { + if (this.getUseSoftTabs()) { + return lang.stringRepeat(" ", this.getTabSize()); + } else { + return "\t"; + } + }; + this.setUseSoftTabs = function(val) { + this.setOption("useSoftTabs", val); + }; + this.getUseSoftTabs = function() { + return this.$useSoftTabs && !this.$mode.$indentWithTabs; + }; + this.setTabSize = function(tabSize) { + this.setOption("tabSize", tabSize) + }; + this.getTabSize = function() { + return this.$tabSize; + }; + this.isTabStop = function(position) { + return this.$useSoftTabs && (position.column % this.$tabSize == 0); + }; + + this.$overwrite = false; + this.setOverwrite = function(overwrite) { + this.setOption("overwrite", overwrite) + }; + this.getOverwrite = function() { + return this.$overwrite; + }; + this.toggleOverwrite = function() { + this.setOverwrite(!this.$overwrite); + }; + this.addGutterDecoration = function(row, className) { + if (!this.$decorations[row]) + this.$decorations[row] = ""; + this.$decorations[row] += " " + className; + this._emit("changeBreakpoint", {}); + }; + this.removeGutterDecoration = function(row, className) { + this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); + this._emit("changeBreakpoint", {}); + }; + this.getBreakpoints = function() { + return this.$breakpoints; + }; + this.setBreakpoints = function(rows) { + this.$breakpoints = []; + for (var i=0; i 0) + inToken = !!line.charAt(column - 1).match(this.tokenRe); + + if (!inToken) + inToken = !!line.charAt(column).match(this.tokenRe); + + if (inToken) + var re = this.tokenRe; + else if (/^\s+$/.test(line.slice(column-1, column+1))) + var re = /\s/; + else + var re = this.nonTokenRe; + + var start = column; + if (start > 0) { + do { + start--; + } + while (start >= 0 && line.charAt(start).match(re)); + start++; + } + + var end = column; + while (end < line.length && line.charAt(end).match(re)) { + end++; + } + + return new Range(row, start, row, end); + }; + this.getAWordRange = function(row, column) { + var wordRange = this.getWordRange(row, column); + var line = this.getLine(wordRange.end.row); + + while (line.charAt(wordRange.end.column).match(/[ \t]/)) { + wordRange.end.column += 1; + } + return wordRange; + }; + this.setNewLineMode = function(newLineMode) { + this.doc.setNewLineMode(newLineMode); + }; + this.getNewLineMode = function() { + return this.doc.getNewLineMode(); + }; + this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); }; + this.getUseWorker = function() { return this.$useWorker; }; + this.onReloadTokenizer = function(e) { + var rows = e.data; + this.bgTokenizer.start(rows.first); + this._emit("tokenizerUpdate", e); + }; + + this.$modes = {}; + this.$mode = null; + this.$modeId = null; + this.setMode = function(mode, cb) { + if (mode && typeof mode === "object") { + if (mode.getTokenizer) + return this.$onChangeMode(mode); + var options = mode; + var path = options.path; + } else { + path = mode || "ace/mode/text"; + } + if (!this.$modes["ace/mode/text"]) + this.$modes["ace/mode/text"] = new TextMode(); + + if (this.$modes[path] && !options) { + this.$onChangeMode(this.$modes[path]); + cb && cb(); + return; + } + this.$modeId = path; + config.loadModule(["mode", path], function(m) { + if (this.$modeId !== path) + return cb && cb(); + if (this.$modes[path] && !options) + return this.$onChangeMode(this.$modes[path]); + if (m && m.Mode) { + m = new m.Mode(options); + if (!options) { + this.$modes[path] = m; + m.$id = path; + } + this.$onChangeMode(m); + cb && cb(); + } + }.bind(this)); + if (!this.$mode) + this.$onChangeMode(this.$modes["ace/mode/text"], true); + }; + + this.$onChangeMode = function(mode, $isPlaceholder) { + if (!$isPlaceholder) + this.$modeId = mode.$id; + if (this.$mode === mode) + return; + + this.$mode = mode; + + this.$stopWorker(); + + if (this.$useWorker) + this.$startWorker(); + + var tokenizer = mode.getTokenizer(); + + if(tokenizer.addEventListener !== undefined) { + var onReloadTokenizer = this.onReloadTokenizer.bind(this); + tokenizer.addEventListener("update", onReloadTokenizer); + } + + if (!this.bgTokenizer) { + this.bgTokenizer = new BackgroundTokenizer(tokenizer); + var _self = this; + this.bgTokenizer.addEventListener("update", function(e) { + _self._emit("tokenizerUpdate", e); + }); + } else { + this.bgTokenizer.setTokenizer(tokenizer); + } + + this.bgTokenizer.setDocument(this.getDocument()); + + this.tokenRe = mode.tokenRe; + this.nonTokenRe = mode.nonTokenRe; + + + if (!$isPlaceholder) { + this.$options.wrapMethod.set.call(this, this.$wrapMethod); + this.$setFolding(mode.foldingRules); + this.bgTokenizer.start(0); + this._emit("changeMode"); + } + }; + + + this.$stopWorker = function() { + if (this.$worker) + this.$worker.terminate(); + + this.$worker = null; + }; + + this.$startWorker = function() { + if (typeof Worker !== "undefined" && !require.noWorker) { + try { + this.$worker = this.$mode.createWorker(this); + } catch (e) { + console.log("Could not load worker"); + console.log(e); + this.$worker = null; + } + } + else + this.$worker = null; + }; + this.getMode = function() { + return this.$mode; + }; + + this.$scrollTop = 0; + this.setScrollTop = function(scrollTop) { + if (this.$scrollTop === scrollTop || isNaN(scrollTop)) + return; + + this.$scrollTop = scrollTop; + this._signal("changeScrollTop", scrollTop); + }; + this.getScrollTop = function() { + return this.$scrollTop; + }; + + this.$scrollLeft = 0; + this.setScrollLeft = function(scrollLeft) { + if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft)) + return; + + this.$scrollLeft = scrollLeft; + this._signal("changeScrollLeft", scrollLeft); + }; + this.getScrollLeft = function() { + return this.$scrollLeft; + }; + this.getScreenWidth = function() { + this.$computeWidth(); + if (this.lineWidgets) + return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth); + return this.screenWidth; + }; + + this.getLineWidgetMaxWidth = function() { + if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth + var width = 0; + this.lineWidgets.forEach(function(w) { + if (w && w.screenWidth > width) + width = w.screenWidth; + }); + return this.lineWidgetWidth = width; + } + + this.$computeWidth = function(force) { + if (this.$modified || force) { + this.$modified = false; + + if (this.$useWrapMode) + return this.screenWidth = this.$wrapLimit; + + var lines = this.doc.getAllLines(); + var cache = this.$rowLengthCache; + var longestScreenLine = 0; + var foldIndex = 0; + var foldLine = this.$foldData[foldIndex]; + var foldStart = foldLine ? foldLine.start.row : Infinity; + var len = lines.length; + + for (var i = 0; i < len; i++) { + if (i > foldStart) { + i = foldLine.end.row + 1; + if (i >= len) + break; + foldLine = this.$foldData[foldIndex++]; + foldStart = foldLine ? foldLine.start.row : Infinity; + } + + if (cache[i] == null) + cache[i] = this.$getStringScreenWidth(lines[i])[0]; + + if (cache[i] > longestScreenLine) + longestScreenLine = cache[i]; + } + this.screenWidth = longestScreenLine; + } + }; + this.getLine = function(row) { + return this.doc.getLine(row); + }; + this.getLines = function(firstRow, lastRow) { + return this.doc.getLines(firstRow, lastRow); + }; + this.getLength = function() { + return this.doc.getLength(); + }; + this.getTextRange = function(range) { + return this.doc.getTextRange(range || this.selection.getRange()); + }; + this.insert = function(position, text) { + return this.doc.insert(position, text); + }; + this.remove = function(range) { + return this.doc.remove(range); + }; + this.undoChanges = function(deltas, dontSelect) { + if (!deltas.length) + return; + + this.$fromUndo = true; + var lastUndoRange = null; + for (var i = deltas.length - 1; i != -1; i--) { + var delta = deltas[i]; + if (delta.group == "doc") { + this.doc.revertDeltas(delta.deltas); + lastUndoRange = + this.$getUndoSelection(delta.deltas, true, lastUndoRange); + } else { + delta.deltas.forEach(function(foldDelta) { + this.addFolds(foldDelta.folds); + }, this); + } + } + this.$fromUndo = false; + lastUndoRange && + this.$undoSelect && + !dontSelect && + this.selection.setSelectionRange(lastUndoRange); + return lastUndoRange; + }; + this.redoChanges = function(deltas, dontSelect) { + if (!deltas.length) + return; + + this.$fromUndo = true; + var lastUndoRange = null; + for (var i = 0; i < deltas.length; i++) { + var delta = deltas[i]; + if (delta.group == "doc") { + this.doc.applyDeltas(delta.deltas); + lastUndoRange = + this.$getUndoSelection(delta.deltas, false, lastUndoRange); + } + } + this.$fromUndo = false; + lastUndoRange && + this.$undoSelect && + !dontSelect && + this.selection.setSelectionRange(lastUndoRange); + return lastUndoRange; + }; + this.setUndoSelect = function(enable) { + this.$undoSelect = enable; + }; + + this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { + function isInsert(delta) { + var insert = + delta.action === "insertText" || delta.action === "insertLines"; + return isUndo ? !insert : insert; + } + + var delta = deltas[0]; + var range, point; + var lastDeltaIsInsert = false; + if (isInsert(delta)) { + range = Range.fromPoints(delta.range.start, delta.range.end); + lastDeltaIsInsert = true; + } else { + range = Range.fromPoints(delta.range.start, delta.range.start); + lastDeltaIsInsert = false; + } + + for (var i = 1; i < deltas.length; i++) { + delta = deltas[i]; + if (isInsert(delta)) { + point = delta.range.start; + if (range.compare(point.row, point.column) == -1) { + range.setStart(delta.range.start); + } + point = delta.range.end; + if (range.compare(point.row, point.column) == 1) { + range.setEnd(delta.range.end); + } + lastDeltaIsInsert = true; + } else { + point = delta.range.start; + if (range.compare(point.row, point.column) == -1) { + range = + Range.fromPoints(delta.range.start, delta.range.start); + } + lastDeltaIsInsert = false; + } + } + if (lastUndoRange != null) { + if (Range.comparePoints(lastUndoRange.start, range.start) == 0) { + lastUndoRange.start.column += range.end.column - range.start.column; + lastUndoRange.end.column += range.end.column - range.start.column; + } + + var cmp = lastUndoRange.compareRange(range); + if (cmp == 1) { + range.setStart(lastUndoRange.start); + } else if (cmp == -1) { + range.setEnd(lastUndoRange.end); + } + } + + return range; + }; + this.replace = function(range, text) { + return this.doc.replace(range, text); + }; + this.moveText = function(fromRange, toPosition, copy) { + var text = this.getTextRange(fromRange); + var folds = this.getFoldsInRange(fromRange); + + var toRange = Range.fromPoints(toPosition, toPosition); + if (!copy) { + this.remove(fromRange); + var rowDiff = fromRange.start.row - fromRange.end.row; + var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column; + if (collDiff) { + if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column) + toRange.start.column += collDiff; + if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column) + toRange.end.column += collDiff; + } + if (rowDiff && toRange.start.row >= fromRange.end.row) { + toRange.start.row += rowDiff; + toRange.end.row += rowDiff; + } + } + + toRange.end = this.insert(toRange.start, text); + if (folds.length) { + var oldStart = fromRange.start; + var newStart = toRange.start; + var rowDiff = newStart.row - oldStart.row; + var collDiff = newStart.column - oldStart.column; + this.addFolds(folds.map(function(x) { + x = x.clone(); + if (x.start.row == oldStart.row) + x.start.column += collDiff; + if (x.end.row == oldStart.row) + x.end.column += collDiff; + x.start.row += rowDiff; + x.end.row += rowDiff; + return x; + })); + } + + return toRange; + }; + this.indentRows = function(startRow, endRow, indentString) { + indentString = indentString.replace(/\t/g, this.getTabString()); + for (var row=startRow; row<=endRow; row++) + this.insert({row: row, column:0}, indentString); + }; + this.outdentRows = function (range) { + var rowRange = range.collapseRows(); + var deleteRange = new Range(0, 0, 0, 0); + var size = this.getTabSize(); + + for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) { + var line = this.getLine(i); + + deleteRange.start.row = i; + deleteRange.end.row = i; + for (var j = 0; j < size; ++j) + if (line.charAt(j) != ' ') + break; + if (j < size && line.charAt(j) == '\t') { + deleteRange.start.column = j; + deleteRange.end.column = j + 1; + } else { + deleteRange.start.column = 0; + deleteRange.end.column = j; + } + this.remove(deleteRange); + } + }; + + this.$moveLines = function(firstRow, lastRow, dir) { + firstRow = this.getRowFoldStart(firstRow); + lastRow = this.getRowFoldEnd(lastRow); + if (dir < 0) { + var row = this.getRowFoldStart(firstRow + dir); + if (row < 0) return 0; + var diff = row-firstRow; + } else if (dir > 0) { + var row = this.getRowFoldEnd(lastRow + dir); + if (row > this.doc.getLength()-1) return 0; + var diff = row-lastRow; + } else { + firstRow = this.$clipRowToDocument(firstRow); + lastRow = this.$clipRowToDocument(lastRow); + var diff = lastRow - firstRow + 1; + } + + var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE); + var folds = this.getFoldsInRange(range).map(function(x){ + x = x.clone(); + x.start.row += diff; + x.end.row += diff; + return x; + }); + + var lines = dir == 0 + ? this.doc.getLines(firstRow, lastRow) + : this.doc.removeLines(firstRow, lastRow); + this.doc.insertLines(firstRow+diff, lines); + folds.length && this.addFolds(folds); + return diff; + }; + this.moveLinesUp = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, -1); + }; + this.moveLinesDown = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, 1); + }; + this.duplicateLines = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, 0); + }; + + + this.$clipRowToDocument = function(row) { + return Math.max(0, Math.min(row, this.doc.getLength()-1)); + }; + + this.$clipColumnToRow = function(row, column) { + if (column < 0) + return 0; + return Math.min(this.doc.getLine(row).length, column); + }; + + + this.$clipPositionToDocument = function(row, column) { + column = Math.max(0, column); + + if (row < 0) { + row = 0; + column = 0; + } else { + var len = this.doc.getLength(); + if (row >= len) { + row = len - 1; + column = this.doc.getLine(len-1).length; + } else { + column = Math.min(this.doc.getLine(row).length, column); + } + } + + return { + row: row, + column: column + }; + }; + + this.$clipRangeToDocument = function(range) { + if (range.start.row < 0) { + range.start.row = 0; + range.start.column = 0; + } else { + range.start.column = this.$clipColumnToRow( + range.start.row, + range.start.column + ); + } + + var len = this.doc.getLength() - 1; + if (range.end.row > len) { + range.end.row = len; + range.end.column = this.doc.getLine(len).length; + } else { + range.end.column = this.$clipColumnToRow( + range.end.row, + range.end.column + ); + } + return range; + }; + this.$wrapLimit = 80; + this.$useWrapMode = false; + this.$wrapLimitRange = { + min : null, + max : null + }; + this.setUseWrapMode = function(useWrapMode) { + if (useWrapMode != this.$useWrapMode) { + this.$useWrapMode = useWrapMode; + this.$modified = true; + this.$resetRowCache(0); + if (useWrapMode) { + var len = this.getLength(); + this.$wrapData = []; + for (var i = 0; i < len; i++) { + this.$wrapData.push([]); + } + this.$updateWrapData(0, len - 1); + } + + this._emit("changeWrapMode"); + } + }; + this.getUseWrapMode = function() { + return this.$useWrapMode; + }; + this.setWrapLimitRange = function(min, max) { + if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { + this.$wrapLimitRange = { + min: min, + max: max + }; + this.$modified = true; + this._emit("changeWrapMode"); + } + }; + this.adjustWrapLimit = function(desiredLimit, $printMargin) { + var limits = this.$wrapLimitRange + if (limits.max < 0) + limits = {min: $printMargin, max: $printMargin}; + var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max); + if (wrapLimit != this.$wrapLimit && wrapLimit > 1) { + this.$wrapLimit = wrapLimit; + this.$modified = true; + if (this.$useWrapMode) { + this.$updateWrapData(0, this.getLength() - 1); + this.$resetRowCache(0); + this._emit("changeWrapLimit"); + } + return true; + } + return false; + }; + + this.$constrainWrapLimit = function(wrapLimit, min, max) { + if (min) + wrapLimit = Math.max(min, wrapLimit); + + if (max) + wrapLimit = Math.min(max, wrapLimit); + + return wrapLimit; + }; + this.getWrapLimit = function() { + return this.$wrapLimit; + }; + this.setWrapLimit = function (limit) { + this.setWrapLimitRange(limit, limit); + }; + this.getWrapLimitRange = function() { + return { + min : this.$wrapLimitRange.min, + max : this.$wrapLimitRange.max + }; + }; + + this.$updateInternalDataOnChange = function(e) { + var useWrapMode = this.$useWrapMode; + var len; + var action = e.data.action; + var firstRow = e.data.range.start.row; + var lastRow = e.data.range.end.row; + var start = e.data.range.start; + var end = e.data.range.end; + var removedFolds = null; + + if (action.indexOf("Lines") != -1) { + if (action == "insertLines") { + lastRow = firstRow + (e.data.lines.length); + } else { + lastRow = firstRow; + } + len = e.data.lines ? e.data.lines.length : lastRow - firstRow; + } else { + len = lastRow - firstRow; + } + + this.$updating = true; + if (len != 0) { + if (action.indexOf("remove") != -1) { + this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len); + + var foldLines = this.$foldData; + removedFolds = this.getFoldsInRange(e.data.range); + this.removeFolds(removedFolds); + + var foldLine = this.getFoldLine(end.row); + var idx = 0; + if (foldLine) { + foldLine.addRemoveChars(end.row, end.column, start.column - end.column); + foldLine.shiftRow(-len); + + var foldLineBefore = this.getFoldLine(firstRow); + if (foldLineBefore && foldLineBefore !== foldLine) { + foldLineBefore.merge(foldLine); + foldLine = foldLineBefore; + } + idx = foldLines.indexOf(foldLine) + 1; + } + + for (idx; idx < foldLines.length; idx++) { + var foldLine = foldLines[idx]; + if (foldLine.start.row >= end.row) { + foldLine.shiftRow(-len); + } + } + + lastRow = firstRow; + } else { + var args; + if (useWrapMode) { + args = [firstRow, 0]; + for (var i = 0; i < len; i++) args.push([]); + this.$wrapData.splice.apply(this.$wrapData, args); + } else { + args = Array(len); + args.unshift(firstRow, 0); + this.$rowLengthCache.splice.apply(this.$rowLengthCache, args); + } + var foldLines = this.$foldData; + var foldLine = this.getFoldLine(firstRow); + var idx = 0; + if (foldLine) { + var cmp = foldLine.range.compareInside(start.row, start.column) + if (cmp == 0) { + foldLine = foldLine.split(start.row, start.column); + foldLine.shiftRow(len); + foldLine.addRemoveChars( + lastRow, 0, end.column - start.column); + } else + if (cmp == -1) { + foldLine.addRemoveChars(firstRow, 0, end.column - start.column); + foldLine.shiftRow(len); + } + idx = foldLines.indexOf(foldLine) + 1; + } + + for (idx; idx < foldLines.length; idx++) { + var foldLine = foldLines[idx]; + if (foldLine.start.row >= firstRow) { + foldLine.shiftRow(len); + } + } + } + } else { + len = Math.abs(e.data.range.start.column - e.data.range.end.column); + if (action.indexOf("remove") != -1) { + removedFolds = this.getFoldsInRange(e.data.range); + this.removeFolds(removedFolds); + + len = -len; + } + var foldLine = this.getFoldLine(firstRow); + if (foldLine) { + foldLine.addRemoveChars(firstRow, start.column, len); + } + } + + if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { + console.error("doc.getLength() and $wrapData.length have to be the same!"); + } + this.$updating = false; + + if (useWrapMode) + this.$updateWrapData(firstRow, lastRow); + else + this.$updateRowLengthCache(firstRow, lastRow); + + return removedFolds; + }; + + this.$updateRowLengthCache = function(firstRow, lastRow, b) { + this.$rowLengthCache[firstRow] = null; + this.$rowLengthCache[lastRow] = null; + }; + + this.$updateWrapData = function(firstRow, lastRow) { + var lines = this.doc.getAllLines(); + var tabSize = this.getTabSize(); + var wrapData = this.$wrapData; + var wrapLimit = this.$wrapLimit; + var tokens; + var foldLine; + + var row = firstRow; + lastRow = Math.min(lastRow, lines.length - 1); + while (row <= lastRow) { + foldLine = this.getFoldLine(row, foldLine); + if (!foldLine) { + tokens = this.$getDisplayTokens(lines[row]); + wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); + row ++; + } else { + tokens = []; + foldLine.walk(function(placeholder, row, column, lastColumn) { + var walkTokens; + if (placeholder != null) { + walkTokens = this.$getDisplayTokens( + placeholder, tokens.length); + walkTokens[0] = PLACEHOLDER_START; + for (var i = 1; i < walkTokens.length; i++) { + walkTokens[i] = PLACEHOLDER_BODY; + } + } else { + walkTokens = this.$getDisplayTokens( + lines[row].substring(lastColumn, column), + tokens.length); + } + tokens = tokens.concat(walkTokens); + }.bind(this), + foldLine.end.row, + lines[foldLine.end.row].length + 1 + ); + + wrapData[foldLine.start.row] + = this.$computeWrapSplits(tokens, wrapLimit, tabSize); + row = foldLine.end.row + 1; + } + } + }; + var CHAR = 1, + CHAR_EXT = 2, + PLACEHOLDER_START = 3, + PLACEHOLDER_BODY = 4, + PUNCTUATION = 9, + SPACE = 10, + TAB = 11, + TAB_SPACE = 12; + + + this.$computeWrapSplits = function(tokens, wrapLimit) { + if (tokens.length == 0) { + return []; + } + + var splits = []; + var displayLength = tokens.length; + var lastSplit = 0, lastDocSplit = 0; + + var isCode = this.$wrapAsCode; + + function addSplit(screenPos) { + var displayed = tokens.slice(lastSplit, screenPos); + var len = displayed.length; + displayed.join(""). + replace(/12/g, function() { + len -= 1; + }). + replace(/2/g, function() { + len -= 1; + }); + + lastDocSplit += len; + splits.push(lastDocSplit); + lastSplit = screenPos; + } + + while (displayLength - lastSplit > wrapLimit) { + var split = lastSplit + wrapLimit; + if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) { + addSplit(split); + continue; + } + if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) { + for (split; split != lastSplit - 1; split--) { + if (tokens[split] == PLACEHOLDER_START) { + break; + } + } + if (split > lastSplit) { + addSplit(split); + continue; + } + split = lastSplit + wrapLimit; + for (split; split < tokens.length; split++) { + if (tokens[split] != PLACEHOLDER_BODY) { + break; + } + } + if (split == tokens.length) { + break; // Breaks the while-loop. + } + addSplit(split); + continue; + } + var minSplit = Math.max(split - (isCode ? 10 : wrapLimit-(wrapLimit>>2)), lastSplit - 1); + while (split > minSplit && tokens[split] < PLACEHOLDER_START) { + split --; + } + if (isCode) { + while (split > minSplit && tokens[split] < PLACEHOLDER_START) { + split --; + } + while (split > minSplit && tokens[split] == PUNCTUATION) { + split --; + } + } else { + while (split > minSplit && tokens[split] < SPACE) { + split --; + } + } + if (split > minSplit) { + addSplit(++split); + continue; + } + split = lastSplit + wrapLimit; + addSplit(split); + } + return splits; + }; + this.$getDisplayTokens = function(str, offset) { + var arr = []; + var tabSize; + offset = offset || 0; + + for (var i = 0; i < str.length; i++) { + var c = str.charCodeAt(i); + if (c == 9) { + tabSize = this.getScreenTabSize(arr.length + offset); + arr.push(TAB); + for (var n = 1; n < tabSize; n++) { + arr.push(TAB_SPACE); + } + } + else if (c == 32) { + arr.push(SPACE); + } else if((c > 39 && c < 48) || (c > 57 && c < 64)) { + arr.push(PUNCTUATION); + } + else if (c >= 0x1100 && isFullWidth(c)) { + arr.push(CHAR, CHAR_EXT); + } else { + arr.push(CHAR); + } + } + return arr; + }; + this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { + if (maxScreenColumn == 0) + return [0, 0]; + if (maxScreenColumn == null) + maxScreenColumn = Infinity; + screenColumn = screenColumn || 0; + + var c, column; + for (column = 0; column < str.length; column++) { + c = str.charCodeAt(column); + if (c == 9) { + screenColumn += this.getScreenTabSize(screenColumn); + } + else if (c >= 0x1100 && isFullWidth(c)) { + screenColumn += 2; + } else { + screenColumn += 1; + } + if (screenColumn > maxScreenColumn) { + break; + } + } + + return [screenColumn, column]; + }; + + this.lineWidgets = null; + this.getRowLength = function(row) { + if (this.lineWidgets) + var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0 + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1 + h; + } else { + return this.$wrapData[row].length + 1 + h; + } + }; + this.getRowLineCount = function(row) { + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1; + } else { + return this.$wrapData[row].length + 1; + } + }; + this.getScreenLastRowColumn = function(screenRow) { + var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); + return this.documentToScreenColumn(pos.row, pos.column); + }; + this.getDocumentLastRowColumn = function(docRow, docColumn) { + var screenRow = this.documentToScreenRow(docRow, docColumn); + return this.getScreenLastRowColumn(screenRow); + }; + this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { + var screenRow = this.documentToScreenRow(docRow, docColumn); + return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); + }; + this.getRowSplitData = function(row) { + if (!this.$useWrapMode) { + return undefined; + } else { + return this.$wrapData[row]; + } + }; + this.getScreenTabSize = function(screenColumn) { + return this.$tabSize - screenColumn % this.$tabSize; + }; + + + this.screenToDocumentRow = function(screenRow, screenColumn) { + return this.screenToDocumentPosition(screenRow, screenColumn).row; + }; + + + this.screenToDocumentColumn = function(screenRow, screenColumn) { + return this.screenToDocumentPosition(screenRow, screenColumn).column; + }; + this.screenToDocumentPosition = function(screenRow, screenColumn) { + if (screenRow < 0) + return {row: 0, column: 0}; + + var line; + var docRow = 0; + var docColumn = 0; + var column; + var row = 0; + var rowLength = 0; + + var rowCache = this.$screenRowCache; + var i = this.$getRowCacheIndex(rowCache, screenRow); + var l = rowCache.length; + if (l && i >= 0) { + var row = rowCache[i]; + var docRow = this.$docRowCache[i]; + var doCache = screenRow > rowCache[l - 1]; + } else { + var doCache = !l; + } + + var maxRow = this.getLength() - 1; + var foldLine = this.getNextFoldLine(docRow); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (row <= screenRow) { + rowLength = this.getRowLength(docRow); + if (row + rowLength > screenRow || docRow >= maxRow) { + break; + } else { + row += rowLength; + docRow++; + if (docRow > foldStart) { + docRow = foldLine.end.row+1; + foldLine = this.getNextFoldLine(docRow, foldLine); + foldStart = foldLine ? foldLine.start.row : Infinity; + } + } + + if (doCache) { + this.$docRowCache.push(docRow); + this.$screenRowCache.push(row); + } + } + + if (foldLine && foldLine.start.row <= docRow) { + line = this.getFoldDisplayLine(foldLine); + docRow = foldLine.start.row; + } else if (row + rowLength <= screenRow || docRow > maxRow) { + return { + row: maxRow, + column: this.getLine(maxRow).length + } + } else { + line = this.getLine(docRow); + foldLine = null; + } + + if (this.$useWrapMode) { + var splits = this.$wrapData[docRow]; + if (splits) { + var splitIndex = Math.floor(screenRow - row); + column = splits[splitIndex]; + if(splitIndex > 0 && splits.length) { + docColumn = splits[splitIndex - 1] || splits[splits.length - 1]; + line = line.substring(docColumn); + } + } + } + + docColumn += this.$getStringScreenWidth(line, screenColumn)[1]; + if (this.$useWrapMode && docColumn >= column) + docColumn = column - 1; + + if (foldLine) + return foldLine.idxToPosition(docColumn); + + return {row: docRow, column: docColumn}; + }; + this.documentToScreenPosition = function(docRow, docColumn) { + if (typeof docColumn === "undefined") + var pos = this.$clipPositionToDocument(docRow.row, docRow.column); + else + pos = this.$clipPositionToDocument(docRow, docColumn); + + docRow = pos.row; + docColumn = pos.column; + + var screenRow = 0; + var foldStartRow = null; + var fold = null; + fold = this.getFoldAt(docRow, docColumn, 1); + if (fold) { + docRow = fold.start.row; + docColumn = fold.start.column; + } + + var rowEnd, row = 0; + + + var rowCache = this.$docRowCache; + var i = this.$getRowCacheIndex(rowCache, docRow); + var l = rowCache.length; + if (l && i >= 0) { + var row = rowCache[i]; + var screenRow = this.$screenRowCache[i]; + var doCache = docRow > rowCache[l - 1]; + } else { + var doCache = !l; + } + + var foldLine = this.getNextFoldLine(row); + var foldStart = foldLine ?foldLine.start.row :Infinity; + + while (row < docRow) { + if (row >= foldStart) { + rowEnd = foldLine.end.row + 1; + if (rowEnd > docRow) + break; + foldLine = this.getNextFoldLine(rowEnd, foldLine); + foldStart = foldLine ?foldLine.start.row :Infinity; + } + else { + rowEnd = row + 1; + } + + screenRow += this.getRowLength(row); + row = rowEnd; + + if (doCache) { + this.$docRowCache.push(row); + this.$screenRowCache.push(screenRow); + } + } + var textLine = ""; + if (foldLine && row >= foldStart) { + textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn); + foldStartRow = foldLine.start.row; + } else { + textLine = this.getLine(docRow).substring(0, docColumn); + foldStartRow = docRow; + } + if (this.$useWrapMode) { + var wrapRow = this.$wrapData[foldStartRow]; + var screenRowOffset = 0; + while (textLine.length >= wrapRow[screenRowOffset]) { + screenRow ++; + screenRowOffset++; + } + textLine = textLine.substring( + wrapRow[screenRowOffset - 1] || 0, textLine.length + ); + } + + return { + row: screenRow, + column: this.$getStringScreenWidth(textLine)[0] + }; + }; + this.documentToScreenColumn = function(row, docColumn) { + return this.documentToScreenPosition(row, docColumn).column; + }; + this.documentToScreenRow = function(docRow, docColumn) { + return this.documentToScreenPosition(docRow, docColumn).row; + }; + this.getScreenLength = function() { + var screenRows = 0; + var fold = null; + if (!this.$useWrapMode) { + screenRows = this.getLength(); + var foldData = this.$foldData; + for (var i = 0; i < foldData.length; i++) { + fold = foldData[i]; + screenRows -= fold.end.row - fold.start.row; + } + } else { + var lastRow = this.$wrapData.length; + var row = 0, i = 0; + var fold = this.$foldData[i++]; + var foldStart = fold ? fold.start.row :Infinity; + + while (row < lastRow) { + screenRows += this.$wrapData[row].length + 1; + row ++; + if (row > foldStart) { + row = fold.end.row+1; + fold = this.$foldData[i++]; + foldStart = fold ?fold.start.row :Infinity; + } + } + } + if (this.lineWidgets) + screenRows += this.$getWidgetScreenLength(); + + return screenRows; + }; + function isFullWidth(c) { + if (c < 0x1100) + return false; + return c >= 0x1100 && c <= 0x115F || + c >= 0x11A3 && c <= 0x11A7 || + c >= 0x11FA && c <= 0x11FF || + c >= 0x2329 && c <= 0x232A || + c >= 0x2E80 && c <= 0x2E99 || + c >= 0x2E9B && c <= 0x2EF3 || + c >= 0x2F00 && c <= 0x2FD5 || + c >= 0x2FF0 && c <= 0x2FFB || + c >= 0x3000 && c <= 0x303E || + c >= 0x3041 && c <= 0x3096 || + c >= 0x3099 && c <= 0x30FF || + c >= 0x3105 && c <= 0x312D || + c >= 0x3131 && c <= 0x318E || + c >= 0x3190 && c <= 0x31BA || + c >= 0x31C0 && c <= 0x31E3 || + c >= 0x31F0 && c <= 0x321E || + c >= 0x3220 && c <= 0x3247 || + c >= 0x3250 && c <= 0x32FE || + c >= 0x3300 && c <= 0x4DBF || + c >= 0x4E00 && c <= 0xA48C || + c >= 0xA490 && c <= 0xA4C6 || + c >= 0xA960 && c <= 0xA97C || + c >= 0xAC00 && c <= 0xD7A3 || + c >= 0xD7B0 && c <= 0xD7C6 || + c >= 0xD7CB && c <= 0xD7FB || + c >= 0xF900 && c <= 0xFAFF || + c >= 0xFE10 && c <= 0xFE19 || + c >= 0xFE30 && c <= 0xFE52 || + c >= 0xFE54 && c <= 0xFE66 || + c >= 0xFE68 && c <= 0xFE6B || + c >= 0xFF01 && c <= 0xFF60 || + c >= 0xFFE0 && c <= 0xFFE6; + }; + +}).call(EditSession.prototype); + +require("./edit_session/folding").Folding.call(EditSession.prototype); +require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); + + +config.defineOptions(EditSession.prototype, "session", { + wrap: { + set: function(value) { + if (!value || value == "off") + value = false; + else if (value == "free") + value = true; + else if (value == "printMargin") + value = -1; + else if (typeof value == "string") + value = parseInt(value, 10) || false; + + if (this.$wrap == value) + return; + if (!value) { + this.setUseWrapMode(false); + } else { + var col = typeof value == "number" ? value : null; + this.setWrapLimitRange(col, col); + this.setUseWrapMode(true); + } + this.$wrap = value; + }, + get: function() { + if (this.getUseWrapMode()) { + if (this.$wrap == -1) + return "printMargin"; + if (!this.getWrapLimitRange().min) + return "free"; + return this.$wrap; + } + return "off"; + }, + handlesSet: true + }, + wrapMethod: { + set: function(val) { + val = val == "auto" + ? this.$mode.type != "text" + : val != "text"; + if (val != this.$wrapAsCode) { + this.$wrapAsCode = val; + if (this.$useWrapMode) { + this.$modified = true; + this.$resetRowCache(0); + this.$updateWrapData(0, this.getLength() - 1); + } + } + }, + initialValue: "auto" + }, + firstLineNumber: { + set: function() {this._emit("changeBreakpoint");}, + initialValue: 1 + }, + useWorker: { + set: function(useWorker) { + this.$useWorker = useWorker; + + this.$stopWorker(); + if (useWorker) + this.$startWorker(); + }, + initialValue: true + }, + useSoftTabs: {initialValue: true}, + tabSize: { + set: function(tabSize) { + if (isNaN(tabSize) || this.$tabSize === tabSize) return; + + this.$modified = true; + this.$rowLengthCache = []; + this.$tabSize = tabSize; + this._emit("changeTabSize"); + }, + initialValue: 4, + handlesSet: true + }, + overwrite: { + set: function(val) {this._emit("changeOverwrite");}, + initialValue: false + }, + newLineMode: { + set: function(val) {this.doc.setNewLineMode(val)}, + get: function() {return this.doc.getNewLineMode()}, + handlesSet: true + }, + mode: { + set: function(val) { this.setMode(val) }, + get: function() { return this.$modeId } + } +}); + +exports.EditSession = EditSession; +}); + +ace.define('ace/selection', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/lib/event_emitter', 'ace/range'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var lang = require("./lib/lang"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Range = require("./range").Range; +var Selection = function(session) { + this.session = session; + this.doc = session.getDocument(); + + this.clearSelection(); + this.lead = this.selectionLead = this.doc.createAnchor(0, 0); + this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0); + + var self = this; + this.lead.on("change", function(e) { + self._emit("changeCursor"); + if (!self.$isEmpty) + self._emit("changeSelection"); + if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column) + self.$desiredColumn = null; + }); + + this.selectionAnchor.on("change", function() { + if (!self.$isEmpty) + self._emit("changeSelection"); + }); +}; + +(function() { + + oop.implement(this, EventEmitter); + this.isEmpty = function() { + return (this.$isEmpty || ( + this.anchor.row == this.lead.row && + this.anchor.column == this.lead.column + )); + }; + this.isMultiLine = function() { + if (this.isEmpty()) { + return false; + } + + return this.getRange().isMultiLine(); + }; + this.getCursor = function() { + return this.lead.getPosition(); + }; + this.setSelectionAnchor = function(row, column) { + this.anchor.setPosition(row, column); + + if (this.$isEmpty) { + this.$isEmpty = false; + this._emit("changeSelection"); + } + }; + this.getSelectionAnchor = function() { + if (this.$isEmpty) + return this.getSelectionLead() + else + return this.anchor.getPosition(); + }; + this.getSelectionLead = function() { + return this.lead.getPosition(); + }; + this.shiftSelection = function(columns) { + if (this.$isEmpty) { + this.moveCursorTo(this.lead.row, this.lead.column + columns); + return; + }; + + var anchor = this.getSelectionAnchor(); + var lead = this.getSelectionLead(); + + var isBackwards = this.isBackwards(); + + if (!isBackwards || anchor.column !== 0) + this.setSelectionAnchor(anchor.row, anchor.column + columns); + + if (isBackwards || lead.column !== 0) { + this.$moveSelection(function() { + this.moveCursorTo(lead.row, lead.column + columns); + }); + } + }; + this.isBackwards = function() { + var anchor = this.anchor; + var lead = this.lead; + return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column)); + }; + this.getRange = function() { + var anchor = this.anchor; + var lead = this.lead; + + if (this.isEmpty()) + return Range.fromPoints(lead, lead); + + if (this.isBackwards()) { + return Range.fromPoints(lead, anchor); + } + else { + return Range.fromPoints(anchor, lead); + } + }; + this.clearSelection = function() { + if (!this.$isEmpty) { + this.$isEmpty = true; + this._emit("changeSelection"); + } + }; + this.selectAll = function() { + var lastRow = this.doc.getLength() - 1; + this.setSelectionAnchor(0, 0); + this.moveCursorTo(lastRow, this.doc.getLine(lastRow).length); + }; + this.setRange = + this.setSelectionRange = function(range, reverse) { + if (reverse) { + this.setSelectionAnchor(range.end.row, range.end.column); + this.selectTo(range.start.row, range.start.column); + } else { + this.setSelectionAnchor(range.start.row, range.start.column); + this.selectTo(range.end.row, range.end.column); + } + if (this.getRange().isEmpty()) + this.$isEmpty = true; + this.$desiredColumn = null; + }; + + this.$moveSelection = function(mover) { + var lead = this.lead; + if (this.$isEmpty) + this.setSelectionAnchor(lead.row, lead.column); + + mover.call(this); + }; + this.selectTo = function(row, column) { + this.$moveSelection(function() { + this.moveCursorTo(row, column); + }); + }; + this.selectToPosition = function(pos) { + this.$moveSelection(function() { + this.moveCursorToPosition(pos); + }); + }; + this.selectUp = function() { + this.$moveSelection(this.moveCursorUp); + }; + this.selectDown = function() { + this.$moveSelection(this.moveCursorDown); + }; + this.selectRight = function() { + this.$moveSelection(this.moveCursorRight); + }; + this.selectLeft = function() { + this.$moveSelection(this.moveCursorLeft); + }; + this.selectLineStart = function() { + this.$moveSelection(this.moveCursorLineStart); + }; + this.selectLineEnd = function() { + this.$moveSelection(this.moveCursorLineEnd); + }; + this.selectFileEnd = function() { + this.$moveSelection(this.moveCursorFileEnd); + }; + this.selectFileStart = function() { + this.$moveSelection(this.moveCursorFileStart); + }; + this.selectWordRight = function() { + this.$moveSelection(this.moveCursorWordRight); + }; + this.selectWordLeft = function() { + this.$moveSelection(this.moveCursorWordLeft); + }; + this.getWordRange = function(row, column) { + if (typeof column == "undefined") { + var cursor = row || this.lead; + row = cursor.row; + column = cursor.column; + } + return this.session.getWordRange(row, column); + }; + this.selectWord = function() { + this.setSelectionRange(this.getWordRange()); + }; + this.selectAWord = function() { + var cursor = this.getCursor(); + var range = this.session.getAWordRange(cursor.row, cursor.column); + this.setSelectionRange(range); + }; + + this.getLineRange = function(row, excludeLastChar) { + var rowStart = typeof row == "number" ? row : this.lead.row; + var rowEnd; + + var foldLine = this.session.getFoldLine(rowStart); + if (foldLine) { + rowStart = foldLine.start.row; + rowEnd = foldLine.end.row; + } else { + rowEnd = rowStart; + } + if (excludeLastChar === true) + return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); + else + return new Range(rowStart, 0, rowEnd + 1, 0); + }; + this.selectLine = function() { + this.setSelectionRange(this.getLineRange()); + }; + this.moveCursorUp = function() { + this.moveCursorBy(-1, 0); + }; + this.moveCursorDown = function() { + this.moveCursorBy(1, 0); + }; + this.moveCursorLeft = function() { + var cursor = this.lead.getPosition(), + fold; + + if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) { + this.moveCursorTo(fold.start.row, fold.start.column); + } else if (cursor.column == 0) { + if (cursor.row > 0) { + this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length); + } + } + else { + var tabSize = this.session.getTabSize(); + if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize) + this.moveCursorBy(0, -tabSize); + else + this.moveCursorBy(0, -1); + } + }; + this.moveCursorRight = function() { + var cursor = this.lead.getPosition(), + fold; + if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) { + this.moveCursorTo(fold.end.row, fold.end.column); + } + else if (this.lead.column == this.doc.getLine(this.lead.row).length) { + if (this.lead.row < this.doc.getLength() - 1) { + this.moveCursorTo(this.lead.row + 1, 0); + } + } + else { + var tabSize = this.session.getTabSize(); + var cursor = this.lead; + if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize) + this.moveCursorBy(0, tabSize); + else + this.moveCursorBy(0, 1); + } + }; + this.moveCursorLineStart = function() { + var row = this.lead.row; + var column = this.lead.column; + var screenRow = this.session.documentToScreenRow(row, column); + var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0); + var beforeCursor = this.session.getDisplayLine( + row, null, firstColumnPosition.row, + firstColumnPosition.column + ); + + var leadingSpace = beforeCursor.match(/^\s*/); + if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart) + firstColumnPosition.column += leadingSpace[0].length; + this.moveCursorToPosition(firstColumnPosition); + }; + this.moveCursorLineEnd = function() { + var lead = this.lead; + var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column); + if (this.lead.column == lineEnd.column) { + var line = this.session.getLine(lineEnd.row); + if (lineEnd.column == line.length) { + var textEnd = line.search(/\s+$/); + if (textEnd > 0) + lineEnd.column = textEnd; + } + } + + this.moveCursorTo(lineEnd.row, lineEnd.column); + }; + this.moveCursorFileEnd = function() { + var row = this.doc.getLength() - 1; + var column = this.doc.getLine(row).length; + this.moveCursorTo(row, column); + }; + this.moveCursorFileStart = function() { + this.moveCursorTo(0, 0); + }; + this.moveCursorLongWordRight = function() { + var row = this.lead.row; + var column = this.lead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var match; + this.session.nonTokenRe.lastIndex = 0; + this.session.tokenRe.lastIndex = 0; + var fold = this.session.getFoldAt(row, column, 1); + if (fold) { + this.moveCursorTo(fold.end.row, fold.end.column); + return; + } + if (match = this.session.nonTokenRe.exec(rightOfCursor)) { + column += this.session.nonTokenRe.lastIndex; + this.session.nonTokenRe.lastIndex = 0; + rightOfCursor = line.substring(column); + } + if (column >= line.length) { + this.moveCursorTo(row, line.length); + this.moveCursorRight(); + if (row < this.doc.getLength() - 1) + this.moveCursorWordRight(); + return; + } + if (match = this.session.tokenRe.exec(rightOfCursor)) { + column += this.session.tokenRe.lastIndex; + this.session.tokenRe.lastIndex = 0; + } + + this.moveCursorTo(row, column); + }; + this.moveCursorLongWordLeft = function() { + var row = this.lead.row; + var column = this.lead.column; + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) { + this.moveCursorTo(fold.start.row, fold.start.column); + return; + } + + var str = this.session.getFoldStringAt(row, column, -1); + if (str == null) { + str = this.doc.getLine(row).substring(0, column) + } + + var leftOfCursor = lang.stringReverse(str); + var match; + this.session.nonTokenRe.lastIndex = 0; + this.session.tokenRe.lastIndex = 0; + if (match = this.session.nonTokenRe.exec(leftOfCursor)) { + column -= this.session.nonTokenRe.lastIndex; + leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex); + this.session.nonTokenRe.lastIndex = 0; + } + if (column <= 0) { + this.moveCursorTo(row, 0); + this.moveCursorLeft(); + if (row > 0) + this.moveCursorWordLeft(); + return; + } + if (match = this.session.tokenRe.exec(leftOfCursor)) { + column -= this.session.tokenRe.lastIndex; + this.session.tokenRe.lastIndex = 0; + } + + this.moveCursorTo(row, column); + }; + + this.$shortWordEndIndex = function(rightOfCursor) { + var match, index = 0, ch; + var whitespaceRe = /\s/; + var tokenRe = this.session.tokenRe; + + tokenRe.lastIndex = 0; + if (match = this.session.tokenRe.exec(rightOfCursor)) { + index = this.session.tokenRe.lastIndex; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + + if (index < 1) { + tokenRe.lastIndex = 0; + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + tokenRe.lastIndex = 0; + index ++; + if (whitespaceRe.test(ch)) { + if (index > 2) { + index-- + break; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + if (index > 2) + break + } + } + } + } + } + tokenRe.lastIndex = 0; + + return index; + }; + + this.moveCursorShortWordRight = function() { + var row = this.lead.row; + var column = this.lead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var fold = this.session.getFoldAt(row, column, 1); + if (fold) + return this.moveCursorTo(fold.end.row, fold.end.column); + + if (column == line.length) { + var l = this.doc.getLength(); + do { + row++; + rightOfCursor = this.doc.getLine(row) + } while (row < l && /^\s*$/.test(rightOfCursor)) + + if (!/^\s+/.test(rightOfCursor)) + rightOfCursor = "" + column = 0; + } + + var index = this.$shortWordEndIndex(rightOfCursor); + + this.moveCursorTo(row, column + index); + }; + + this.moveCursorShortWordLeft = function() { + var row = this.lead.row; + var column = this.lead.column; + + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) + return this.moveCursorTo(fold.start.row, fold.start.column); + + var line = this.session.getLine(row).substring(0, column); + if (column == 0) { + do { + row--; + line = this.doc.getLine(row); + } while (row > 0 && /^\s*$/.test(line)) + + column = line.length; + if (!/\s+$/.test(line)) + line = "" + } + + var leftOfCursor = lang.stringReverse(line); + var index = this.$shortWordEndIndex(leftOfCursor); + + return this.moveCursorTo(row, column - index); + }; + + this.moveCursorWordRight = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordRight(); + else + this.moveCursorShortWordRight(); + }; + + this.moveCursorWordLeft = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordLeft(); + else + this.moveCursorShortWordLeft(); + }; + this.moveCursorBy = function(rows, chars) { + var screenPos = this.session.documentToScreenPosition( + this.lead.row, + this.lead.column + ); + + if (chars === 0) { + if (this.$desiredColumn) + screenPos.column = this.$desiredColumn; + else + this.$desiredColumn = screenPos.column; + } + + var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column); + + if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) { + if (this.session.lineWidgets && this.session.lineWidgets[docPos.row]) + docPos.row++; + } + this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0); + }; + this.moveCursorToPosition = function(position) { + this.moveCursorTo(position.row, position.column); + }; + this.moveCursorTo = function(row, column, keepDesiredColumn) { + var fold = this.session.getFoldAt(row, column, 1); + if (fold) { + row = fold.start.row; + column = fold.start.column; + } + + this.$keepDesiredColumnOnChange = true; + this.lead.setPosition(row, column); + this.$keepDesiredColumnOnChange = false; + + if (!keepDesiredColumn) + this.$desiredColumn = null; + }; + this.moveCursorToScreen = function(row, column, keepDesiredColumn) { + var pos = this.session.screenToDocumentPosition(row, column); + this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); + }; + this.detach = function() { + this.lead.detach(); + this.anchor.detach(); + this.session = this.doc = null; + } + + this.fromOrientedRange = function(range) { + this.setSelectionRange(range, range.cursor == range.start); + this.$desiredColumn = range.desiredColumn || this.$desiredColumn; + } + + this.toOrientedRange = function(range) { + var r = this.getRange(); + if (range) { + range.start.column = r.start.column; + range.start.row = r.start.row; + range.end.column = r.end.column; + range.end.row = r.end.row; + } else { + range = r; + } + + range.cursor = this.isBackwards() ? range.start : range.end; + range.desiredColumn = this.$desiredColumn; + return range; + } + + this.toJSON = function() { + if (this.rangeCount) { + var data = this.ranges.map(function(r) { + var r1 = r.clone(); + r1.isBackwards = r.cursor == r.start; + return r1; + }); + } else { + var data = this.getRange(); + data.isBackwards = this.isBackwards(); + } + return data; + }; + + this.fromJSON = function(data) { + if (data.start == undefined) { + if (this.rangeList) { + this.toSingleRange(data[0]); + for (var i = data.length; i--; ) { + var r = Range.fromPoints(data[i].start, data[i].end); + if (data.isBackwards) + r.cursor = r.start; + this.addRange(r, true); + } + return; + } else + data = data[0]; + } + if (this.rangeList) + this.toSingleRange(data); + this.setSelectionRange(data, data.isBackwards); + }; + + this.isEqual = function(data) { + if ((data.length || this.rangeCount) && data.length != this.rangeCount) + return false; + if (!data.length || !this.ranges) + return this.getRange().isEqual(data); + + for (var i = this.ranges.length; i--; ) { + if (!this.ranges[i].isEqual(data[i])) + return false + } + return true; + } + +}).call(Selection.prototype); + +exports.Selection = Selection; +}); + +ace.define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) { + +var comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; +}; +var Range = function(startRow, startColumn, endRow, endColumn) { + this.start = { + row: startRow, + column: startColumn + }; + + this.end = { + row: endRow, + column: endColumn + }; +}; + +(function() { + this.isEqual = function(range) { + return this.start.row === range.start.row && + this.end.row === range.end.row && + this.start.column === range.start.column && + this.end.column === range.end.column; + }; + this.toString = function() { + return ("Range: [" + this.start.row + "/" + this.start.column + + "] -> [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function(row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function(range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function(p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function(range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function(range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function(row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function(row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function(row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function(row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function(row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + }; + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function(row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function(firstRow, lastRow) { + if (this.end.row > lastRow) + var end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + var end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + var start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + var start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function(row, column) { + var cmp = this.compare(row, column); + + if (cmp == 0) + return this; + else if (cmp == -1) + var start = {row: row, column: column}; + else + var end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function() { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function() { + return (this.start.row !== this.end.row); + }; + this.clone = function() { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function() { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function(session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function(row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + +}).call(Range.prototype); +Range.fromPoints = function(start, end) { + return new Range(start.row, start.column, end.row, end.column); +}; +Range.comparePoints = comparePoints; + +Range.comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; +}; + + +exports.Range = Range; +}); + +ace.define('ace/mode/text', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/behaviour', 'ace/unicode', 'ace/lib/lang', 'ace/token_iterator', 'ace/range'], function(require, exports, module) { + + +var Tokenizer = require("../tokenizer").Tokenizer; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var Behaviour = require("./behaviour").Behaviour; +var unicode = require("../unicode"); +var lang = require("../lib/lang"); +var TokenIterator = require("../token_iterator").TokenIterator; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = TextHighlightRules; + this.$behaviour = new Behaviour(); +}; + +(function() { + + this.tokenRe = new RegExp("^[" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "\\$_]+", "g" + ); + + this.nonTokenRe = new RegExp("^(?:[^" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "\\$_]|\s])+", "g" + ); + + this.getTokenizer = function() { + if (!this.$tokenizer) { + this.$highlightRules = new this.HighlightRules(); + this.$tokenizer = new Tokenizer(this.$highlightRules.getRules()); + } + return this.$tokenizer; + }; + + this.lineCommentStart = ""; + this.blockComment = ""; + + this.toggleCommentLines = function(state, session, startRow, endRow) { + var doc = session.doc; + + var ignoreBlankLines = true; + var shouldRemove = true; + var minIndent = Infinity; + var tabSize = session.getTabSize(); + var insertAtTabStop = false; + + if (!this.lineCommentStart) { + if (!this.blockComment) + return false; + var lineCommentStart = this.blockComment.start; + var lineCommentEnd = this.blockComment.end; + var regexpStart = new RegExp("^(\\s*)(?:" + lang.escapeRegExp(lineCommentStart) + ")"); + var regexpEnd = new RegExp("(?:" + lang.escapeRegExp(lineCommentEnd) + ")\\s*$"); + + var comment = function(line, i) { + if (testRemove(line, i)) + return; + if (!ignoreBlankLines || /\S/.test(line)) { + doc.insertInLine({row: i, column: line.length}, lineCommentEnd); + doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + } + }; + + var uncomment = function(line, i) { + var m; + if (m = line.match(regexpEnd)) + doc.removeInLine(i, line.length - m[0].length, line.length); + if (m = line.match(regexpStart)) + doc.removeInLine(i, m[1].length, m[0].length); + }; + + var testRemove = function(line, row) { + if (regexpStart.test(line)) + return true; + var tokens = session.getTokens(row); + for (var i = 0; i < tokens.length; i++) { + if (tokens[i].type === 'comment') + return true; + } + }; + } else { + if (Array.isArray(this.lineCommentStart)) { + var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join("|"); + var lineCommentStart = this.lineCommentStart[0]; + } else { + var regexpStart = lang.escapeRegExp(this.lineCommentStart); + var lineCommentStart = this.lineCommentStart; + } + regexpStart = new RegExp("^(\\s*)(?:" + regexpStart + ") ?"); + + insertAtTabStop = session.getUseSoftTabs(); + + var uncomment = function(line, i) { + var m = line.match(regexpStart); + if (!m) return; + var start = m[1].length, end = m[0].length; + if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == " ") + end--; + doc.removeInLine(i, start, end); + }; + var commentWithSpace = lineCommentStart + " "; + var comment = function(line, i) { + if (!ignoreBlankLines || /\S/.test(line)) { + if (shouldInsertSpace(line, minIndent, minIndent)) + doc.insertInLine({row: i, column: minIndent}, commentWithSpace); + else + doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + } + }; + var testRemove = function(line, i) { + return regexpStart.test(line); + }; + + var shouldInsertSpace = function(line, before, after) { + var spaces = 0; + while (before-- && line.charAt(before) == " ") + spaces++; + if (spaces % tabSize != 0) + return false; + var spaces = 0; + while (line.charAt(after++) == " ") + spaces++; + if (tabSize > 2) + return spaces % tabSize != tabSize - 1; + else + return spaces % tabSize == 0; + return true; + }; + } + + function iter(fun) { + for (var i = startRow; i <= endRow; i++) + fun(doc.getLine(i), i); + } + + + var minEmptyLength = Infinity; + iter(function(line, i) { + var indent = line.search(/\S/); + if (indent !== -1) { + if (indent < minIndent) + minIndent = indent; + if (shouldRemove && !testRemove(line, i)) + shouldRemove = false; + } else if (minEmptyLength > line.length) { + minEmptyLength = line.length; + } + }); + + if (minIndent == Infinity) { + minIndent = minEmptyLength; + ignoreBlankLines = false; + shouldRemove = false; + } + + if (insertAtTabStop && minIndent % tabSize != 0) + minIndent = Math.floor(minIndent / tabSize) * tabSize; + + iter(shouldRemove ? uncomment : comment); + }; + + this.toggleBlockComment = function(state, session, range, cursor) { + var comment = this.blockComment; + if (!comment) + return; + if (!comment.start && comment[0]) + comment = comment[0]; + + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + var sel = session.selection; + var initialRange = session.selection.toOrientedRange(); + var startRow, colDiff; + + if (token && /comment/.test(token.type)) { + var startRange, endRange; + while (token && /comment/.test(token.type)) { + var i = token.value.indexOf(comment.start); + if (i != -1) { + var row = iterator.getCurrentTokenRow(); + var column = iterator.getCurrentTokenColumn() + i; + startRange = new Range(row, column, row, column + comment.start.length); + break + } + token = iterator.stepBackward(); + }; + + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + while (token && /comment/.test(token.type)) { + var i = token.value.indexOf(comment.end); + if (i != -1) { + var row = iterator.getCurrentTokenRow(); + var column = iterator.getCurrentTokenColumn() + i; + endRange = new Range(row, column, row, column + comment.end.length); + break; + } + token = iterator.stepForward(); + } + if (endRange) + session.remove(endRange); + if (startRange) { + session.remove(startRange); + startRow = startRange.start.row; + colDiff = -comment.start.length + } + } else { + colDiff = comment.start.length + startRow = range.start.row; + session.insert(range.end, comment.end); + session.insert(range.start, comment.start); + } + if (initialRange.start.row == startRow) + initialRange.start.column += colDiff; + if (initialRange.end.row == startRow) + initialRange.end.column += colDiff; + session.selection.fromOrientedRange(initialRange); + }; + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.autoOutdent = function(state, doc, row) { + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + + this.createWorker = function(session) { + return null; + }; + + this.createModeDelegates = function (mapping) { + this.$embeds = []; + this.$modes = {}; + for (var i in mapping) { + if (mapping[i]) { + this.$embeds.push(i); + this.$modes[i] = new mapping[i](); + } + } + + var delegations = ['toggleCommentLines', 'getNextLineIndent', 'checkOutdent', 'autoOutdent', 'transformAction', 'getCompletions']; + + for (var i = 0; i < delegations.length; i++) { + (function(scope) { + var functionName = delegations[i]; + var defaultHandler = scope[functionName]; + scope[delegations[i]] = function() { + return this.$delegator(functionName, arguments, defaultHandler); + } + } (this)); + } + }; + + this.$delegator = function(method, args, defaultHandler) { + var state = args[0]; + if (typeof state != "string") + state = state[0]; + for (var i = 0; i < this.$embeds.length; i++) { + if (!this.$modes[this.$embeds[i]]) continue; + + var split = state.split(this.$embeds[i]); + if (!split[0] && split[1]) { + args[0] = split[1]; + var mode = this.$modes[this.$embeds[i]]; + return mode[method].apply(mode, args); + } + } + var ret = defaultHandler.apply(this, args); + return defaultHandler ? ret : undefined; + }; + + this.transformAction = function(state, action, editor, session, param) { + if (this.$behaviour) { + var behaviours = this.$behaviour.getBehaviours(); + for (var key in behaviours) { + if (behaviours[key][action]) { + var ret = behaviours[key][action].apply(this, arguments); + if (ret) { + return ret; + } + } + } + } + }; + + this.getKeywords = function(append) { + if (!this.completionKeywords) { + var rules = this.$tokenizer.rules; + var completionKeywords = []; + for (var rule in rules) { + var ruleItr = rules[rule]; + for (var r = 0, l = ruleItr.length; r < l; r++) { + if (typeof ruleItr[r].token === "string") { + if (/keyword|support|storage/.test(ruleItr[r].token)) + completionKeywords.push(ruleItr[r].regex); + } + else if (typeof ruleItr[r].token === "object") { + for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) { + if (/keyword|support|storage/.test(ruleItr[r].token[a])) { + var rule = ruleItr[r].regex.match(/\(.+?\)/g)[a]; + completionKeywords.push(rule.substr(1, rule.length - 2)); + } + } + } + } + } + this.completionKeywords = completionKeywords; + } + if (!append) + return this.$keywordList; + return completionKeywords.concat(this.$keywordList || []); + }; + + this.$createKeywordList = function() { + if (!this.$highlightRules) + this.getTokenizer(); + return this.$keywordList = this.$highlightRules.$keywordList || []; + } + + this.getCompletions = function(state, session, pos, prefix) { + var keywords = this.$keywordList || this.$createKeywordList(); + return keywords.map(function(word) { + return { + name: word, + value: word, + score: 0, + meta: "keyword" + }; + }); + }; + + this.$id = "ace/mode/text"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define('ace/tokenizer', ['require', 'exports', 'module' ], function(require, exports, module) { +var MAX_TOKEN_COUNT = 1000; +var Tokenizer = function(rules) { + this.states = rules; + + this.regExps = {}; + this.matchMappings = {}; + for (var key in this.states) { + var state = this.states[key]; + var ruleRegExps = []; + var matchTotal = 0; + var mapping = this.matchMappings[key] = {defaultToken: "text"}; + var flag = "g"; + + var splitterRurles = []; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.defaultToken) + mapping.defaultToken = rule.defaultToken; + if (rule.caseInsensitive) + flag = "gi"; + if (rule.regex == null) + continue; + + if (rule.regex instanceof RegExp) + rule.regex = rule.regex.toString().slice(1, -1); + var adjustedregex = rule.regex; + var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; + if (Array.isArray(rule.token)) { + if (rule.token.length == 1 || matchcount == 1) { + rule.token = rule.token[0]; + } else if (matchcount - 1 != rule.token.length) { + throw new Error("number of classes and regexp groups in '" + + rule.token + "'\n'" + rule.regex + "' doesn't match\n" + + (matchcount - 1) + "!=" + rule.token.length); + } else { + rule.tokenArray = rule.token; + rule.token = null; + rule.onMatch = this.$arrayTokens; + } + } else if (typeof rule.token == "function" && !rule.onMatch) { + if (matchcount > 1) + rule.onMatch = this.$applyToken; + else + rule.onMatch = rule.token; + } + + if (matchcount > 1) { + if (/\\\d/.test(rule.regex)) { + adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); + } else { + matchcount = 1; + adjustedregex = this.removeCapturingGroups(rule.regex); + } + if (!rule.splitRegex && typeof rule.token != "string") + splitterRurles.push(rule); // flag will be known only at the very end + } + + mapping[matchTotal] = i; + matchTotal += matchcount; + + ruleRegExps.push(adjustedregex); + if (!rule.onMatch) + rule.onMatch = null; + rule.__proto__ = null; + } + + splitterRurles.forEach(function(rule) { + rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); + }, this); + + this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); + } +}; + +(function() { + this.$setMaxTokenCount = function(m) { + MAX_TOKEN_COUNT = m | 0; + }; + + this.$applyToken = function(str) { + var values = this.splitRegex.exec(str).slice(1); + var types = this.token.apply(this, values); + if (typeof types === "string") + return [{type: types, value: str}]; + + var tokens = []; + for (var i = 0, l = types.length; i < l; i++) { + if (values[i]) + tokens[tokens.length] = { + type: types[i], + value: values[i] + }; + } + return tokens; + }, + + this.$arrayTokens = function(str) { + if (!str) + return []; + var values = this.splitRegex.exec(str); + if (!values) + return "text"; + var tokens = []; + var types = this.tokenArray; + for (var i = 0, l = types.length; i < l; i++) { + if (values[i + 1]) + tokens[tokens.length] = { + type: types[i], + value: values[i + 1] + }; + } + return tokens; + }; + + this.removeCapturingGroups = function(src) { + var r = src.replace( + /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, + function(x, y) {return y ? "(?:" : x;} + ); + return r; + }; + + this.createSplitterRegexp = function(src, flag) { + if (src.indexOf("(?=") != -1) { + var stack = 0; + var inChClass = false; + var lastCapture = {}; + src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( + m, esc, parenOpen, parenClose, square, index + ) { + if (inChClass) { + inChClass = square != "]"; + } else if (square) { + inChClass = true; + } else if (parenClose) { + if (stack == lastCapture.stack) { + lastCapture.end = index+1; + lastCapture.stack = -1; + } + stack--; + } else if (parenOpen) { + stack++; + if (parenOpen.length != 1) { + lastCapture.stack = stack + lastCapture.start = index; + } + } + return m; + }); + + if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) + src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); + } + return new RegExp(src, (flag||"").replace("g", "")); + }; + this.getLineTokens = function(line, startState) { + if (startState && typeof startState != "string") { + var stack = startState.slice(0); + startState = stack[0]; + } else + var stack = []; + + var currentState = startState || "start"; + var state = this.states[currentState]; + if (!state) { + currentState = "start"; + state = this.states[currentState]; + } + var mapping = this.matchMappings[currentState]; + var re = this.regExps[currentState]; + re.lastIndex = 0; + + var match, tokens = []; + var lastIndex = 0; + + var token = {type: null, value: ""}; + + while (match = re.exec(line)) { + var type = mapping.defaultToken; + var rule = null; + var value = match[0]; + var index = re.lastIndex; + + if (index - value.length > lastIndex) { + var skipped = line.substring(lastIndex, index - value.length); + if (token.type == type) { + token.value += skipped; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: skipped}; + } + } + + for (var i = 0; i < match.length-2; i++) { + if (match[i + 1] === undefined) + continue; + + rule = state[mapping[i]]; + + if (rule.onMatch) + type = rule.onMatch(value, currentState, stack); + else + type = rule.token; + + if (rule.next) { + if (typeof rule.next == "string") + currentState = rule.next; + else + currentState = rule.next(currentState, stack); + + state = this.states[currentState]; + if (!state) { + window.console && console.error && console.error(currentState, "doesn't exist"); + currentState = "start"; + state = this.states[currentState]; + } + mapping = this.matchMappings[currentState]; + lastIndex = index; + re = this.regExps[currentState]; + re.lastIndex = index; + } + break; + } + + if (value) { + if (typeof type == "string") { + if ((!rule || rule.merge !== false) && token.type === type) { + token.value += value; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: value}; + } + } else if (type) { + if (token.type) + tokens.push(token); + token = {type: null, value: ""}; + for (var i = 0; i < type.length; i++) + tokens.push(type[i]); + } + } + + if (lastIndex == line.length) + break; + + lastIndex = index; + + if (tokens.length > MAX_TOKEN_COUNT) { + while (lastIndex < line.length) { + if (token.type) + tokens.push(token); + token = { + value: line.substring(lastIndex, lastIndex += 2000), + type: "overflow" + }; + } + currentState = "start"; + stack = []; + break; + } + } + + if (token.type) + tokens.push(token); + + if (stack.length > 1) { + if (stack[0] !== currentState) + stack.unshift(currentState); + } + return { + tokens : tokens, + state : stack.length ? stack : currentState + }; + }; + +}).call(Tokenizer.prototype); + +exports.Tokenizer = Tokenizer; +}); + +ace.define('ace/mode/text_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) { + + +var lang = require("../lib/lang"); + +var TextHighlightRules = function() { + + this.$rules = { + "start" : [{ + token : "empty_line", + regex : '^$' + }, { + defaultToken : "text" + }] + }; +}; + +(function() { + + this.addRules = function(rules, prefix) { + if (!prefix) { + for (var key in rules) + this.$rules[key] = rules[key]; + return; + } + for (var key in rules) { + var state = rules[key]; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.next) { + if (typeof rule.next != "string") { + if (rule.nextState && rule.nextState.indexOf(prefix) !== 0) + rule.nextState = prefix + rule.nextState; + } else { + if (rule.next.indexOf(prefix) !== 0) + rule.next = prefix + rule.next; + } + + } + } + this.$rules[prefix + key] = state; + } + }; + + this.getRules = function() { + return this.$rules; + }; + + this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) { + var embedRules = new HighlightRules().getRules(); + if (states) { + for (var i = 0; i < states.length; i++) + states[i] = prefix + states[i]; + } else { + states = []; + for (var key in embedRules) + states.push(prefix + key); + } + + this.addRules(embedRules, prefix); + + if (escapeRules) { + var addRules = Array.prototype[append ? "push" : "unshift"]; + for (var i = 0; i < states.length; i++) + addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules)); + } + + if (!this.$embeds) + this.$embeds = []; + this.$embeds.push(prefix); + }; + + this.getEmbeds = function() { + return this.$embeds; + }; + + var pushState = function(currentState, stack) { + if (currentState != "start") + stack.unshift(this.nextState, currentState); + return this.nextState; + }; + var popState = function(currentState, stack) { + if (stack[0] !== currentState) + return "start"; + stack.shift(); + return stack.shift(); + }; + + this.normalizeRules = function() { + var id = 0; + var rules = this.$rules; + function processState(key) { + var state = rules[key]; + state.processed = true; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (!rule.regex && rule.start) { + rule.regex = rule.start; + if (!rule.next) + rule.next = []; + rule.next.push({ + defaultToken: rule.token + }, { + token: rule.token + ".end", + regex: rule.end || rule.start, + next: "pop" + }); + rule.token = rule.token + ".start"; + rule.push = true; + } + var next = rule.next || rule.push; + if (next && Array.isArray(next)) { + var stateName = rule.stateName; + if (!stateName) { + stateName = rule.token; + if (typeof stateName != "string") + stateName = stateName[0] || ""; + if (rules[stateName]) + stateName += id++; + } + rules[stateName] = next; + rule.next = stateName; + processState(stateName); + } else if (next == "pop") { + rule.next = popState; + } + + if (rule.push) { + rule.nextState = rule.next || rule.push; + rule.next = pushState; + delete rule.push; + } + + if (rule.rules) { + for (var r in rule.rules) { + if (rules[r]) { + if (rules[r].push) + rules[r].push.apply(rules[r], rule.rules[r]); + } else { + rules[r] = rule.rules[r]; + } + } + } + if (rule.include || typeof rule == "string") { + var includeName = rule.include || rule; + var toInsert = rules[includeName]; + } else if (Array.isArray(rule)) + toInsert = rule; + + if (toInsert) { + var args = [i, 1].concat(toInsert); + if (rule.noEscape) + args = args.filter(function(x) {return !x.next;}); + state.splice.apply(state, args); + i--; + toInsert = null + } + + if (rule.keywordMap) { + rule.token = this.createKeywordMapper( + rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive + ); + delete rule.defaultToken; + } + } + }; + Object.keys(rules).forEach(processState, this); + }; + + this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) { + var keywords = Object.create(null); + Object.keys(map).forEach(function(className) { + var a = map[className]; + if (ignoreCase) + a = a.toLowerCase(); + var list = a.split(splitChar || "|"); + for (var i = list.length; i--; ) + keywords[list[i]] = className; + }); + if (Object.getPrototypeOf(keywords)) { + keywords.__proto__ = null; + } + this.$keywordList = Object.keys(keywords); + map = null; + return ignoreCase + ? function(value) {return keywords[value.toLowerCase()] || defaultToken } + : function(value) {return keywords[value] || defaultToken }; + } + + this.getKeywords = function() { + return this.$keywords; + }; + +}).call(TextHighlightRules.prototype); + +exports.TextHighlightRules = TextHighlightRules; +}); + +ace.define('ace/mode/behaviour', ['require', 'exports', 'module' ], function(require, exports, module) { + + +var Behaviour = function() { + this.$behaviours = {}; +}; + +(function () { + + this.add = function (name, action, callback) { + switch (undefined) { + case this.$behaviours: + this.$behaviours = {}; + case this.$behaviours[name]: + this.$behaviours[name] = {}; + } + this.$behaviours[name][action] = callback; + } + + this.addBehaviours = function (behaviours) { + for (var key in behaviours) { + for (var action in behaviours[key]) { + this.add(key, action, behaviours[key][action]); + } + } + } + + this.remove = function (name) { + if (this.$behaviours && this.$behaviours[name]) { + delete this.$behaviours[name]; + } + } + + this.inherit = function (mode, filter) { + if (typeof mode === "function") { + var behaviours = new mode().getBehaviours(filter); + } else { + var behaviours = mode.getBehaviours(filter); + } + this.addBehaviours(behaviours); + } + + this.getBehaviours = function (filter) { + if (!filter) { + return this.$behaviours; + } else { + var ret = {} + for (var i = 0; i < filter.length; i++) { + if (this.$behaviours[filter[i]]) { + ret[filter[i]] = this.$behaviours[filter[i]]; + } + } + return ret; + } + } + +}).call(Behaviour.prototype); + +exports.Behaviour = Behaviour; +}); +ace.define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { +exports.packages = {}; + +addUnicodePackage({ + L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A", + Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A", + Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC", + Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F", + Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26", + Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26", + Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC", + Me: "0488048906DE20DD-20E020E2-20E4A670-A672", + N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF", + No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835", + P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65", + Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D", + Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62", + Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63", + Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20", + Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21", + Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F", + Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65", + S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD", + Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC", + Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6", + Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3", + So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD", + Z: "002000A01680180E2000-200A20282029202F205F3000", + Zs: "002000A01680180E2000-200A202F205F3000", + Zl: "2028", + Zp: "2029", + C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF", + Cc: "0000-001F007F-009F", + Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB", + Co: "E000-F8FF", + Cs: "D800-DFFF", + Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF" +}); + +function addUnicodePackage (pack) { + var codePoint = /\w{4}/g; + for (var name in pack) + exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); +}; + +}); + +ace.define('ace/token_iterator', ['require', 'exports', 'module' ], function(require, exports, module) { +var TokenIterator = function(session, initialRow, initialColumn) { + this.$session = session; + this.$row = initialRow; + this.$rowTokens = session.getTokens(initialRow); + + var token = session.getTokenAt(initialRow, initialColumn); + this.$tokenIndex = token ? token.index : -1; +}; + +(function() { + this.stepBackward = function() { + this.$tokenIndex -= 1; + + while (this.$tokenIndex < 0) { + this.$row -= 1; + if (this.$row < 0) { + this.$row = 0; + return null; + } + + this.$rowTokens = this.$session.getTokens(this.$row); + this.$tokenIndex = this.$rowTokens.length - 1; + } + + return this.$rowTokens[this.$tokenIndex]; + }; + this.stepForward = function() { + this.$tokenIndex += 1; + var rowCount; + while (this.$tokenIndex >= this.$rowTokens.length) { + this.$row += 1; + if (!rowCount) + rowCount = this.$session.getLength(); + if (this.$row >= rowCount) { + this.$row = rowCount - 1; + return null; + } + + this.$rowTokens = this.$session.getTokens(this.$row); + this.$tokenIndex = 0; + } + + return this.$rowTokens[this.$tokenIndex]; + }; + this.getCurrentToken = function () { + return this.$rowTokens[this.$tokenIndex]; + }; + this.getCurrentTokenRow = function () { + return this.$row; + }; + this.getCurrentTokenColumn = function() { + var rowTokens = this.$rowTokens; + var tokenIndex = this.$tokenIndex; + var column = rowTokens[tokenIndex].start; + if (column !== undefined) + return column; + + column = 0; + while (tokenIndex > 0) { + tokenIndex -= 1; + column += rowTokens[tokenIndex].value.length; + } + + return column; + }; + +}).call(TokenIterator.prototype); + +exports.TokenIterator = TokenIterator; +}); + +ace.define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Range = require("./range").Range; +var Anchor = require("./anchor").Anchor; + +var Document = function(text) { + this.$lines = []; + if (text.length == 0) { + this.$lines = [""]; + } else if (Array.isArray(text)) { + this._insertLines(0, text); + } else { + this.insert({row: 0, column:0}, text); + } +}; + +(function() { + + oop.implement(this, EventEmitter); + this.setValue = function(text) { + var len = this.getLength(); + this.remove(new Range(0, 0, len, this.getLine(len-1).length)); + this.insert({row: 0, column:0}, text); + }; + this.getValue = function() { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function(row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length == 0) + this.$split = function(text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + } + else + this.$split = function(text) { + return text.split(/\r\n|\r|\n/); + }; + + + this.$detectNewLine = function(text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + }; + this.getNewLineCharacter = function() { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine; + } + }; + + this.$autoNewLine = "\n"; + this.$newLineMode = "auto"; + this.setNewLineMode = function(newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + }; + this.getNewLineMode = function() { + return this.$newLineMode; + }; + this.isNewLine = function(text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function(row) { + return this.$lines[row] || ""; + }; + this.getLines = function(firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function() { + return this.getLines(0, this.getLength()); + }; + this.getLength = function() { + return this.$lines.length; + }; + this.getTextRange = function(range) { + if (range.start.row == range.end.row) { + return this.getLine(range.start.row) + .substring(range.start.column, range.end.column); + } + var lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + return lines.join(this.getNewLineCharacter()); + }; + + this.$clipPosition = function(position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length-1).length; + } else if (position.row < 0) + position.row = 0; + return position; + }; + this.insert = function(position, text) { + if (!text || text.length === 0) + return position; + + position = this.$clipPosition(position); + if (this.getLength() <= 1) + this.$detectNewLine(text); + + var lines = this.$split(text); + var firstLine = lines.splice(0, 1)[0]; + var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; + + position = this.insertInLine(position, firstLine); + if (lastLine !== null) { + position = this.insertNewLine(position); // terminate first line + position = this._insertLines(position.row, lines); + position = this.insertInLine(position, lastLine || ""); + } + return position; + }; + this.insertLines = function(row, lines) { + if (row >= this.getLength()) + return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); + return this._insertLines(Math.max(row, 0), lines); + }; + this._insertLines = function(row, lines) { + if (lines.length == 0) + return {row: row, column: 0}; + if (lines.length > 0xFFFF) { + var end = this._insertLines(row, lines.slice(0xFFFF)); + lines = lines.slice(0, 0xFFFF); + } + + var args = [row, 0]; + args.push.apply(args, lines); + this.$lines.splice.apply(this.$lines, args); + + var range = new Range(row, 0, row + lines.length, 0); + var delta = { + action: "insertLines", + range: range, + lines: lines + }; + this._emit("change", { data: delta }); + return end || range.end; + }; + this.insertNewLine = function(position) { + position = this.$clipPosition(position); + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column); + this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); + + var end = { + row : position.row + 1, + column : 0 + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + + return end; + }; + this.insertInLine = function(position, text) { + if (text.length == 0) + return position; + + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column) + text + + line.substring(position.column); + + var end = { + row : position.row, + column : position.column + text.length + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: text + }; + this._emit("change", { data: delta }); + + return end; + }; + this.remove = function(range) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + range.start = this.$clipPosition(range.start); + range.end = this.$clipPosition(range.end); + + if (range.isEmpty()) + return range.start; + + var firstRow = range.start.row; + var lastRow = range.end.row; + + if (range.isMultiLine()) { + var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; + var lastFullRow = lastRow - 1; + + if (range.end.column > 0) + this.removeInLine(lastRow, 0, range.end.column); + + if (lastFullRow >= firstFullRow) + this._removeLines(firstFullRow, lastFullRow); + + if (firstFullRow != firstRow) { + this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); + this.removeNewLine(range.start.row); + } + } + else { + this.removeInLine(firstRow, range.start.column, range.end.column); + } + return range.start; + }; + this.removeInLine = function(row, startColumn, endColumn) { + if (startColumn == endColumn) + return; + + var range = new Range(row, startColumn, row, endColumn); + var line = this.getLine(row); + var removed = line.substring(startColumn, endColumn); + var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); + this.$lines.splice(row, 1, newLine); + + var delta = { + action: "removeText", + range: range, + text: removed + }; + this._emit("change", { data: delta }); + return range.start; + }; + this.removeLines = function(firstRow, lastRow) { + if (firstRow < 0 || lastRow >= this.getLength()) + return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); + return this._removeLines(firstRow, lastRow); + }; + + this._removeLines = function(firstRow, lastRow) { + var range = new Range(firstRow, 0, lastRow + 1, 0); + var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); + + var delta = { + action: "removeLines", + range: range, + nl: this.getNewLineCharacter(), + lines: removed + }; + this._emit("change", { data: delta }); + return removed; + }; + this.removeNewLine = function(row) { + var firstLine = this.getLine(row); + var secondLine = this.getLine(row+1); + + var range = new Range(row, firstLine.length, row+1, 0); + var line = firstLine + secondLine; + + this.$lines.splice(row, 2, line); + + var delta = { + action: "removeText", + range: range, + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + }; + this.replace = function(range, text) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + if (text.length == 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + if (text) { + var end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function(deltas) { + for (var i=0; i=0; i--) { + var delta = deltas[i]; + + var range = Range.fromPoints(delta.range.start, delta.range.end); + + if (delta.action == "insertLines") + this._removeLines(range.start.row, range.end.row - 1); + else if (delta.action == "insertText") + this.remove(range); + else if (delta.action == "removeLines") + this._insertLines(range.start.row, delta.lines); + else if (delta.action == "removeText") + this.insert(range.start, delta.text); + } + }; + this.indexToPosition = function(index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l-1, column: lines[l-1].length}; + }; + this.positionToIndex = function(pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + +}).call(Document.prototype); + +exports.Document = Document; +}); + +ace.define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; + +var Anchor = exports.Anchor = function(doc, row, column) { + this.$onChange = this.onChange.bind(this); + this.attach(doc); + + if (typeof column == "undefined") + this.setPosition(row.row, row.column); + else + this.setPosition(row, column); +}; + +(function() { + + oop.implement(this, EventEmitter); + this.getPosition = function() { + return this.$clipPositionToDocument(this.row, this.column); + }; + this.getDocument = function() { + return this.document; + }; + this.$insertRight = false; + this.onChange = function(e) { + var delta = e.data; + var range = delta.range; + + if (range.start.row == range.end.row && range.start.row != this.row) + return; + + if (range.start.row > this.row) + return; + + if (range.start.row == this.row && range.start.column > this.column) + return; + + var row = this.row; + var column = this.column; + var start = range.start; + var end = range.end; + + if (delta.action === "insertText") { + if (start.row === row && start.column <= column) { + if (start.column === column && this.$insertRight) { + } else if (start.row === end.row) { + column += end.column - start.column; + } else { + column -= start.column; + row += end.row - start.row; + } + } else if (start.row !== end.row && start.row < row) { + row += end.row - start.row; + } + } else if (delta.action === "insertLines") { + if (start.row <= row) { + row += end.row - start.row; + } + } else if (delta.action === "removeText") { + if (start.row === row && start.column < column) { + if (end.column >= column) + column = start.column; + else + column = Math.max(0, column - (end.column - start.column)); + + } else if (start.row !== end.row && start.row < row) { + if (end.row === row) + column = Math.max(0, column - end.column) + start.column; + row -= (end.row - start.row); + } else if (end.row === row) { + row -= end.row - start.row; + column = Math.max(0, column - end.column) + start.column; + } + } else if (delta.action == "removeLines") { + if (start.row <= row) { + if (end.row <= row) + row -= end.row - start.row; + else { + row = start.row; + column = 0; + } + } + } + + this.setPosition(row, column, true); + }; + this.setPosition = function(row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._emit("change", { + old: old, + value: pos + }); + }; + this.detach = function() { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function(doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function(row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + +}).call(Anchor.prototype); + +}); + +ace.define('ace/background_tokenizer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; + +var BackgroundTokenizer = function(tokenizer, editor) { + this.running = false; + this.lines = []; + this.states = []; + this.currentLine = 0; + this.tokenizer = tokenizer; + + var self = this; + + this.$worker = function() { + if (!self.running) { return; } + + var workerStart = new Date(); + var currentLine = self.currentLine; + var endLine = -1; + var doc = self.doc; + + while (self.lines[currentLine]) + currentLine++; + + var startLine = currentLine; + + var len = doc.getLength(); + var processedLines = 0; + self.running = false; + while (currentLine < len) { + self.$tokenizeRow(currentLine); + endLine = currentLine; + do { + currentLine++; + } while (self.lines[currentLine]); + processedLines ++; + if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) { + self.running = setTimeout(self.$worker, 20); + self.currentLine = currentLine; + return; + } + } + self.currentLine = currentLine; + + if (startLine <= endLine) + self.fireUpdateEvent(startLine, endLine); + }; +}; + +(function(){ + + oop.implement(this, EventEmitter); + this.setTokenizer = function(tokenizer) { + this.tokenizer = tokenizer; + this.lines = []; + this.states = []; + + this.start(0); + }; + this.setDocument = function(doc) { + this.doc = doc; + this.lines = []; + this.states = []; + + this.stop(); + }; + this.fireUpdateEvent = function(firstRow, lastRow) { + var data = { + first: firstRow, + last: lastRow + }; + this._emit("update", {data: data}); + }; + this.start = function(startRow) { + this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength()); + this.lines.splice(this.currentLine, this.lines.length); + this.states.splice(this.currentLine, this.states.length); + + this.stop(); + this.running = setTimeout(this.$worker, 700); + }; + + this.scheduleStart = function() { + if (!this.running) + this.running = setTimeout(this.$worker, 700); + } + + this.$updateOnChange = function(delta) { + var range = delta.range; + var startRow = range.start.row; + var len = range.end.row - startRow; + + if (len === 0) { + this.lines[startRow] = null; + } else if (delta.action == "removeText" || delta.action == "removeLines") { + this.lines.splice(startRow, len + 1, null); + this.states.splice(startRow, len + 1, null); + } else { + var args = Array(len + 1); + args.unshift(startRow, 1); + this.lines.splice.apply(this.lines, args); + this.states.splice.apply(this.states, args); + } + + this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength()); + + this.stop(); + }; + this.stop = function() { + if (this.running) + clearTimeout(this.running); + this.running = false; + }; + this.getTokens = function(row) { + return this.lines[row] || this.$tokenizeRow(row); + }; + this.getState = function(row) { + if (this.currentLine == row) + this.$tokenizeRow(row); + return this.states[row] || "start"; + }; + + this.$tokenizeRow = function(row) { + var line = this.doc.getLine(row); + var state = this.states[row - 1]; + + var data = this.tokenizer.getLineTokens(line, state, row); + + if (this.states[row] + "" !== data.state + "") { + this.states[row] = data.state; + this.lines[row + 1] = null; + if (this.currentLine > row + 1) + this.currentLine = row + 1; + } else if (this.currentLine == row) { + this.currentLine = row + 1; + } + + return this.lines[row] = data.tokens; + }; + +}).call(BackgroundTokenizer.prototype); + +exports.BackgroundTokenizer = BackgroundTokenizer; +}); + +ace.define('ace/search_highlight', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/range'], function(require, exports, module) { + + +var lang = require("./lib/lang"); +var oop = require("./lib/oop"); +var Range = require("./range").Range; + +var SearchHighlight = function(regExp, clazz, type) { + this.setRegexp(regExp); + this.clazz = clazz; + this.type = type || "text"; +}; + +(function() { + this.MAX_RANGES = 500; + + this.setRegexp = function(regExp) { + if (this.regExp+"" == regExp+"") + return; + this.regExp = regExp; + this.cache = []; + }; + + this.update = function(html, markerLayer, session, config) { + if (!this.regExp) + return; + var start = config.firstRow, end = config.lastRow; + + for (var i = start; i <= end; i++) { + var ranges = this.cache[i]; + if (ranges == null) { + ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); + if (ranges.length > this.MAX_RANGES) + ranges = ranges.slice(0, this.MAX_RANGES); + ranges = ranges.map(function(match) { + return new Range(i, match.offset, i, match.offset + match.length); + }); + this.cache[i] = ranges.length ? ranges : ""; + } + + for (var j = ranges.length; j --; ) { + markerLayer.drawSingleLineMarker( + html, ranges[j].toScreenRange(session), this.clazz, config); + } + } + }; + +}).call(SearchHighlight.prototype); + +exports.SearchHighlight = SearchHighlight; +}); + +ace.define('ace/edit_session/folding', ['require', 'exports', 'module' , 'ace/range', 'ace/edit_session/fold_line', 'ace/edit_session/fold', 'ace/token_iterator'], function(require, exports, module) { + + +var Range = require("../range").Range; +var FoldLine = require("./fold_line").FoldLine; +var Fold = require("./fold").Fold; +var TokenIterator = require("../token_iterator").TokenIterator; + +function Folding() { + this.getFoldAt = function(row, column, side) { + var foldLine = this.getFoldLine(row); + if (!foldLine) + return null; + + var folds = foldLine.folds; + for (var i = 0; i < folds.length; i++) { + var fold = folds[i]; + if (fold.range.contains(row, column)) { + if (side == 1 && fold.range.isEnd(row, column)) { + continue; + } else if (side == -1 && fold.range.isStart(row, column)) { + continue; + } + return fold; + } + } + }; + this.getFoldsInRange = function(range) { + var start = range.start; + var end = range.end; + var foldLines = this.$foldData; + var foundFolds = []; + + start.column += 1; + end.column -= 1; + + for (var i = 0; i < foldLines.length; i++) { + var cmp = foldLines[i].range.compareRange(range); + if (cmp == 2) { + continue; + } + else if (cmp == -2) { + break; + } + + var folds = foldLines[i].folds; + for (var j = 0; j < folds.length; j++) { + var fold = folds[j]; + cmp = fold.range.compareRange(range); + if (cmp == -2) { + break; + } else if (cmp == 2) { + continue; + } else + if (cmp == 42) { + break; + } + foundFolds.push(fold); + } + } + start.column -= 1; + end.column += 1; + + return foundFolds; + }; + + this.getFoldsInRangeList = function(ranges) { + if (Array.isArray(ranges)) { + var folds = []; + ranges.forEach(function(range) { + folds = folds.concat(this.getFoldsInRange(range)); + }, this); + } else { + var folds = this.getFoldsInRange(ranges); + } + return folds; + } + this.getAllFolds = function() { + var folds = []; + var foldLines = this.$foldData; + + for (var i = 0; i < foldLines.length; i++) + for (var j = 0; j < foldLines[i].folds.length; j++) + folds.push(foldLines[i].folds[j]); + + return folds; + }; + this.getFoldStringAt = function(row, column, trim, foldLine) { + foldLine = foldLine || this.getFoldLine(row); + if (!foldLine) + return null; + + var lastFold = { + end: { column: 0 } + }; + var str, fold; + for (var i = 0; i < foldLine.folds.length; i++) { + fold = foldLine.folds[i]; + var cmp = fold.range.compareEnd(row, column); + if (cmp == -1) { + str = this + .getLine(fold.start.row) + .substring(lastFold.end.column, fold.start.column); + break; + } + else if (cmp === 0) { + return null; + } + lastFold = fold; + } + if (!str) + str = this.getLine(fold.start.row).substring(lastFold.end.column); + + if (trim == -1) + return str.substring(0, column - lastFold.end.column); + else if (trim == 1) + return str.substring(column - lastFold.end.column); + else + return str; + }; + + this.getFoldLine = function(docRow, startFoldLine) { + var foldData = this.$foldData; + var i = 0; + if (startFoldLine) + i = foldData.indexOf(startFoldLine); + if (i == -1) + i = 0; + for (i; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) { + return foldLine; + } else if (foldLine.end.row > docRow) { + return null; + } + } + return null; + }; + this.getNextFoldLine = function(docRow, startFoldLine) { + var foldData = this.$foldData; + var i = 0; + if (startFoldLine) + i = foldData.indexOf(startFoldLine); + if (i == -1) + i = 0; + for (i; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (foldLine.end.row >= docRow) { + return foldLine; + } + } + return null; + }; + + this.getFoldedRowCount = function(first, last) { + var foldData = this.$foldData, rowCount = last-first+1; + for (var i = 0; i < foldData.length; i++) { + var foldLine = foldData[i], + end = foldLine.end.row, + start = foldLine.start.row; + if (end >= last) { + if(start < last) { + if(start >= first) + rowCount -= last-start; + else + rowCount = 0;//in one fold + } + break; + } else if(end >= first){ + if (start >= first) //fold inside range + rowCount -= end-start; + else + rowCount -= end-first+1; + } + } + return rowCount; + }; + + this.$addFoldLine = function(foldLine) { + this.$foldData.push(foldLine); + this.$foldData.sort(function(a, b) { + return a.start.row - b.start.row; + }); + return foldLine; + }; + this.addFold = function(placeholder, range) { + var foldData = this.$foldData; + var added = false; + var fold; + + if (placeholder instanceof Fold) + fold = placeholder; + else { + fold = new Fold(range, placeholder); + fold.collapseChildren = range.collapseChildren; + } + this.$clipRangeToDocument(fold.range); + + var startRow = fold.start.row; + var startColumn = fold.start.column; + var endRow = fold.end.row; + var endColumn = fold.end.column; + if (!(startRow < endRow || + startRow == endRow && startColumn <= endColumn - 2)) + throw new Error("The range has to be at least 2 characters width"); + + var startFold = this.getFoldAt(startRow, startColumn, 1); + var endFold = this.getFoldAt(endRow, endColumn, -1); + if (startFold && endFold == startFold) + return startFold.addSubFold(fold); + + if ( + (startFold && !startFold.range.isStart(startRow, startColumn)) + || (endFold && !endFold.range.isEnd(endRow, endColumn)) + ) { + throw new Error("A fold can't intersect already existing fold" + fold.range + startFold.range); + } + var folds = this.getFoldsInRange(fold.range); + if (folds.length > 0) { + this.removeFolds(folds); + folds.forEach(function(subFold) { + fold.addSubFold(subFold); + }); + } + + for (var i = 0; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (endRow == foldLine.start.row) { + foldLine.addFold(fold); + added = true; + break; + } else if (startRow == foldLine.end.row) { + foldLine.addFold(fold); + added = true; + if (!fold.sameRow) { + var foldLineNext = foldData[i + 1]; + if (foldLineNext && foldLineNext.start.row == endRow) { + foldLine.merge(foldLineNext); + break; + } + } + break; + } else if (endRow <= foldLine.start.row) { + break; + } + } + + if (!added) + foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold)); + + if (this.$useWrapMode) + this.$updateWrapData(foldLine.start.row, foldLine.start.row); + else + this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row); + this.$modified = true; + this._emit("changeFold", { data: fold, action: "add" }); + + return fold; + }; + + this.addFolds = function(folds) { + folds.forEach(function(fold) { + this.addFold(fold); + }, this); + }; + + this.removeFold = function(fold) { + var foldLine = fold.foldLine; + var startRow = foldLine.start.row; + var endRow = foldLine.end.row; + + var foldLines = this.$foldData; + var folds = foldLine.folds; + if (folds.length == 1) { + foldLines.splice(foldLines.indexOf(foldLine), 1); + } else + if (foldLine.range.isEnd(fold.end.row, fold.end.column)) { + folds.pop(); + foldLine.end.row = folds[folds.length - 1].end.row; + foldLine.end.column = folds[folds.length - 1].end.column; + } else + if (foldLine.range.isStart(fold.start.row, fold.start.column)) { + folds.shift(); + foldLine.start.row = folds[0].start.row; + foldLine.start.column = folds[0].start.column; + } else + if (fold.sameRow) { + folds.splice(folds.indexOf(fold), 1); + } else + { + var newFoldLine = foldLine.split(fold.start.row, fold.start.column); + folds = newFoldLine.folds; + folds.shift(); + newFoldLine.start.row = folds[0].start.row; + newFoldLine.start.column = folds[0].start.column; + } + + if (!this.$updating) { + if (this.$useWrapMode) + this.$updateWrapData(startRow, endRow); + else + this.$updateRowLengthCache(startRow, endRow); + } + this.$modified = true; + this._emit("changeFold", { data: fold, action: "remove" }); + }; + + this.removeFolds = function(folds) { + var cloneFolds = []; + for (var i = 0; i < folds.length; i++) { + cloneFolds.push(folds[i]); + } + + cloneFolds.forEach(function(fold) { + this.removeFold(fold); + }, this); + this.$modified = true; + }; + + this.expandFold = function(fold) { + this.removeFold(fold); + fold.subFolds.forEach(function(subFold) { + fold.restoreRange(subFold); + this.addFold(subFold); + }, this); + if (fold.collapseChildren > 0) { + this.foldAll(fold.start.row+1, fold.end.row, fold.collapseChildren-1); + } + fold.subFolds = []; + }; + + this.expandFolds = function(folds) { + folds.forEach(function(fold) { + this.expandFold(fold); + }, this); + }; + + this.unfold = function(location, expandInner) { + var range, folds; + if (location == null) { + range = new Range(0, 0, this.getLength(), 0); + expandInner = true; + } else if (typeof location == "number") + range = new Range(location, 0, location, this.getLine(location).length); + else if ("row" in location) + range = Range.fromPoints(location, location); + else + range = location; + + folds = this.getFoldsInRangeList(range); + if (expandInner) { + this.removeFolds(folds); + } else { + var subFolds = folds; + while (subFolds.length) { + this.expandFolds(subFolds); + subFolds = this.getFoldsInRangeList(range); + } + } + if (folds.length) + return folds; + }; + this.isRowFolded = function(docRow, startFoldRow) { + return !!this.getFoldLine(docRow, startFoldRow); + }; + + this.getRowFoldEnd = function(docRow, startFoldRow) { + var foldLine = this.getFoldLine(docRow, startFoldRow); + return foldLine ? foldLine.end.row : docRow; + }; + + this.getRowFoldStart = function(docRow, startFoldRow) { + var foldLine = this.getFoldLine(docRow, startFoldRow); + return foldLine ? foldLine.start.row : docRow; + }; + + this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { + if (startRow == null) { + startRow = foldLine.start.row; + startColumn = 0; + } + + if (endRow == null) { + endRow = foldLine.end.row; + endColumn = this.getLine(endRow).length; + } + var doc = this.doc; + var textLine = ""; + + foldLine.walk(function(placeholder, row, column, lastColumn) { + if (row < startRow) + return; + if (row == startRow) { + if (column < startColumn) + return; + lastColumn = Math.max(startColumn, lastColumn); + } + + if (placeholder != null) { + textLine += placeholder; + } else { + textLine += doc.getLine(row).substring(lastColumn, column); + } + }, endRow, endColumn); + return textLine; + }; + + this.getDisplayLine = function(row, endColumn, startRow, startColumn) { + var foldLine = this.getFoldLine(row); + + if (!foldLine) { + var line; + line = this.doc.getLine(row); + return line.substring(startColumn || 0, endColumn || line.length); + } else { + return this.getFoldDisplayLine( + foldLine, row, endColumn, startRow, startColumn); + } + }; + + this.$cloneFoldData = function() { + var fd = []; + fd = this.$foldData.map(function(foldLine) { + var folds = foldLine.folds.map(function(fold) { + return fold.clone(); + }); + return new FoldLine(fd, folds); + }); + + return fd; + }; + + this.toggleFold = function(tryToUnfold) { + var selection = this.selection; + var range = selection.getRange(); + var fold; + var bracketPos; + + if (range.isEmpty()) { + var cursor = range.start; + fold = this.getFoldAt(cursor.row, cursor.column); + + if (fold) { + this.expandFold(fold); + return; + } else if (bracketPos = this.findMatchingBracket(cursor)) { + if (range.comparePoint(bracketPos) == 1) { + range.end = bracketPos; + } else { + range.start = bracketPos; + range.start.column++; + range.end.column--; + } + } else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) { + if (range.comparePoint(bracketPos) == 1) + range.end = bracketPos; + else + range.start = bracketPos; + + range.start.column++; + } else { + range = this.getCommentFoldRange(cursor.row, cursor.column) || range; + } + } else { + var folds = this.getFoldsInRange(range); + if (tryToUnfold && folds.length) { + this.expandFolds(folds); + return; + } else if (folds.length == 1 ) { + fold = folds[0]; + } + } + + if (!fold) + fold = this.getFoldAt(range.start.row, range.start.column); + + if (fold && fold.range.toString() == range.toString()) { + this.expandFold(fold); + return; + } + + var placeholder = "..."; + if (!range.isMultiLine()) { + placeholder = this.getTextRange(range); + if(placeholder.length < 4) + return; + placeholder = placeholder.trim().substring(0, 2) + ".."; + } + + this.addFold(placeholder, range); + }; + + this.getCommentFoldRange = function(row, column, dir) { + var iterator = new TokenIterator(this, row, column); + var token = iterator.getCurrentToken(); + if (token && /^comment|string/.test(token.type)) { + var range = new Range(); + var re = new RegExp(token.type.replace(/\..*/, "\\.")); + if (dir != 1) { + do { + token = iterator.stepBackward(); + } while(token && re.test(token.type)); + iterator.stepForward(); + } + + range.start.row = iterator.getCurrentTokenRow(); + range.start.column = iterator.getCurrentTokenColumn() + 2; + + iterator = new TokenIterator(this, row, column); + + if (dir != -1) { + do { + token = iterator.stepForward(); + } while(token && re.test(token.type)); + token = iterator.stepBackward(); + } else + token = iterator.getCurrentToken(); + + range.end.row = iterator.getCurrentTokenRow(); + range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 2; + return range; + } + }; + + this.foldAll = function(startRow, endRow, depth) { + if (depth == undefined) + depth = 100000; // JSON.stringify doesn't hanle Infinity + var foldWidgets = this.foldWidgets; + if (!foldWidgets) + return; // mode doesn't support folding + endRow = endRow || this.getLength(); + startRow = startRow || 0; + for (var row = startRow; row < endRow; row++) { + if (foldWidgets[row] == null) + foldWidgets[row] = this.getFoldWidget(row); + if (foldWidgets[row] != "start") + continue; + + var range = this.getFoldWidgetRange(row); + if (range && range.isMultiLine() + && range.end.row <= endRow + && range.start.row >= startRow + ) { + row = range.end.row; + try { + var fold = this.addFold("...", range); + if (fold) + fold.collapseChildren = depth; + } catch(e) {} + } + } + }; + this.$foldStyles = { + "manual": 1, + "markbegin": 1, + "markbeginend": 1 + }; + this.$foldStyle = "markbegin"; + this.setFoldStyle = function(style) { + if (!this.$foldStyles[style]) + throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]"); + + if (this.$foldStyle == style) + return; + + this.$foldStyle = style; + + if (style == "manual") + this.unfold(); + var mode = this.$foldMode; + this.$setFolding(null); + this.$setFolding(mode); + }; + + this.$setFolding = function(foldMode) { + if (this.$foldMode == foldMode) + return; + + this.$foldMode = foldMode; + + this.removeListener('change', this.$updateFoldWidgets); + this._emit("changeAnnotation"); + + if (!foldMode || this.$foldStyle == "manual") { + this.foldWidgets = null; + return; + } + + this.foldWidgets = []; + this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle); + this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle); + + this.$updateFoldWidgets = this.updateFoldWidgets.bind(this); + this.on('change', this.$updateFoldWidgets); + + }; + + this.getParentFoldRangeData = function (row, ignoreCurrent) { + var fw = this.foldWidgets; + if (!fw || (ignoreCurrent && fw[row])) + return {}; + + var i = row - 1, firstRange; + while (i >= 0) { + var c = fw[i]; + if (c == null) + c = fw[i] = this.getFoldWidget(i); + + if (c == "start") { + var range = this.getFoldWidgetRange(i); + if (!firstRange) + firstRange = range; + if (range && range.end.row >= row) + break; + } + i--; + } + + return { + range: i !== -1 && range, + firstRange: firstRange + }; + } + + this.onFoldWidgetClick = function(row, e) { + e = e.domEvent; + var options = { + children: e.shiftKey, + all: e.ctrlKey || e.metaKey, + siblings: e.altKey + }; + + var range = this.$toggleFoldWidget(row, options); + if (!range) { + var el = (e.target || e.srcElement) + if (el && /ace_fold-widget/.test(el.className)) + el.className += " ace_invalid"; + } + }; + + this.$toggleFoldWidget = function(row, options) { + if (!this.getFoldWidget) + return; + var type = this.getFoldWidget(row); + var line = this.getLine(row); + + var dir = type === "end" ? -1 : 1; + var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir); + + if (fold) { + if (options.children || options.all) + this.removeFold(fold); + else + this.expandFold(fold); + return; + } + + var range = this.getFoldWidgetRange(row, true); + if (range && !range.isMultiLine()) { + fold = this.getFoldAt(range.start.row, range.start.column, 1); + if (fold && range.isEqual(fold.range)) { + this.removeFold(fold); + return; + } + } + + if (options.siblings) { + var data = this.getParentFoldRangeData(row); + if (data.range) { + var startRow = data.range.start.row + 1; + var endRow = data.range.end.row; + } + this.foldAll(startRow, endRow, options.all ? 10000 : 0); + } else if (options.children) { + endRow = range ? range.end.row : this.getLength(); + this.foldAll(row + 1, range.end.row, options.all ? 10000 : 0); + } else if (range) { + if (options.all) + range.collapseChildren = 10000; + this.addFold("...", range); + } + + return range; + }; + + + + this.toggleFoldWidget = function(toggleParent) { + var row = this.selection.getCursor().row; + row = this.getRowFoldStart(row); + var range = this.$toggleFoldWidget(row, {}); + + if (range) + return; + var data = this.getParentFoldRangeData(row, true); + range = data.range || data.firstRange; + + if (range) { + row = range.start.row; + var fold = this.getFoldAt(row, this.getLine(row).length, 1); + + if (fold) { + this.removeFold(fold); + } else { + this.addFold("...", range); + } + } + }; + + this.updateFoldWidgets = function(e) { + var delta = e.data; + var range = delta.range; + var firstRow = range.start.row; + var len = range.end.row - firstRow; + + if (len === 0) { + this.foldWidgets[firstRow] = null; + } else if (delta.action == "removeText" || delta.action == "removeLines") { + this.foldWidgets.splice(firstRow, len + 1, null); + } else { + var args = Array(len + 1); + args.unshift(firstRow, 1); + this.foldWidgets.splice.apply(this.foldWidgets, args); + } + }; + +} + +exports.Folding = Folding; + +}); + +ace.define('ace/edit_session/fold_line', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { + + +var Range = require("../range").Range; +function FoldLine(foldData, folds) { + this.foldData = foldData; + if (Array.isArray(folds)) { + this.folds = folds; + } else { + folds = this.folds = [ folds ]; + } + + var last = folds[folds.length - 1] + this.range = new Range(folds[0].start.row, folds[0].start.column, + last.end.row, last.end.column); + this.start = this.range.start; + this.end = this.range.end; + + this.folds.forEach(function(fold) { + fold.setFoldLine(this); + }, this); +} + +(function() { + this.shiftRow = function(shift) { + this.start.row += shift; + this.end.row += shift; + this.folds.forEach(function(fold) { + fold.start.row += shift; + fold.end.row += shift; + }); + } + + this.addFold = function(fold) { + if (fold.sameRow) { + if (fold.start.row < this.startRow || fold.endRow > this.endRow) { + throw new Error("Can't add a fold to this FoldLine as it has no connection"); + } + this.folds.push(fold); + this.folds.sort(function(a, b) { + return -a.range.compareEnd(b.start.row, b.start.column); + }); + if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) { + this.end.row = fold.end.row; + this.end.column = fold.end.column; + } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { + this.start.row = fold.start.row; + this.start.column = fold.start.column; + } + } else if (fold.start.row == this.end.row) { + this.folds.push(fold); + this.end.row = fold.end.row; + this.end.column = fold.end.column; + } else if (fold.end.row == this.start.row) { + this.folds.unshift(fold); + this.start.row = fold.start.row; + this.start.column = fold.start.column; + } else { + throw new Error("Trying to add fold to FoldRow that doesn't have a matching row"); + } + fold.foldLine = this; + } + + this.containsRow = function(row) { + return row >= this.start.row && row <= this.end.row; + } + + this.walk = function(callback, endRow, endColumn) { + var lastEnd = 0, + folds = this.folds, + fold, + comp, stop, isNewRow = true; + + if (endRow == null) { + endRow = this.end.row; + endColumn = this.end.column; + } + + for (var i = 0; i < folds.length; i++) { + fold = folds[i]; + + comp = fold.range.compareStart(endRow, endColumn); + if (comp == -1) { + callback(null, endRow, endColumn, lastEnd, isNewRow); + return; + } + + stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow); + stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd); + if (stop || comp == 0) { + return; + } + isNewRow = !fold.sameRow; + lastEnd = fold.end.column; + } + callback(null, endRow, endColumn, lastEnd, isNewRow); + } + + this.getNextFoldTo = function(row, column) { + var fold, cmp; + for (var i = 0; i < this.folds.length; i++) { + fold = this.folds[i]; + cmp = fold.range.compareEnd(row, column); + if (cmp == -1) { + return { + fold: fold, + kind: "after" + }; + } else if (cmp == 0) { + return { + fold: fold, + kind: "inside" + } + } + } + return null; + } + + this.addRemoveChars = function(row, column, len) { + var ret = this.getNextFoldTo(row, column), + fold, folds; + if (ret) { + fold = ret.fold; + if (ret.kind == "inside" + && fold.start.column != column + && fold.start.row != row) + { + window.console && window.console.log(row, column, fold); + } else if (fold.start.row == row) { + folds = this.folds; + var i = folds.indexOf(fold); + if (i == 0) { + this.start.column += len; + } + for (i; i < folds.length; i++) { + fold = folds[i]; + fold.start.column += len; + if (!fold.sameRow) { + return; + } + fold.end.column += len; + } + this.end.column += len; + } + } + } + + this.split = function(row, column) { + var fold = this.getNextFoldTo(row, column).fold; + var folds = this.folds; + var foldData = this.foldData; + + if (!fold) + return null; + + var i = folds.indexOf(fold); + var foldBefore = folds[i - 1]; + this.end.row = foldBefore.end.row; + this.end.column = foldBefore.end.column; + folds = folds.splice(i, folds.length - i); + + var newFoldLine = new FoldLine(foldData, folds); + foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); + return newFoldLine; + } + + this.merge = function(foldLineNext) { + var folds = foldLineNext.folds; + for (var i = 0; i < folds.length; i++) { + this.addFold(folds[i]); + } + var foldData = this.foldData; + foldData.splice(foldData.indexOf(foldLineNext), 1); + } + + this.toString = function() { + var ret = [this.range.toString() + ": [" ]; + + this.folds.forEach(function(fold) { + ret.push(" " + fold.toString()); + }); + ret.push("]") + return ret.join("\n"); + } + + this.idxToPosition = function(idx) { + var lastFoldEndColumn = 0; + var fold; + + for (var i = 0; i < this.folds.length; i++) { + var fold = this.folds[i]; + + idx -= fold.start.column - lastFoldEndColumn; + if (idx < 0) { + return { + row: fold.start.row, + column: fold.start.column + idx + }; + } + + idx -= fold.placeholder.length; + if (idx < 0) { + return fold.start; + } + + lastFoldEndColumn = fold.end.column; + } + + return { + row: this.end.row, + column: this.end.column + idx + }; + } +}).call(FoldLine.prototype); + +exports.FoldLine = FoldLine; +}); + +ace.define('ace/edit_session/fold', ['require', 'exports', 'module' , 'ace/range', 'ace/range_list', 'ace/lib/oop'], function(require, exports, module) { + + +var Range = require("../range").Range; +var RangeList = require("../range_list").RangeList; +var oop = require("../lib/oop") +var Fold = exports.Fold = function(range, placeholder) { + this.foldLine = null; + this.placeholder = placeholder; + this.range = range; + this.start = range.start; + this.end = range.end; + + this.sameRow = range.start.row == range.end.row; + this.subFolds = this.ranges = []; +}; + +oop.inherits(Fold, RangeList); + +(function() { + + this.toString = function() { + return '"' + this.placeholder + '" ' + this.range.toString(); + }; + + this.setFoldLine = function(foldLine) { + this.foldLine = foldLine; + this.subFolds.forEach(function(fold) { + fold.setFoldLine(foldLine); + }); + }; + + this.clone = function() { + var range = this.range.clone(); + var fold = new Fold(range, this.placeholder); + this.subFolds.forEach(function(subFold) { + fold.subFolds.push(subFold.clone()); + }); + fold.collapseChildren = this.collapseChildren; + return fold; + }; + + this.addSubFold = function(fold) { + if (this.range.isEqual(fold)) + return; + + if (!this.range.containsRange(fold)) + throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + consumeRange(fold, this.start); + + var row = fold.start.row, column = fold.start.column; + for (var i = 0, cmp = -1; i < this.subFolds.length; i++) { + cmp = this.subFolds[i].range.compare(row, column); + if (cmp != 1) + break; + } + var afterStart = this.subFolds[i]; + + if (cmp == 0) + return afterStart.addSubFold(fold); + var row = fold.range.end.row, column = fold.range.end.column; + for (var j = i, cmp = -1; j < this.subFolds.length; j++) { + cmp = this.subFolds[j].range.compare(row, column); + if (cmp != 1) + break; + } + var afterEnd = this.subFolds[j]; + + if (cmp == 0) + throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + + var consumedFolds = this.subFolds.splice(i, j - i, fold); + fold.setFoldLine(this.foldLine); + + return fold; + }; + + this.restoreRange = function(range) { + return restoreRange(range, this.start); + }; + +}).call(Fold.prototype); + +function consumePoint(point, anchor) { + point.row -= anchor.row; + if (point.row == 0) + point.column -= anchor.column; +} +function consumeRange(range, anchor) { + consumePoint(range.start, anchor); + consumePoint(range.end, anchor); +} +function restorePoint(point, anchor) { + if (point.row == 0) + point.column += anchor.column; + point.row += anchor.row; +} +function restoreRange(range, anchor) { + restorePoint(range.start, anchor); + restorePoint(range.end, anchor); +} + +}); + +ace.define('ace/range_list', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { + +var Range = require("./range").Range; +var comparePoints = Range.comparePoints; + +var RangeList = function() { + this.ranges = []; +}; + +(function() { + this.comparePoints = comparePoints; + + this.pointIndex = function(pos, excludeEdges, startIndex) { + var list = this.ranges; + + for (var i = startIndex || 0; i < list.length; i++) { + var range = list[i]; + var cmpEnd = comparePoints(pos, range.end); + if (cmpEnd > 0) + continue; + var cmpStart = comparePoints(pos, range.start); + if (cmpEnd === 0) + return excludeEdges && cmpStart !== 0 ? -i-2 : i; + if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges)) + return i; + + return -i-1; + } + return -i - 1; + }; + + this.add = function(range) { + var excludeEdges = !range.isEmpty(); + var startIndex = this.pointIndex(range.start, excludeEdges); + if (startIndex < 0) + startIndex = -startIndex - 1; + + var endIndex = this.pointIndex(range.end, excludeEdges, startIndex); + + if (endIndex < 0) + endIndex = -endIndex - 1; + else + endIndex++; + return this.ranges.splice(startIndex, endIndex - startIndex, range); + }; + + this.addList = function(list) { + var removed = []; + for (var i = list.length; i--; ) { + removed.push.call(removed, this.add(list[i])); + } + return removed; + }; + + this.substractPoint = function(pos) { + var i = this.pointIndex(pos); + + if (i >= 0) + return this.ranges.splice(i, 1); + }; + this.merge = function() { + var removed = []; + var list = this.ranges; + + list = list.sort(function(a, b) { + return comparePoints(a.start, b.start); + }); + + var next = list[0], range; + for (var i = 1; i < list.length; i++) { + range = next; + next = list[i]; + var cmp = comparePoints(range.end, next.start); + if (cmp < 0) + continue; + + if (cmp == 0 && !range.isEmpty() && !next.isEmpty()) + continue; + + if (comparePoints(range.end, next.end) < 0) { + range.end.row = next.end.row; + range.end.column = next.end.column; + } + + list.splice(i, 1); + removed.push(next); + next = range; + i--; + } + + this.ranges = list; + + return removed; + }; + + this.contains = function(row, column) { + return this.pointIndex({row: row, column: column}) >= 0; + }; + + this.containsPoint = function(pos) { + return this.pointIndex(pos) >= 0; + }; + + this.rangeAtPoint = function(pos) { + var i = this.pointIndex(pos); + if (i >= 0) + return this.ranges[i]; + }; + + + this.clipRows = function(startRow, endRow) { + var list = this.ranges; + if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow) + return []; + + var startIndex = this.pointIndex({row: startRow, column: 0}); + if (startIndex < 0) + startIndex = -startIndex - 1; + var endIndex = this.pointIndex({row: endRow, column: 0}, startIndex); + if (endIndex < 0) + endIndex = -endIndex - 1; + + var clipped = []; + for (var i = startIndex; i < endIndex; i++) { + clipped.push(list[i]); + } + return clipped; + }; + + this.removeAll = function() { + return this.ranges.splice(0, this.ranges.length); + }; + + this.attach = function(session) { + if (this.session) + this.detach(); + + this.session = session; + this.onChange = this.$onChange.bind(this); + + this.session.on('change', this.onChange); + }; + + this.detach = function() { + if (!this.session) + return; + this.session.removeListener('change', this.onChange); + this.session = null; + }; + + this.$onChange = function(e) { + var changeRange = e.data.range; + if (e.data.action[0] == "i"){ + var start = changeRange.start; + var end = changeRange.end; + } else { + var end = changeRange.start; + var start = changeRange.end; + } + var startRow = start.row; + var endRow = end.row; + var lineDif = endRow - startRow; + + var colDiff = -start.column + end.column; + var ranges = this.ranges; + + for (var i = 0, n = ranges.length; i < n; i++) { + var r = ranges[i]; + if (r.end.row < startRow) + continue; + if (r.start.row > startRow) + break; + + if (r.start.row == startRow && r.start.column >= start.column ) { + if (r.start.column == start.column && this.$insertRight) { + } else { + r.start.column += colDiff; + r.start.row += lineDif; + } + } + if (r.end.row == startRow && r.end.column >= start.column) { + if (r.end.column == start.column && this.$insertRight) { + continue; + } + if (r.end.column == start.column && colDiff > 0 && i < n - 1) { + if (r.end.column > r.start.column && r.end.column == ranges[i+1].start.column) + r.end.column -= colDiff; + } + r.end.column += colDiff; + r.end.row += lineDif; + } + } + + if (lineDif != 0 && i < n) { + for (; i < n; i++) { + var r = ranges[i]; + r.start.row += lineDif; + r.end.row += lineDif; + } + } + }; + +}).call(RangeList.prototype); + +exports.RangeList = RangeList; +}); + +ace.define('ace/edit_session/bracket_match', ['require', 'exports', 'module' , 'ace/token_iterator', 'ace/range'], function(require, exports, module) { + + +var TokenIterator = require("../token_iterator").TokenIterator; +var Range = require("../range").Range; + + +function BracketMatch() { + + this.findMatchingBracket = function(position, chr) { + if (position.column == 0) return null; + + var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column-1); + if (charBeforeCursor == "") return null; + + var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); + if (!match) + return null; + + if (match[1]) + return this.$findClosingBracket(match[1], position); + else + return this.$findOpeningBracket(match[2], position); + }; + + this.getBracketRange = function(pos) { + var line = this.getLine(pos.row); + var before = true, range; + + var chr = line.charAt(pos.column-1); + var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + if (!match) { + chr = line.charAt(pos.column); + pos = {row: pos.row, column: pos.column + 1}; + match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + before = false; + } + if (!match) + return null; + + if (match[1]) { + var bracketPos = this.$findClosingBracket(match[1], pos); + if (!bracketPos) + return null; + range = Range.fromPoints(pos, bracketPos); + if (!before) { + range.end.column++; + range.start.column--; + } + range.cursor = range.end; + } else { + var bracketPos = this.$findOpeningBracket(match[2], pos); + if (!bracketPos) + return null; + range = Range.fromPoints(bracketPos, pos); + if (!before) { + range.start.column++; + range.end.column--; + } + range.cursor = range.start; + } + + return range; + }; + + this.$brackets = { + ")": "(", + "(": ")", + "]": "[", + "[": "]", + "{": "}", + "}": "{" + }; + + this.$findOpeningBracket = function(bracket, position, typeRe) { + var openBracket = this.$brackets[bracket]; + var depth = 1; + + var iterator = new TokenIterator(this, position.row, position.column); + var token = iterator.getCurrentToken(); + if (!token) + token = iterator.stepForward(); + if (!token) + return; + + if (!typeRe){ + typeRe = new RegExp( + "(\\.?" + + token.type.replace(".", "\\.").replace("rparen", ".paren") + + ")+" + ); + } + var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2; + var value = token.value; + + while (true) { + + while (valueIndex >= 0) { + var chr = value.charAt(valueIndex); + if (chr == openBracket) { + depth -= 1; + if (depth == 0) { + return {row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn()}; + } + } + else if (chr == bracket) { + depth += 1; + } + valueIndex -= 1; + } + do { + token = iterator.stepBackward(); + } while (token && !typeRe.test(token.type)); + + if (token == null) + break; + + value = token.value; + valueIndex = value.length - 1; + } + + return null; + }; + + this.$findClosingBracket = function(bracket, position, typeRe) { + var closingBracket = this.$brackets[bracket]; + var depth = 1; + + var iterator = new TokenIterator(this, position.row, position.column); + var token = iterator.getCurrentToken(); + if (!token) + token = iterator.stepForward(); + if (!token) + return; + + if (!typeRe){ + typeRe = new RegExp( + "(\\.?" + + token.type.replace(".", "\\.").replace("lparen", ".paren") + + ")+" + ); + } + var valueIndex = position.column - iterator.getCurrentTokenColumn(); + + while (true) { + + var value = token.value; + var valueLength = value.length; + while (valueIndex < valueLength) { + var chr = value.charAt(valueIndex); + if (chr == closingBracket) { + depth -= 1; + if (depth == 0) { + return {row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn()}; + } + } + else if (chr == bracket) { + depth += 1; + } + valueIndex += 1; + } + do { + token = iterator.stepForward(); + } while (token && !typeRe.test(token.type)); + + if (token == null) + break; + + valueIndex = 0; + } + + return null; + }; +} +exports.BracketMatch = BracketMatch; + +}); + +ace.define('ace/search', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/range'], function(require, exports, module) { + + +var lang = require("./lib/lang"); +var oop = require("./lib/oop"); +var Range = require("./range").Range; + +var Search = function() { + this.$options = {}; +}; + +(function() { + this.set = function(options) { + oop.mixin(this.$options, options); + return this; + }; + this.getOptions = function() { + return lang.copyObject(this.$options); + }; + this.setOptions = function(options) { + this.$options = options; + }; + this.find = function(session) { + var iterator = this.$matchIterator(session, this.$options); + + if (!iterator) + return false; + + var firstRange = null; + iterator.forEach(function(range, row, offset) { + if (!range.start) { + var column = range.offset + (offset || 0); + firstRange = new Range(row, column, row, column+range.length); + } else + firstRange = range; + return true; + }); + + return firstRange; + }; + this.findAll = function(session) { + var options = this.$options; + if (!options.needle) + return []; + this.$assembleRegExp(options); + + var range = options.range; + var lines = range + ? session.getLines(range.start.row, range.end.row) + : session.doc.getAllLines(); + + var ranges = []; + var re = options.re; + if (options.$isMultiLine) { + var len = re.length; + var maxRow = lines.length - len; + for (var row = re.offset || 0; row <= maxRow; row++) { + for (var j = 0; j < len; j++) + if (lines[row + j].search(re[j]) == -1) + break; + + var startLine = lines[row]; + var line = lines[row + len - 1]; + var startIndex = startLine.match(re[0])[0].length; + var endIndex = line.match(re[len - 1])[0].length; + + ranges.push(new Range( + row, startLine.length - startIndex, + row + len - 1, endIndex + )); + } + } else { + for (var i = 0; i < lines.length; i++) { + var matches = lang.getMatchOffsets(lines[i], re); + for (var j = 0; j < matches.length; j++) { + var match = matches[j]; + ranges.push(new Range(i, match.offset, i, match.offset + match.length)); + } + } + } + + if (range) { + var startColumn = range.start.column; + var endColumn = range.start.column; + var i = 0, j = ranges.length - 1; + while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == range.start.row) + i++; + + while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == range.end.row) + j--; + + ranges = ranges.slice(i, j + 1); + for (i = 0, j = ranges.length; i < j; i++) { + ranges[i].start.row += range.start.row; + ranges[i].end.row += range.start.row; + } + } + + return ranges; + }; + this.replace = function(input, replacement) { + var options = this.$options; + + var re = this.$assembleRegExp(options); + if (options.$isMultiLine) + return replacement; + + if (!re) + return; + + var match = re.exec(input); + if (!match || match[0].length != input.length) + return null; + + replacement = input.replace(re, replacement); + if (options.preserveCase) { + replacement = replacement.split(""); + for (var i = Math.min(input.length, input.length); i--; ) { + var ch = input[i]; + if (ch && ch.toLowerCase() != ch) + replacement[i] = replacement[i].toUpperCase(); + else + replacement[i] = replacement[i].toLowerCase(); + } + replacement = replacement.join(""); + } + + return replacement; + }; + + this.$matchIterator = function(session, options) { + var re = this.$assembleRegExp(options); + if (!re) + return false; + + var self = this, callback, backwards = options.backwards; + + if (options.$isMultiLine) { + var len = re.length; + var matchIterator = function(line, row, offset) { + var startIndex = line.search(re[0]); + if (startIndex == -1) + return; + for (var i = 1; i < len; i++) { + line = session.getLine(row + i); + if (line.search(re[i]) == -1) + return; + } + + var endIndex = line.match(re[len - 1])[0].length; + + var range = new Range(row, startIndex, row + len - 1, endIndex); + if (re.offset == 1) { + range.start.row--; + range.start.column = Number.MAX_VALUE; + } else if (offset) + range.start.column += offset; + + if (callback(range)) + return true; + }; + } else if (backwards) { + var matchIterator = function(line, row, startIndex) { + var matches = lang.getMatchOffsets(line, re); + for (var i = matches.length-1; i >= 0; i--) + if (callback(matches[i], row, startIndex)) + return true; + }; + } else { + var matchIterator = function(line, row, startIndex) { + var matches = lang.getMatchOffsets(line, re); + for (var i = 0; i < matches.length; i++) + if (callback(matches[i], row, startIndex)) + return true; + }; + } + + return { + forEach: function(_callback) { + callback = _callback; + self.$lineIterator(session, options).forEach(matchIterator); + } + }; + }; + + this.$assembleRegExp = function(options, $disableFakeMultiline) { + if (options.needle instanceof RegExp) + return options.re = options.needle; + + var needle = options.needle; + + if (!options.needle) + return options.re = false; + + if (!options.regExp) + needle = lang.escapeRegExp(needle); + + if (options.wholeWord) + needle = "\\b" + needle + "\\b"; + + var modifier = options.caseSensitive ? "g" : "gi"; + + options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle); + if (options.$isMultiLine) + return options.re = this.$assembleMultilineRegExp(needle, modifier); + + try { + var re = new RegExp(needle, modifier); + } catch(e) { + re = false; + } + return options.re = re; + }; + + this.$assembleMultilineRegExp = function(needle, modifier) { + var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n"); + var re = []; + for (var i = 0; i < parts.length; i++) try { + re.push(new RegExp(parts[i], modifier)); + } catch(e) { + return false; + } + if (parts[0] == "") { + re.shift(); + re.offset = 1; + } else { + re.offset = 0; + } + return re; + }; + + this.$lineIterator = function(session, options) { + var backwards = options.backwards == true; + var skipCurrent = options.skipCurrent != false; + + var range = options.range; + var start = options.start; + if (!start) + start = range ? range[backwards ? "end" : "start"] : session.selection.getRange(); + + if (start.start) + start = start[skipCurrent != backwards ? "end" : "start"]; + + var firstRow = range ? range.start.row : 0; + var lastRow = range ? range.end.row : session.getLength() - 1; + + var forEach = backwards ? function(callback) { + var row = start.row; + + var line = session.getLine(row).substring(0, start.column); + if (callback(line, row)) + return; + + for (row--; row >= firstRow; row--) + if (callback(session.getLine(row), row)) + return; + + if (options.wrap == false) + return; + + for (row = lastRow, firstRow = start.row; row >= firstRow; row--) + if (callback(session.getLine(row), row)) + return; + } : function(callback) { + var row = start.row; + + var line = session.getLine(row).substr(start.column); + if (callback(line, row, start.column)) + return; + + for (row = row+1; row <= lastRow; row++) + if (callback(session.getLine(row), row)) + return; + + if (options.wrap == false) + return; + + for (row = firstRow, lastRow = start.row; row <= lastRow; row++) + if (callback(session.getLine(row), row)) + return; + }; + + return {forEach: forEach}; + }; + +}).call(Search.prototype); + +exports.Search = Search; +}); +ace.define('ace/commands/command_manager', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/keyboard/hash_handler', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var HashHandler = require("../keyboard/hash_handler").HashHandler; +var EventEmitter = require("../lib/event_emitter").EventEmitter; + +var CommandManager = function(platform, commands) { + HashHandler.call(this, commands, platform); + this.byName = this.commands; + this.setDefaultHandler("exec", function(e) { + return e.command.exec(e.editor, e.args || {}); + }); +}; + +oop.inherits(CommandManager, HashHandler); + +(function() { + + oop.implement(this, EventEmitter); + + this.exec = function(command, editor, args) { + if (typeof command === 'string') + command = this.commands[command]; + + if (!command) + return false; + + if (editor && editor.$readOnly && !command.readOnly) + return false; + + var e = {editor: editor, command: command, args: args}; + var retvalue = this._emit("exec", e); + this._signal("afterExec", e); + + return retvalue === false ? false : true; + }; + + this.toggleRecording = function(editor) { + if (this.$inReplay) + return; + + editor && editor._emit("changeStatus"); + if (this.recording) { + this.macro.pop(); + this.removeEventListener("exec", this.$addCommandToMacro); + + if (!this.macro.length) + this.macro = this.oldMacro; + + return this.recording = false; + } + if (!this.$addCommandToMacro) { + this.$addCommandToMacro = function(e) { + this.macro.push([e.command, e.args]); + }.bind(this); + } + + this.oldMacro = this.macro; + this.macro = []; + this.on("exec", this.$addCommandToMacro); + return this.recording = true; + }; + + this.replay = function(editor) { + if (this.$inReplay || !this.macro) + return; + + if (this.recording) + return this.toggleRecording(editor); + + try { + this.$inReplay = true; + this.macro.forEach(function(x) { + if (typeof x == "string") + this.exec(x, editor); + else + this.exec(x[0], editor, x[1]); + }, this); + } finally { + this.$inReplay = false; + } + }; + + this.trimMacro = function(m) { + return m.map(function(x){ + if (typeof x[0] != "string") + x[0] = x[0].name; + if (!x[1]) + x = x[0]; + return x; + }); + }; + +}).call(CommandManager.prototype); + +exports.CommandManager = CommandManager; + +}); + +ace.define('ace/keyboard/hash_handler', ['require', 'exports', 'module' , 'ace/lib/keys', 'ace/lib/useragent'], function(require, exports, module) { + + +var keyUtil = require("../lib/keys"); +var useragent = require("../lib/useragent"); + +function HashHandler(config, platform) { + this.platform = platform || (useragent.isMac ? "mac" : "win"); + this.commands = {}; + this.commandKeyBinding = {}; + if (this.__defineGetter__ && this.__defineSetter__ && typeof console != "undefined" && console.error) { + var warned = false; + var warn = function() { + if (!warned) { + warned = true; + console.error("commmandKeyBinding has too many m's. use commandKeyBinding"); + } + }; + this.__defineGetter__("commmandKeyBinding", function() { + warn(); + return this.commandKeyBinding; + }); + this.__defineSetter__("commmandKeyBinding", function(val) { + warn(); + return this.commandKeyBinding = val; + }); + } else { + this.commmandKeyBinding = this.commandKeyBinding; + } + + this.addCommands(config); +}; + +(function() { + + this.addCommand = function(command) { + if (this.commands[command.name]) + this.removeCommand(command); + + this.commands[command.name] = command; + + if (command.bindKey) + this._buildKeyHash(command); + }; + + this.removeCommand = function(command) { + var name = (typeof command === 'string' ? command : command.name); + command = this.commands[name]; + delete this.commands[name]; + var ckb = this.commandKeyBinding; + for (var hashId in ckb) { + for (var key in ckb[hashId]) { + if (ckb[hashId][key] == command) + delete ckb[hashId][key]; + } + } + }; + + this.bindKey = function(key, command) { + if(!key) + return; + if (typeof command == "function") { + this.addCommand({exec: command, bindKey: key, name: command.name || key}); + return; + } + + var ckb = this.commandKeyBinding; + key.split("|").forEach(function(keyPart) { + var binding = this.parseKeys(keyPart, command); + var hashId = binding.hashId; + (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; + }, this); + }; + + this.addCommands = function(commands) { + commands && Object.keys(commands).forEach(function(name) { + var command = commands[name]; + if (!command) + return; + + if (typeof command === "string") + return this.bindKey(command, name); + + if (typeof command === "function") + command = { exec: command }; + + if (typeof command !== "object") + return; + + if (!command.name) + command.name = name; + + this.addCommand(command); + }, this); + }; + + this.removeCommands = function(commands) { + Object.keys(commands).forEach(function(name) { + this.removeCommand(commands[name]); + }, this); + }; + + this.bindKeys = function(keyList) { + Object.keys(keyList).forEach(function(key) { + this.bindKey(key, keyList[key]); + }, this); + }; + + this._buildKeyHash = function(command) { + var binding = command.bindKey; + if (!binding) + return; + + var key = typeof binding == "string" ? binding: binding[this.platform]; + this.bindKey(key, command); + }; + this.parseKeys = function(keys) { + if (keys.indexOf(" ") != -1) + keys = keys.split(/\s+/).pop(); + + var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x}); + var key = parts.pop(); + + var keyCode = keyUtil[key]; + if (keyUtil.FUNCTION_KEYS[keyCode]) + key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase(); + else if (!parts.length) + return {key: key, hashId: -1}; + else if (parts.length == 1 && parts[0] == "shift") + return {key: key.toUpperCase(), hashId: -1}; + + var hashId = 0; + for (var i = parts.length; i--;) { + var modifier = keyUtil.KEY_MODS[parts[i]]; + if (modifier == null) { + if (typeof console != "undefined") + console.error("invalid modifier " + parts[i] + " in " + keys); + return false; + } + hashId |= modifier; + } + return {key: key, hashId: hashId}; + }; + + this.findKeyCommand = function findKeyCommand(hashId, keyString) { + var ckbr = this.commandKeyBinding; + return ckbr[hashId] && ckbr[hashId][keyString]; + }; + + this.handleKeyboard = function(data, hashId, keyString, keyCode) { + return { + command: this.findKeyCommand(hashId, keyString) + }; + }; + +}).call(HashHandler.prototype) + +exports.HashHandler = HashHandler; +}); + +ace.define('ace/commands/default_commands', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/config'], function(require, exports, module) { + + +var lang = require("../lib/lang"); +var config = require("../config"); + +function bindKey(win, mac) { + return {win: win, mac: mac}; +} +exports.commands = [{ + name: "showSettingsMenu", + bindKey: bindKey("Ctrl-,", "Command-,"), + exec: function(editor) { + config.loadModule("ace/ext/settings_menu", function(module) { + module.init(editor); + editor.showSettingsMenu(); + }); + }, + readOnly: true +}, { + name: "goToNextError", + bindKey: bindKey("Alt-E", "Ctrl-E"), + exec: function(editor) { + config.loadModule("ace/ext/error_marker", function(module) { + module.showErrorMarker(editor, 1); + }); + }, + scrollIntoView: "center", + readOnly: true +}, { + name: "goToPreviousError", + bindKey: bindKey("Alt-Shift-E", "Ctrl-Shift-E"), + exec: function(editor) { + config.loadModule("ace/ext/error_marker", function(module) { + module.showErrorMarker(editor, -1); + }); + }, + scrollIntoView: "center", + readOnly: true +}, { + name: "selectall", + bindKey: bindKey("Ctrl-A", "Command-A"), + exec: function(editor) { editor.selectAll(); }, + readOnly: true +}, { + name: "centerselection", + bindKey: bindKey(null, "Ctrl-L"), + exec: function(editor) { editor.centerSelection(); }, + readOnly: true +}, { + name: "gotoline", + bindKey: bindKey("Ctrl-L", "Command-L"), + exec: function(editor) { + var line = parseInt(prompt("Enter line number:"), 10); + if (!isNaN(line)) { + editor.gotoLine(line); + } + }, + readOnly: true +}, { + name: "fold", + bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), + exec: function(editor) { editor.session.toggleFold(false); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "unfold", + bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), + exec: function(editor) { editor.session.toggleFold(true); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "toggleFoldWidget", + bindKey: bindKey("F2", "F2"), + exec: function(editor) { editor.session.toggleFoldWidget(); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "toggleParentFoldWidget", + bindKey: bindKey("Alt-F2", "Alt-F2"), + exec: function(editor) { editor.session.toggleFoldWidget(true); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "foldall", + bindKey: bindKey("Ctrl-Alt-0", "Ctrl-Command-Option-0"), + exec: function(editor) { editor.session.foldAll(); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "foldOther", + bindKey: bindKey("Alt-0", "Command-Option-0"), + exec: function(editor) { + editor.session.foldAll(); + editor.session.unfold(editor.selection.getAllRanges()); + }, + scrollIntoView: "center", + readOnly: true +}, { + name: "unfoldall", + bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"), + exec: function(editor) { editor.session.unfold(); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "findnext", + bindKey: bindKey("Ctrl-K", "Command-G"), + exec: function(editor) { editor.findNext(); }, + readOnly: true +}, { + name: "findprevious", + bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), + exec: function(editor) { editor.findPrevious(); }, + readOnly: true +}, { + name: "selectOrFindNext", + bindKey: bindKey("ALt-K", "Ctrl-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findNext(); + }, + readOnly: true +}, { + name: "selectOrFindPrevious", + bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findPrevious(); + }, + readOnly: true +}, { + name: "find", + bindKey: bindKey("Ctrl-F", "Command-F"), + exec: function(editor) { + config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor)}); + }, + readOnly: true +}, { + name: "overwrite", + bindKey: "Insert", + exec: function(editor) { editor.toggleOverwrite(); }, + readOnly: true +}, { + name: "selecttostart", + bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"), + exec: function(editor) { editor.getSelection().selectFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "gotostart", + bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), + exec: function(editor) { editor.navigateFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "selectup", + bindKey: bindKey("Shift-Up", "Shift-Up"), + exec: function(editor) { editor.getSelection().selectUp(); }, + multiSelectAction: "forEach", + readOnly: true +}, { + name: "golineup", + bindKey: bindKey("Up", "Up|Ctrl-P"), + exec: function(editor, args) { editor.navigateUp(args.times); }, + multiSelectAction: "forEach", + readOnly: true +}, { + name: "selecttoend", + bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"), + exec: function(editor) { editor.getSelection().selectFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "gotoend", + bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), + exec: function(editor) { editor.navigateFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "selectdown", + bindKey: bindKey("Shift-Down", "Shift-Down"), + exec: function(editor) { editor.getSelection().selectDown(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "golinedown", + bindKey: bindKey("Down", "Down|Ctrl-N"), + exec: function(editor, args) { editor.navigateDown(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectwordleft", + bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), + exec: function(editor) { editor.getSelection().selectWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotowordleft", + bindKey: bindKey("Ctrl-Left", "Option-Left"), + exec: function(editor) { editor.navigateWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selecttolinestart", + bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"), + exec: function(editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotolinestart", + bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), + exec: function(editor) { editor.navigateLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectleft", + bindKey: bindKey("Shift-Left", "Shift-Left"), + exec: function(editor) { editor.getSelection().selectLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotoleft", + bindKey: bindKey("Left", "Left|Ctrl-B"), + exec: function(editor, args) { editor.navigateLeft(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectwordright", + bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), + exec: function(editor) { editor.getSelection().selectWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotowordright", + bindKey: bindKey("Ctrl-Right", "Option-Right"), + exec: function(editor) { editor.navigateWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selecttolineend", + bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"), + exec: function(editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotolineend", + bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), + exec: function(editor) { editor.navigateLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectright", + bindKey: bindKey("Shift-Right", "Shift-Right"), + exec: function(editor) { editor.getSelection().selectRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotoright", + bindKey: bindKey("Right", "Right|Ctrl-F"), + exec: function(editor, args) { editor.navigateRight(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectpagedown", + bindKey: "Shift-PageDown", + exec: function(editor) { editor.selectPageDown(); }, + readOnly: true +}, { + name: "pagedown", + bindKey: bindKey(null, "Option-PageDown"), + exec: function(editor) { editor.scrollPageDown(); }, + readOnly: true +}, { + name: "gotopagedown", + bindKey: bindKey("PageDown", "PageDown|Ctrl-V"), + exec: function(editor) { editor.gotoPageDown(); }, + readOnly: true +}, { + name: "selectpageup", + bindKey: "Shift-PageUp", + exec: function(editor) { editor.selectPageUp(); }, + readOnly: true +}, { + name: "pageup", + bindKey: bindKey(null, "Option-PageUp"), + exec: function(editor) { editor.scrollPageUp(); }, + readOnly: true +}, { + name: "gotopageup", + bindKey: "PageUp", + exec: function(editor) { editor.gotoPageUp(); }, + readOnly: true +}, { + name: "scrollup", + bindKey: bindKey("Ctrl-Up", null), + exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true +}, { + name: "scrolldown", + bindKey: bindKey("Ctrl-Down", null), + exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true +}, { + name: "selectlinestart", + bindKey: "Shift-Home", + exec: function(editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + readOnly: true +}, { + name: "selectlineend", + bindKey: "Shift-End", + exec: function(editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + readOnly: true +}, { + name: "togglerecording", + bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"), + exec: function(editor) { editor.commands.toggleRecording(editor); }, + readOnly: true +}, { + name: "replaymacro", + bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"), + exec: function(editor) { editor.commands.replay(editor); }, + readOnly: true +}, { + name: "jumptomatching", + bindKey: bindKey("Ctrl-P", "Ctrl-Shift-P"), + exec: function(editor) { editor.jumpToMatching(); }, + multiSelectAction: "forEach", + readOnly: true +}, { + name: "selecttomatching", + bindKey: bindKey("Ctrl-Shift-P", null), + exec: function(editor) { editor.jumpToMatching(true); }, + multiSelectAction: "forEach", + readOnly: true +}, +{ + name: "cut", + exec: function(editor) { + var range = editor.getSelectionRange(); + editor._emit("cut", range); + + if (!editor.selection.isEmpty()) { + editor.session.remove(range); + editor.clearSelection(); + } + }, + multiSelectAction: "forEach" +}, { + name: "removeline", + bindKey: bindKey("Ctrl-D", "Command-D"), + exec: function(editor) { editor.removeLines(); }, + multiSelectAction: "forEachLine" +}, { + name: "duplicateSelection", + bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), + exec: function(editor) { editor.duplicateSelection(); }, + multiSelectAction: "forEach" +}, { + name: "sortlines", + bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), + exec: function(editor) { editor.sortLines(); }, + multiSelectAction: "forEachLine" +}, { + name: "togglecomment", + bindKey: bindKey("Ctrl-/", "Command-/"), + exec: function(editor) { editor.toggleCommentLines(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" +}, { + name: "toggleBlockComment", + bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), + exec: function(editor) { editor.toggleBlockComment(); }, + multiSelectAction: "forEach" +}, { + name: "modifyNumberUp", + bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), + exec: function(editor) { editor.modifyNumber(1); }, + multiSelectAction: "forEach" +}, { + name: "modifyNumberDown", + bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), + exec: function(editor) { editor.modifyNumber(-1); }, + multiSelectAction: "forEach" +}, { + name: "replace", + bindKey: bindKey("Ctrl-H", "Command-Option-F"), + exec: function(editor) { + config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true)}); + } +}, { + name: "undo", + bindKey: bindKey("Ctrl-Z", "Command-Z"), + exec: function(editor) { editor.undo(); } +}, { + name: "redo", + bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), + exec: function(editor) { editor.redo(); } +}, { + name: "copylinesup", + bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), + exec: function(editor) { editor.copyLinesUp(); } +}, { + name: "movelinesup", + bindKey: bindKey("Alt-Up", "Option-Up"), + exec: function(editor) { editor.moveLinesUp(); } +}, { + name: "copylinesdown", + bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), + exec: function(editor) { editor.copyLinesDown(); } +}, { + name: "movelinesdown", + bindKey: bindKey("Alt-Down", "Option-Down"), + exec: function(editor) { editor.moveLinesDown(); } +}, { + name: "del", + bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), + exec: function(editor) { editor.remove("right"); }, + multiSelectAction: "forEach" +}, { + name: "backspace", + bindKey: bindKey( + "Shift-Backspace|Backspace", + "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H" + ), + exec: function(editor) { editor.remove("left"); }, + multiSelectAction: "forEach" +}, { + name: "cut_or_delete", + bindKey: bindKey("Shift-Delete", null), + exec: function(editor) { + if (editor.selection.isEmpty()) { + editor.remove("left"); + } else { + return false; + } + }, + multiSelectAction: "forEach" +}, { + name: "removetolinestart", + bindKey: bindKey("Alt-Backspace", "Command-Backspace"), + exec: function(editor) { editor.removeToLineStart(); }, + multiSelectAction: "forEach" +}, { + name: "removetolineend", + bindKey: bindKey("Alt-Delete", "Ctrl-K"), + exec: function(editor) { editor.removeToLineEnd(); }, + multiSelectAction: "forEach" +}, { + name: "removewordleft", + bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), + exec: function(editor) { editor.removeWordLeft(); }, + multiSelectAction: "forEach" +}, { + name: "removewordright", + bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), + exec: function(editor) { editor.removeWordRight(); }, + multiSelectAction: "forEach" +}, { + name: "outdent", + bindKey: bindKey("Shift-Tab", "Shift-Tab"), + exec: function(editor) { editor.blockOutdent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" +}, { + name: "indent", + bindKey: bindKey("Tab", "Tab"), + exec: function(editor) { editor.indent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" +}, { + name: "blockoutdent", + bindKey: bindKey("Ctrl-[", "Ctrl-["), + exec: function(editor) { editor.blockOutdent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" +}, { + name: "blockindent", + bindKey: bindKey("Ctrl-]", "Ctrl-]"), + exec: function(editor) { editor.blockIndent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" +}, { + name: "insertstring", + exec: function(editor, str) { editor.insert(str); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "inserttext", + exec: function(editor, args) { + editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); + }, + multiSelectAction: "forEach" +}, { + name: "splitline", + bindKey: bindKey(null, "Ctrl-O"), + exec: function(editor) { editor.splitLine(); }, + multiSelectAction: "forEach" +}, { + name: "transposeletters", + bindKey: bindKey("Ctrl-T", "Ctrl-T"), + exec: function(editor) { editor.transposeLetters(); }, + multiSelectAction: function(editor) {editor.transposeSelections(1); } +}, { + name: "touppercase", + bindKey: bindKey("Ctrl-U", "Ctrl-U"), + exec: function(editor) { editor.toUpperCase(); }, + multiSelectAction: "forEach" +}, { + name: "tolowercase", + bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), + exec: function(editor) { editor.toLowerCase(); }, + multiSelectAction: "forEach" +}]; + +}); + +ace.define('ace/undomanager', ['require', 'exports', 'module' ], function(require, exports, module) { +var UndoManager = function() { + this.reset(); +}; + +(function() { + this.execute = function(options) { + var deltas = options.args[0]; + this.$doc = options.args[1]; + if (options.merge && this.hasUndo()){ + deltas = this.$undoStack.pop().concat(deltas); + } + this.$undoStack.push(deltas); + this.$redoStack = []; + + if (this.dirtyCounter < 0) { + this.dirtyCounter = NaN; + } + this.dirtyCounter++; + }; + this.undo = function(dontSelect) { + var deltas = this.$undoStack.pop(); + var undoSelectionRange = null; + if (deltas) { + undoSelectionRange = + this.$doc.undoChanges(deltas, dontSelect); + this.$redoStack.push(deltas); + this.dirtyCounter--; + } + + return undoSelectionRange; + }; + this.redo = function(dontSelect) { + var deltas = this.$redoStack.pop(); + var redoSelectionRange = null; + if (deltas) { + redoSelectionRange = + this.$doc.redoChanges(deltas, dontSelect); + this.$undoStack.push(deltas); + this.dirtyCounter++; + } + + return redoSelectionRange; + }; + this.reset = function() { + this.$undoStack = []; + this.$redoStack = []; + this.dirtyCounter = 0; + }; + this.hasUndo = function() { + return this.$undoStack.length > 0; + }; + this.hasRedo = function() { + return this.$redoStack.length > 0; + }; + this.markClean = function() { + this.dirtyCounter = 0; + }; + this.isClean = function() { + return this.dirtyCounter === 0; + }; + +}).call(UndoManager.prototype); + +exports.UndoManager = UndoManager; +}); + +ace.define('ace/virtual_renderer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/useragent', 'ace/config', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var useragent = require("./lib/useragent"); +var config = require("./config"); +var GutterLayer = require("./layer/gutter").Gutter; +var MarkerLayer = require("./layer/marker").Marker; +var TextLayer = require("./layer/text").Text; +var CursorLayer = require("./layer/cursor").Cursor; +var HScrollBar = require("./scrollbar").HScrollBar; +var VScrollBar = require("./scrollbar").VScrollBar; +var RenderLoop = require("./renderloop").RenderLoop; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var editorCss = ".ace_editor {\ +position: relative;\ +overflow: hidden;\ +font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\ +font-size: 12px;\ +line-height: normal;\ +color: black;\ +}\ +.ace_editor .ace_line {\ +direction: ltr;\ +unicode-bidi: bidi-override;\ +}\ +.ace_scroller {\ +position: absolute;\ +overflow: hidden;\ +top: 0;\ +bottom: 0;\ +background-color: inherit;\ +-ms-user-select: none;\ +-moz-user-select: none;\ +-webkit-user-select: none;\ +user-select: none;\ +}\ +.ace_content {\ +position: absolute;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +cursor: text;\ +min-width: 100%;\ +}\ +.ace_dragging, .ace_dragging * {\ +cursor: move !important;\ +}\ +.ace_dragging .ace_scroller:before{\ +position: absolute;\ +top: 0;\ +left: 0;\ +right: 0;\ +bottom: 0;\ +content: '';\ +background: rgba(250, 250, 250, 0.01);\ +z-index: 1000;\ +}\ +.ace_dragging.ace_dark .ace_scroller:before{\ +background: rgba(0, 0, 0, 0.01);\ +}\ +.ace_selecting, .ace_selecting * {\ +cursor: text !important;\ +}\ +.ace_gutter {\ +position: absolute;\ +overflow : hidden;\ +width: auto;\ +top: 0;\ +bottom: 0;\ +left: 0;\ +cursor: default;\ +z-index: 4;\ +}\ +.ace_gutter-active-line {\ +position: absolute;\ +left: 0;\ +right: 0;\ +}\ +.ace_scroller.ace_scroll-left {\ +box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\ +}\ +.ace_gutter-cell {\ +padding-left: 19px;\ +padding-right: 6px;\ +background-repeat: no-repeat;\ +}\ +.ace_gutter-cell.ace_error {\ +background-image: url(\"data:image/png;base64,iV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NTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkgXxbAAAAJbSURBVHjapFNNaBNBFH4zs5vdZLP5sQmNpT82QY209heh1ioWisaDRcSKF0WKJ0GQnrzrxasHsR6EnlrwD0TagxJabaVEpFYxLWlLSS822tr87m66ccfd2GKyVhA6MMybgfe97/vmPUQphd0sZjto9XIn9OOsvlu2nkqRzVU+6vvlzPf8W6bk8dxQ0NPbxAALgCgg2JkaQuhzQau/El0zbmUA7U0Es8v2CiYmKQJHGO1QICCLoqilMhkmurDAyapKgqItezi/USRdJqEYY4D5jCy03ht2yMkkvL91jTTX10qzyyu2hruPRN7jgbH+EOsXcMLgYiThEgAMhABW85oqy1DXdRIdvP1AHJ2acQXvDIrVHcdQNrEKNYSVMSZGMjEzIIAwDXIo+6G/FxcGnzkC3T2oMhLjre49sBB+RRcHLqdafK6sYdE/GGBwU1VpFNj0aN8pJbe+BkZyevUrvLl6Xmm0W9IuTc0DxrDNAJd5oEvI/KRsNC3bQyNjPO9yQ1YHcfj2QvfQc/5TUhJTBc2iM0U7AWDQtc1nJHvD/cfO2s7jaGkiTEfa/Ep8coLu7zmNmh8+dc5lZDuUeFAGUNA/OY6JVaypQ0vjr7XYjUvJM37vt+j1vuTK5DgVfVUoTjVe+y3/LxMxY2GgU+CSLy4cpfsYorRXuXIOi0Vt40h67uZFTdIo6nLaZcwUJWAzwNS0tBnqqKzQDnjdG/iPyZxo46HaKUpbvYkj8qYRTZsBhge+JHhZyh0x9b95JqjVJkT084kZIPwu/mPWqPgfQ5jXh2+92Ay7HedfAgwA6KDWafb4w3cAAAAASUVORK5CYII=\");\ +background-repeat: no-repeat;\ +background-position: 2px center;\ +}\ +.ace_gutter-cell.ace_warning {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hA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pEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pgd7PfIAAAGmSURBVHjaYvr//z8DJZiJgUIANoCRkREb9gLiSVAaQx4OQM7AAkwd7XU2/v++/rOttdYGEB9dASEvOMydGKfH8Gv/p4XTkvRBfLxeQAP+1cUhXopyvzhP7P/IoSj7g7Mw09cNKO6J1QQ0L4gICPIv/veg/8W+JdFvQNLHVsW9/nmn9zk7B+cCkDwhL7gt6knSZnx9/LuCEOcvkIAMP+cvto9nfqyZmmUAksfnBUtbM60gX/3/kgyv3/xSFOL5DZT+L8vP+Yfh5cvfPvp/xUHyQHXGyAYwgpwBjZYFT3Y1OEl/OfCH4ffv3wzc4iwMvNIsDJ+f/mH4+vIPAxsb631WW0Yln6ZpQLXdMK/DXGDflh+sIv37EivD5x//Gb7+YWT4y86sl7BCCkSD+Z++/1dkvsFRl+HnD1Rvje4F8whjMXmGj58YGf5zsDMwcnAwfPvKcml62DsQDeaDxN+/Y0qwlpEHqrdB94IRNIDUgfgfKJChGK4OikEW3gTiXUB950ASLFAF54AC94A0G9QAfOnmF9DCDzABFqS08IHYDIScdijOjQABBgC+/9awBH96jwAAAABJRU5ErkJggg==\");\ +background-position: 2px center;\ +}\ +.ace_gutter-cell.ace_info {\ +background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\ +background-position: 2px center;\ +}\ +.ace_dark .ace_gutter-cell.ace_info {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9h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mOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+SIDkjAAAAJ1JREFUeNpi/P//PwMlgImBQkB7A6qrq/+DMC55FkIGKCoq4pVnpFkgTp069f/+/fv/r1u37r+tre1/kg0A+ptn9uzZYLaRkRHpLvjw4cNXWVlZhufPnzOcO3eOdAO0tbVPAjHDmzdvGA4fPsxIsgGSkpJmv379Ynj37h2DjIyMCMkG3LhxQ/T27dsMampqDHZ2dq/pH41DxwCAAAMAFdc68dUsFZgAAAAASUVORK5CYII=\");\ +}\ +.ace_scrollbar {\ +position: absolute;\ +right: 0;\ +bottom: 0;\ +z-index: 6;\ +}\ +.ace_scrollbar-inner {\ +position: absolute;\ +cursor: text;\ +left: 0;\ +top: 0;\ +}\ +.ace_scrollbar-v{\ +overflow-x: hidden;\ +overflow-y: scroll;\ +top: 0;\ +}\ +.ace_scrollbar-h {\ +overflow-x: scroll;\ +overflow-y: hidden;\ +left: 0;\ +}\ +.ace_print-margin {\ +position: absolute;\ +height: 100%;\ +}\ +.ace_text-input {\ +position: absolute;\ +z-index: 0;\ +width: 0.5em;\ +height: 1em;\ +opacity: 0;\ +background: transparent;\ +-moz-appearance: none;\ +appearance: none;\ +border: none;\ +resize: none;\ +outline: none;\ +overflow: hidden;\ +font: inherit;\ +padding: 0 1px;\ +margin: 0 -1px;\ +text-indent: -1em;\ +-ms-user-select: text;\ +-moz-user-select: text;\ +-webkit-user-select: text;\ +user-select: text;\ +}\ +.ace_text-input.ace_composition {\ +background: #f8f8f8;\ +color: #111;\ +z-index: 1000;\ +opacity: 1;\ +text-indent: 0;\ +}\ +.ace_layer {\ +z-index: 1;\ +position: absolute;\ +overflow: hidden;\ +white-space: pre;\ +height: 100%;\ +width: 100%;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +/* setting pointer-events: auto; on node under the mouse, which changes\ +during scroll, will break mouse wheel scrolling in Safari */\ +pointer-events: none;\ +}\ +.ace_gutter-layer {\ +position: relative;\ +width: auto;\ +text-align: right;\ +pointer-events: auto;\ +}\ +.ace_text-layer {\ +font: inherit !important;\ +}\ +.ace_cjk {\ +display: inline-block;\ +text-align: center;\ +}\ +.ace_cursor-layer {\ +z-index: 4;\ +}\ +.ace_cursor {\ +z-index: 4;\ +position: absolute;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +border-left: 2px solid\ +}\ +.ace_slim-cursors .ace_cursor {\ +border-left-width: 1px;\ +}\ +.ace_overwrite-cursors .ace_cursor {\ +border-left-width: 0px;\ +border-bottom: 1px solid;\ +}\ +.ace_hidden-cursors .ace_cursor {\ +opacity: 0.2;\ +}\ +.ace_smooth-blinking .ace_cursor {\ +-moz-transition: opacity 0.18s;\ +-webkit-transition: opacity 0.18s;\ +-o-transition: opacity 0.18s;\ +-ms-transition: opacity 0.18s;\ +transition: opacity 0.18s;\ +}\ +.ace_cursor[style*=\"opacity: 0\"]{\ +-ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)\";\ +}\ +.ace_editor.ace_multiselect .ace_cursor {\ +border-left-width: 1px;\ +}\ +.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\ +position: absolute;\ +z-index: 3;\ +}\ +.ace_marker-layer .ace_selection {\ +position: absolute;\ +z-index: 5;\ +}\ +.ace_marker-layer .ace_bracket {\ +position: absolute;\ +z-index: 6;\ +}\ +.ace_marker-layer .ace_active-line {\ +position: absolute;\ +z-index: 2;\ +}\ +.ace_marker-layer .ace_selected-word {\ +position: absolute;\ +z-index: 4;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +}\ +.ace_line .ace_fold {\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +display: inline-block;\ +height: 11px;\ +margin-top: -2px;\ +vertical-align: middle;\ +background-image:\ +url(\"data:image/png,%89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%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\ +url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%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03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82\");\ +background-repeat: no-repeat, repeat-x;\ +background-position: center center, top left;\ +color: transparent;\ +border: 1px solid black;\ +-moz-border-radius: 2px;\ +-webkit-border-radius: 2px;\ +border-radius: 2px;\ +cursor: pointer;\ +pointer-events: auto;\ +}\ +.ace_dark .ace_fold {\ +}\ +.ace_fold:hover{\ +background-image:\ +url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EE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%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\ +url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08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\ +background-repeat: no-repeat, repeat-x;\ +background-position: center center, top left;\ +}\ +.ace_gutter-tooltip {\ +background-color: #FFF;\ +background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));\ +background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));\ +border: 1px solid gray;\ +border-radius: 1px;\ +box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\ +color: black;\ +display: inline-block;\ +max-width: 500px;\ +padding: 4px;\ +position: fixed;\ +z-index: 999999;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +cursor: default;\ +white-space: pre-line;\ +word-wrap: break-word;\ +line-height: normal;\ +font-style: normal;\ +font-weight: normal;\ +letter-spacing: normal;\ +}\ +.ace_folding-enabled > .ace_gutter-cell {\ +padding-right: 13px;\ +}\ +.ace_fold-widget {\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +margin: 0 -12px 0 1px;\ +display: none;\ +width: 11px;\ +vertical-align: top;\ +background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");\ +background-repeat: no-repeat;\ +background-position: center;\ +border-radius: 3px;\ +border: 1px solid transparent;\ +cursor: pointer;\ +}\ +.ace_folding-enabled .ace_fold-widget {\ +display: inline-block; \ +}\ +.ace_fold-widget.ace_end {\ +background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82\");\ +}\ +.ace_fold-widget.ace_closed {\ +background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82\");\ +}\ +.ace_fold-widget:hover {\ +border: 1px solid rgba(0, 0, 0, 0.3);\ +background-color: rgba(255, 255, 255, 0.2);\ +-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ +-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ +}\ +.ace_fold-widget:active {\ +border: 1px solid rgba(0, 0, 0, 0.4);\ +background-color: rgba(0, 0, 0, 0.05);\ +-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ +-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ +}\ +/**\ +* Dark version for fold widgets\ +*/\ +.ace_dark .ace_fold-widget {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\ +}\ +.ace_dark .ace_fold-widget.ace_end {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\ +}\ +.ace_dark .ace_fold-widget.ace_closed {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\ +}\ +.ace_dark .ace_fold-widget:hover {\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ +background-color: rgba(255, 255, 255, 0.1);\ +}\ +.ace_dark .ace_fold-widget:active {\ +-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ +-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ +}\ +.ace_fold-widget.ace_invalid {\ +background-color: #FFB4B4;\ +border-color: #DE5555;\ +}\ +.ace_fade-fold-widgets .ace_fold-widget {\ +-moz-transition: opacity 0.4s ease 0.05s;\ +-webkit-transition: opacity 0.4s ease 0.05s;\ +-o-transition: opacity 0.4s ease 0.05s;\ +-ms-transition: opacity 0.4s ease 0.05s;\ +transition: opacity 0.4s ease 0.05s;\ +opacity: 0;\ +}\ +.ace_fade-fold-widgets:hover .ace_fold-widget {\ +-moz-transition: opacity 0.05s ease 0.05s;\ +-webkit-transition: opacity 0.05s ease 0.05s;\ +-o-transition: opacity 0.05s ease 0.05s;\ +-ms-transition: opacity 0.05s ease 0.05s;\ +transition: opacity 0.05s ease 0.05s;\ +opacity:1;\ +}\ +.ace_underline {\ +text-decoration: underline;\ +}\ +.ace_bold {\ +font-weight: bold;\ +}\ +.ace_nobold .ace_bold {\ +font-weight: normal;\ +}\ +.ace_italic {\ +font-style: italic;\ +}\ +.ace_error-marker {\ +background-color: rgba(255, 0, 0,0.2);\ +position: absolute;\ +z-index: 9;\ +}\ +.ace_highlight-marker {\ +background-color: rgba(255, 255, 0,0.2);\ +position: absolute;\ +z-index: 8;\ +}\ +"; + +dom.importCssString(editorCss, "ace_editor"); + +var VirtualRenderer = function(container, theme) { + var _self = this; + + this.container = container || dom.createElement("div"); + this.$keepTextAreaAtCursor = true; + + dom.addCssClass(this.container, "ace_editor"); + + this.setTheme(theme); + + this.$gutter = dom.createElement("div"); + this.$gutter.className = "ace_gutter"; + this.container.appendChild(this.$gutter); + + this.scroller = dom.createElement("div"); + this.scroller.className = "ace_scroller"; + this.container.appendChild(this.scroller); + + this.content = dom.createElement("div"); + this.content.className = "ace_content"; + this.scroller.appendChild(this.content); + + this.$gutterLayer = new GutterLayer(this.$gutter); + this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); + + this.$markerBack = new MarkerLayer(this.content); + + var textLayer = this.$textLayer = new TextLayer(this.content); + this.canvas = textLayer.element; + + this.$markerFront = new MarkerLayer(this.content); + + this.$cursorLayer = new CursorLayer(this.content); + this.$horizScroll = false; + this.$vScroll = false; + + this.scrollBar = + this.scrollBarV = new VScrollBar(this.container, this); + this.scrollBarH = new HScrollBar(this.container, this); + this.scrollBarV.addEventListener("scroll", function(e) { + if (!_self.$scrollAnimation) + _self.session.setScrollTop(e.data - _self.scrollMargin.top); + }); + this.scrollBarH.addEventListener("scroll", function(e) { + if (!_self.$scrollAnimation) + _self.session.setScrollLeft(e.data - _self.scrollMargin.left); + }); + + this.scrollTop = 0; + this.scrollLeft = 0; + + this.cursorPos = { + row : 0, + column : 0 + }; + + this.$textLayer.addEventListener("changeCharacterSize", function() { + _self.updateCharacterSize(); + _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); + _self._signal("changeCharacterSize"); + }); + + this.$size = { + width: 0, + height: 0, + scrollerHeight: 0, + scrollerWidth: 0, + $dirty: true + }; + + this.layerConfig = { + width : 1, + padding : 0, + firstRow : 0, + firstRowScreen: 0, + lastRow : 0, + lineHeight : 0, + characterWidth : 0, + minHeight : 1, + maxHeight : 1, + offset : 0, + height : 1 + }; + + this.scrollMargin = { + left: 0, + right: 0, + top: 0, + bottom: 0, + v: 0, + h: 0 + }; + + this.$loop = new RenderLoop( + this.$renderChanges.bind(this), + this.container.ownerDocument.defaultView + ); + this.$loop.schedule(this.CHANGE_FULL); + + this.updateCharacterSize(); + this.setPadding(4); + config.resetOptions(this); + config._emit("renderer", this); +}; + +(function() { + + this.CHANGE_CURSOR = 1; + this.CHANGE_MARKER = 2; + this.CHANGE_GUTTER = 4; + this.CHANGE_SCROLL = 8; + this.CHANGE_LINES = 16; + this.CHANGE_TEXT = 32; + this.CHANGE_SIZE = 64; + this.CHANGE_MARKER_BACK = 128; + this.CHANGE_MARKER_FRONT = 256; + this.CHANGE_FULL = 512; + this.CHANGE_H_SCROLL = 1024; + + oop.implement(this, EventEmitter); + + this.updateCharacterSize = function() { + if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) { + this.$allowBoldFonts = this.$textLayer.allowBoldFonts; + this.setStyle("ace_nobold", !this.$allowBoldFonts); + } + + this.layerConfig.characterWidth = + this.characterWidth = this.$textLayer.getCharacterWidth(); + this.layerConfig.lineHeight = + this.lineHeight = this.$textLayer.getLineHeight(); + this.$updatePrintMargin(); + }; + this.setSession = function(session) { + this.session = session; + + if (this.scrollMargin.top && session.getScrollTop() <= 0) + session.setScrollTop(-this.scrollMargin.top); + + this.$cursorLayer.setSession(session); + this.$markerBack.setSession(session); + this.$markerFront.setSession(session); + this.$gutterLayer.setSession(session); + this.$textLayer.setSession(session); + this.$loop.schedule(this.CHANGE_FULL); + }; + this.updateLines = function(firstRow, lastRow) { + if (lastRow === undefined) + lastRow = Infinity; + + if (!this.$changedLines) { + this.$changedLines = { + firstRow: firstRow, + lastRow: lastRow + }; + } + else { + if (this.$changedLines.firstRow > firstRow) + this.$changedLines.firstRow = firstRow; + + if (this.$changedLines.lastRow < lastRow) + this.$changedLines.lastRow = lastRow; + } + + if (this.$changedLines.firstRow > this.layerConfig.lastRow || + this.$changedLines.lastRow < this.layerConfig.firstRow) + return; + this.$loop.schedule(this.CHANGE_LINES); + }; + + this.onChangeTabSize = function() { + this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); + this.$textLayer.onChangeTabSize(); + }; + this.updateText = function() { + this.$loop.schedule(this.CHANGE_TEXT); + }; + this.updateFull = function(force) { + if (force) + this.$renderChanges(this.CHANGE_FULL, true); + else + this.$loop.schedule(this.CHANGE_FULL); + }; + this.updateFontSize = function() { + this.$textLayer.checkForSizeChanges(); + }; + + this.$changes = 0; + this.$updateSizeAsync = function() { + if (this.$loop.pending) + this.$size.$dirty = true; + else + this.onResize(); + }; + this.onResize = function(force, gutterWidth, width, height) { + if (this.resizing > 2) + return; + else if (this.resizing > 0) + this.resizing++; + else + this.resizing = force ? 1 : 0; + var el = this.container; + if (!height) + height = el.clientHeight || el.scrollHeight; + if (!width) + width = el.clientWidth || el.scrollWidth; + var changes = this.$updateCachedSize(force, gutterWidth, width, height); + + if (!this.$size.scrollerHeight || (!width && !height)) + return this.resizing = 0; + + if (force) + this.$gutterLayer.$padding = null; + + if (force) + this.$renderChanges(changes | this.$changes, true); + else + this.$loop.schedule(changes | this.$changes); + + if (this.resizing) + this.resizing = 0; + }; + + this.$updateCachedSize = function(force, gutterWidth, width, height) { + height -= (this.$extraHeight || 0); + var changes = 0; + var size = this.$size; + var oldSize = { + width: size.width, + height: size.height, + scrollerHeight: size.scrollerHeight, + scrollerWidth: size.scrollerWidth + }; + if (height && (force || size.height != height)) { + size.height = height; + changes = this.CHANGE_SIZE; + + size.scrollerHeight = size.height; + if (this.$horizScroll) + size.scrollerHeight -= this.scrollBarH.getHeight(); + this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px"; + + if (this.session) { + changes = changes | this.CHANGE_SCROLL; + } + } + + if (width && (force || size.width != width)) { + changes = this.CHANGE_SIZE; + size.width = width; + + if (gutterWidth == null) + gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; + + this.gutterWidth = gutterWidth; + + this.scrollBarH.element.style.left = + this.scroller.style.left = gutterWidth + "px"; + size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth()); + + this.scrollBarH.element.style.right = + this.scroller.style.right = this.scrollBarV.getWidth() + "px"; + this.scroller.style.bottom = this.scrollBarH.getHeight() + "px"; + + if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) + changes = changes | this.CHANGE_FULL; + } + + size.$dirty = !width || !height; + + if (changes) + this._signal("resize", oldSize); + + return changes; + }; + + this.onGutterResize = function() { + var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; + if (gutterWidth != this.gutterWidth) + this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height); + + if (this.session.getUseWrapMode() && this.adjustWrapLimit()) { + this.$loop.schedule(this.CHANGE_FULL); + } else if (this.$size.$dirty) { + this.$loop.schedule(this.CHANGE_FULL); + } else { + this.$computeLayerConfig(); + this.$loop.schedule(this.CHANGE_MARKER); + } + }; + this.adjustWrapLimit = function() { + var availableWidth = this.$size.scrollerWidth - this.$padding * 2; + var limit = Math.floor(availableWidth / this.characterWidth); + return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn); + }; + this.setAnimatedScroll = function(shouldAnimate){ + this.setOption("animatedScroll", shouldAnimate); + }; + this.getAnimatedScroll = function() { + return this.$animatedScroll; + }; + this.setShowInvisibles = function(showInvisibles) { + this.setOption("showInvisibles", showInvisibles); + }; + this.getShowInvisibles = function() { + return this.getOption("showInvisibles"); + }; + this.getDisplayIndentGuides = function() { + return this.getOption("displayIndentGuides"); + }; + + this.setDisplayIndentGuides = function(display) { + this.setOption("displayIndentGuides", display); + }; + this.setShowPrintMargin = function(showPrintMargin) { + this.setOption("showPrintMargin", showPrintMargin); + }; + this.getShowPrintMargin = function() { + return this.getOption("showPrintMargin"); + }; + this.setPrintMarginColumn = function(showPrintMargin) { + this.setOption("printMarginColumn", showPrintMargin); + }; + this.getPrintMarginColumn = function() { + return this.getOption("printMarginColumn"); + }; + this.getShowGutter = function(){ + return this.getOption("showGutter"); + }; + this.setShowGutter = function(show){ + return this.setOption("showGutter", show); + }; + + this.getFadeFoldWidgets = function(){ + return this.getOption("fadeFoldWidgets") + }; + + this.setFadeFoldWidgets = function(show) { + this.setOption("fadeFoldWidgets", show); + }; + + this.setHighlightGutterLine = function(shouldHighlight) { + this.setOption("highlightGutterLine", shouldHighlight); + }; + + this.getHighlightGutterLine = function() { + return this.getOption("highlightGutterLine"); + }; + + this.$updateGutterLineHighlight = function() { + var pos = this.$cursorLayer.$pixelPos; + var height = this.layerConfig.lineHeight; + if (this.session.getUseWrapMode()) { + var cursor = this.session.selection.getCursor(); + cursor.column = 0; + pos = this.$cursorLayer.getPixelPosition(cursor, true); + height *= this.session.getRowLength(cursor.row); + } + this.$gutterLineHighlight.style.top = pos.top - this.layerConfig.offset + "px"; + this.$gutterLineHighlight.style.height = height + "px"; + }; + + this.$updatePrintMargin = function() { + if (!this.$showPrintMargin && !this.$printMarginEl) + return; + + if (!this.$printMarginEl) { + var containerEl = dom.createElement("div"); + containerEl.className = "ace_layer ace_print-margin-layer"; + this.$printMarginEl = dom.createElement("div"); + this.$printMarginEl.className = "ace_print-margin"; + containerEl.appendChild(this.$printMarginEl); + this.content.insertBefore(containerEl, this.content.firstChild); + } + + var style = this.$printMarginEl.style; + style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px"; + style.visibility = this.$showPrintMargin ? "visible" : "hidden"; + + if (this.session && this.session.$wrap == -1) + this.adjustWrapLimit(); + }; + this.getContainerElement = function() { + return this.container; + }; + this.getMouseEventTarget = function() { + return this.content; + }; + this.getTextAreaContainer = function() { + return this.container; + }; + this.$moveTextAreaToCursor = function() { + if (!this.$keepTextAreaAtCursor) + return; + var config = this.layerConfig; + var posTop = this.$cursorLayer.$pixelPos.top; + var posLeft = this.$cursorLayer.$pixelPos.left; + posTop -= config.offset; + + var h = this.lineHeight; + if (posTop < 0 || posTop > config.height - h) + return; + + var w = this.characterWidth; + if (this.$composition) { + var val = this.textarea.value.replace(/^\x01+/, ""); + w *= (this.session.$getStringScreenWidth(val)[0]+2); + h += 2; + posTop -= 1; + } + posLeft -= this.scrollLeft; + if (posLeft > this.$size.scrollerWidth - w) + posLeft = this.$size.scrollerWidth - w; + + posLeft -= this.scrollBar.width; + + this.textarea.style.height = h + "px"; + this.textarea.style.width = w + "px"; + this.textarea.style.right = Math.max(0, this.$size.scrollerWidth - posLeft - w) + "px"; + this.textarea.style.bottom = Math.max(0, this.$size.height - posTop - h) + "px"; + }; + this.getFirstVisibleRow = function() { + return this.layerConfig.firstRow; + }; + this.getFirstFullyVisibleRow = function() { + return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); + }; + this.getLastFullyVisibleRow = function() { + var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight); + return this.layerConfig.firstRow - 1 + flint; + }; + this.getLastVisibleRow = function() { + return this.layerConfig.lastRow; + }; + + this.$padding = null; + this.setPadding = function(padding) { + this.$padding = padding; + this.$textLayer.setPadding(padding); + this.$cursorLayer.setPadding(padding); + this.$markerFront.setPadding(padding); + this.$markerBack.setPadding(padding); + this.$loop.schedule(this.CHANGE_FULL); + this.$updatePrintMargin(); + }; + + this.setScrollMargin = function(top, bottom, left, right) { + var sm = this.scrollMargin; + sm.top = top|0; + sm.bottom = bottom|0; + sm.right = right|0; + sm.left = left|0; + sm.v = sm.top + sm.bottom; + sm.h = sm.left + sm.right; + if (sm.top && this.scrollTop <= 0 && this.session) + this.session.setScrollTop(sm.top); + this.updateFull(); + }; + this.getHScrollBarAlwaysVisible = function() { + return this.$hScrollBarAlwaysVisible; + }; + this.setHScrollBarAlwaysVisible = function(alwaysVisible) { + this.setOption("hScrollBarAlwaysVisible", alwaysVisible); + }; + this.getVScrollBarAlwaysVisible = function() { + return this.$hScrollBarAlwaysVisible; + }; + this.setVScrollBarAlwaysVisible = function(alwaysVisible) { + this.setOption("vScrollBarAlwaysVisible", alwaysVisible); + }; + + this.$updateScrollBarV = function() { + this.scrollBarV.setScrollHeight(this.layerConfig.maxHeight + this.scrollMargin.v); + this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top); + }; + this.$updateScrollBarH = function() { + this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h); + this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left); + }; + + this.$frozen = false; + this.freeze = function() { + this.$frozen = true; + }; + + this.unfreeze = function() { + this.$frozen = false; + }; + + this.$renderChanges = function(changes, force) { + if (this.$changes) { + changes |= this.$changes; + this.$changes = 0; + } + if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) { + this.$changes |= changes; + return; + } + if (this.$size.$dirty) { + this.$changes |= changes; + return this.onResize(true); + } + if (!this.lineHeight) { + this.$textLayer.checkForSizeChanges(); + } + + this._signal("beforeRender"); + var config = this.layerConfig; + if (changes & this.CHANGE_FULL || + changes & this.CHANGE_SIZE || + changes & this.CHANGE_TEXT || + changes & this.CHANGE_LINES || + changes & this.CHANGE_SCROLL || + changes & this.CHANGE_H_SCROLL + ) { + changes |= this.$computeLayerConfig(); + config = this.layerConfig; + this.$updateScrollBarV(); + if (changes & this.CHANGE_H_SCROLL) + this.$updateScrollBarH(); + this.$gutterLayer.element.style.marginTop = (-config.offset) + "px"; + this.content.style.marginTop = (-config.offset) + "px"; + this.content.style.width = config.width + 2 * this.$padding + "px"; + this.content.style.height = config.minHeight + "px"; + } + if (changes & this.CHANGE_H_SCROLL) { + this.content.style.marginLeft = -this.scrollLeft + "px"; + this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"; + } + if (changes & this.CHANGE_FULL) { + this.$textLayer.update(config); + if (this.$showGutter) + this.$gutterLayer.update(config); + this.$markerBack.update(config); + this.$markerFront.update(config); + this.$cursorLayer.update(config); + this.$moveTextAreaToCursor(); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + this._signal("afterRender"); + return; + } + if (changes & this.CHANGE_SCROLL) { + if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) + this.$textLayer.update(config); + else + this.$textLayer.scrollLines(config); + + if (this.$showGutter) + this.$gutterLayer.update(config); + this.$markerBack.update(config); + this.$markerFront.update(config); + this.$cursorLayer.update(config); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + this.$moveTextAreaToCursor(); + this._signal("afterRender"); + return; + } + + if (changes & this.CHANGE_TEXT) { + this.$textLayer.update(config); + if (this.$showGutter) + this.$gutterLayer.update(config); + } + else if (changes & this.CHANGE_LINES) { + if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter) + this.$gutterLayer.update(config); + } + else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) { + if (this.$showGutter) + this.$gutterLayer.update(config); + } + + if (changes & this.CHANGE_CURSOR) { + this.$cursorLayer.update(config); + this.$moveTextAreaToCursor(); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + } + + if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { + this.$markerFront.update(config); + } + + if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { + this.$markerBack.update(config); + } + + this._signal("afterRender"); + }; + + + this.$autosize = function() { + var height = this.session.getScreenLength() * this.lineHeight; + var maxHeight = this.$maxLines * this.lineHeight; + var desiredHeight = Math.max( + (this.$minLines||1) * this.lineHeight, + Math.min(maxHeight, height) + ) + this.scrollMargin.v + (this.$extraHeight || 0); + var vScroll = height > maxHeight; + + if (desiredHeight != this.desiredHeight || + this.$size.height != this.desiredHeight || vScroll != this.$vScroll) { + if (vScroll != this.$vScroll) { + this.$vScroll = vScroll; + this.scrollBarV.setVisible(vScroll); + } + + var w = this.container.clientWidth; + this.container.style.height = desiredHeight + "px"; + this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight); + this.desiredHeight = desiredHeight; + } + }; + + this.$computeLayerConfig = function() { + if (this.$maxLines && this.lineHeight > 1) + this.$autosize(); + + var session = this.session; + + var hideScrollbars = this.$size.height <= 2 * this.lineHeight; + var screenLines = this.session.getScreenLength(); + var maxHeight = screenLines * this.lineHeight; + + var offset = this.scrollTop % this.lineHeight; + var minHeight = this.$size.scrollerHeight + this.lineHeight; + + var longestLine = this.$getLongestLine(); + + var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || + this.$size.scrollerWidth - longestLine - 2 * this.$padding < 0); + + var hScrollChanged = this.$horizScroll !== horizScroll; + if (hScrollChanged) { + this.$horizScroll = horizScroll; + this.scrollBarH.setVisible(horizScroll); + } + + if (!this.$maxLines && this.$scrollPastEnd) { + if (this.scrollTop > maxHeight - this.$size.scrollerHeight) + maxHeight += Math.min( + (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd, + this.scrollTop - maxHeight + this.$size.scrollerHeight + ); + } + + var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || + this.$size.scrollerHeight - maxHeight < 0); + var vScrollChanged = this.$vScroll !== vScroll; + if (vScrollChanged) { + this.$vScroll = vScroll; + this.scrollBarV.setVisible(vScroll); + } + + this.session.setScrollTop(Math.max(-this.scrollMargin.top, + Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight + this.scrollMargin.v))); + + this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft, + longestLine + 2 * this.$padding - this.$size.scrollerWidth + this.scrollMargin.h))); + + var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; + var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); + var lastRow = firstRow + lineCount; + var firstRowScreen, firstRowHeight; + var lineHeight = this.lineHeight; + firstRow = session.screenToDocumentRow(firstRow, 0); + var foldLine = session.getFoldLine(firstRow); + if (foldLine) { + firstRow = foldLine.start.row; + } + + firstRowScreen = session.documentToScreenRow(firstRow, 0); + firstRowHeight = session.getRowLength(firstRow) * lineHeight; + + lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); + minHeight = this.$size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + + firstRowHeight; + + offset = this.scrollTop - firstRowScreen * lineHeight; + + var changes = 0; + if (hScrollChanged || vScrollChanged) { + changes = this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height); + this._signal("scrollbarVisibilityChanged"); + if (vScrollChanged) + longestLine = this.$getLongestLine(); + } + + this.layerConfig = { + width : longestLine, + padding : this.$padding, + firstRow : firstRow, + firstRowScreen: firstRowScreen, + lastRow : lastRow, + lineHeight : lineHeight, + characterWidth : this.characterWidth, + minHeight : minHeight, + maxHeight : maxHeight, + offset : offset, + height : this.$size.scrollerHeight + }; + + return changes; + }; + + this.$updateLines = function() { + var firstRow = this.$changedLines.firstRow; + var lastRow = this.$changedLines.lastRow; + this.$changedLines = null; + + var layerConfig = this.layerConfig; + + if (firstRow > layerConfig.lastRow + 1) { return; } + if (lastRow < layerConfig.firstRow) { return; } + if (lastRow === Infinity) { + if (this.$showGutter) + this.$gutterLayer.update(layerConfig); + this.$textLayer.update(layerConfig); + return; + } + this.$textLayer.updateLines(layerConfig, firstRow, lastRow); + return true; + }; + + this.$getLongestLine = function() { + var charCount = this.session.getScreenWidth(); + if (this.showInvisibles && !this.session.$useWrapMode) + charCount += 1; + + return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth)); + }; + this.updateFrontMarkers = function() { + this.$markerFront.setMarkers(this.session.getMarkers(true)); + this.$loop.schedule(this.CHANGE_MARKER_FRONT); + }; + this.updateBackMarkers = function() { + this.$markerBack.setMarkers(this.session.getMarkers()); + this.$loop.schedule(this.CHANGE_MARKER_BACK); + }; + this.addGutterDecoration = function(row, className){ + this.$gutterLayer.addGutterDecoration(row, className); + }; + this.removeGutterDecoration = function(row, className){ + this.$gutterLayer.removeGutterDecoration(row, className); + }; + this.updateBreakpoints = function(rows) { + this.$loop.schedule(this.CHANGE_GUTTER); + }; + this.setAnnotations = function(annotations) { + this.$gutterLayer.setAnnotations(annotations); + this.$loop.schedule(this.CHANGE_GUTTER); + }; + this.updateCursor = function() { + this.$loop.schedule(this.CHANGE_CURSOR); + }; + this.hideCursor = function() { + this.$cursorLayer.hideCursor(); + }; + this.showCursor = function() { + this.$cursorLayer.showCursor(); + }; + + this.scrollSelectionIntoView = function(anchor, lead, offset) { + this.scrollCursorIntoView(anchor, offset); + this.scrollCursorIntoView(lead, offset); + }; + this.scrollCursorIntoView = function(cursor, offset) { + if (this.$size.scrollerHeight === 0) + return; + + var pos = this.$cursorLayer.getPixelPosition(cursor); + + var left = pos.left; + var top = pos.top; + + var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; + + if (scrollTop > top) { + if (offset) + top -= offset * this.$size.scrollerHeight; + if (top == 0) + top = - this.scrollMargin.top; + else if (top == 0) + top = + this.scrollMargin.bottom; + this.session.setScrollTop(top); + } else if (scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + if (offset) + top += offset * this.$size.scrollerHeight; + this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); + } + + var scrollLeft = this.scrollLeft; + + if (scrollLeft > left) { + if (left < this.$padding + 2 * this.layerConfig.characterWidth) + left = -this.scrollMargin.left; + this.session.setScrollLeft(left); + } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { + this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); + } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) { + this.session.setScrollLeft(0); + } + }; + this.getScrollTop = function() { + return this.session.getScrollTop(); + }; + this.getScrollLeft = function() { + return this.session.getScrollLeft(); + }; + this.getScrollTopRow = function() { + return this.scrollTop / this.lineHeight; + }; + this.getScrollBottomRow = function() { + return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); + }; + this.scrollToRow = function(row) { + this.session.setScrollTop(row * this.lineHeight); + }; + + this.alignCursor = function(cursor, alignment) { + if (typeof cursor == "number") + cursor = {row: cursor, column: 0}; + + var pos = this.$cursorLayer.getPixelPosition(cursor); + var h = this.$size.scrollerHeight - this.lineHeight; + var offset = pos.top - h * (alignment || 0); + + this.session.setScrollTop(offset); + return offset; + }; + + this.STEPS = 8; + this.$calcSteps = function(fromValue, toValue){ + var i = 0; + var l = this.STEPS; + var steps = []; + + var func = function(t, x_min, dx) { + return dx * (Math.pow(t - 1, 3) + 1) + x_min; + }; + + for (i = 0; i < l; ++i) + steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); + + return steps; + }; + this.scrollToLine = function(line, center, animate, callback) { + var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); + var offset = pos.top; + if (center) + offset -= this.$size.scrollerHeight / 2; + + var initialScroll = this.scrollTop; + this.session.setScrollTop(offset); + if (animate !== false) + this.animateScrolling(initialScroll, callback); + }; + + this.animateScrolling = function(fromValue, callback) { + var toValue = this.scrollTop; + if (!this.$animatedScroll) + return; + var _self = this; + + if (fromValue == toValue) + return; + + if (this.$scrollAnimation) { + var oldSteps = this.$scrollAnimation.steps; + if (oldSteps.length) { + fromValue = oldSteps[0]; + if (fromValue == toValue) + return; + } + } + + var steps = _self.$calcSteps(fromValue, toValue); + this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; + + clearInterval(this.$timer); + + _self.session.setScrollTop(steps.shift()); + _self.session.$scrollTop = toValue; + this.$timer = setInterval(function() { + if (steps.length) { + _self.session.setScrollTop(steps.shift()); + _self.session.$scrollTop = toValue; + } else if (toValue != null) { + _self.session.$scrollTop = -1; + _self.session.setScrollTop(toValue); + toValue = null; + } else { + _self.$timer = clearInterval(_self.$timer); + _self.$scrollAnimation = null; + callback && callback(); + } + }, 10); + }; + this.scrollToY = function(scrollTop) { + if (this.scrollTop !== scrollTop) { + this.$loop.schedule(this.CHANGE_SCROLL); + this.scrollTop = scrollTop; + } + }; + this.scrollToX = function(scrollLeft) { + if (this.scrollLeft !== scrollLeft) + this.scrollLeft = scrollLeft; + this.$loop.schedule(this.CHANGE_H_SCROLL); + }; + this.scrollTo = function(x, y) { + this.session.setScrollTop(y); + this.session.setScrollLeft(y); + }; + this.scrollBy = function(deltaX, deltaY) { + deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY); + deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX); + }; + this.isScrollableBy = function(deltaX, deltaY) { + if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) + return true; + if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight + - this.layerConfig.maxHeight - (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd + < -1 + this.scrollMargin.bottom) + return true; + if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) + return true; + if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth + - this.layerConfig.width < -1 + this.scrollMargin.right) + return true; + }; + + this.pixelToScreenCoordinates = function(x, y) { + var canvasPos = this.scroller.getBoundingClientRect(); + + var offset = (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth; + var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight); + var col = Math.round(offset); + + return {row: row, column: col, side: offset - col > 0 ? 1 : -1}; + }; + + this.screenToTextCoordinates = function(x, y) { + var canvasPos = this.scroller.getBoundingClientRect(); + + var col = Math.round( + (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth + ); + + var row = (y + this.scrollTop - canvasPos.top) / this.lineHeight; + + return this.session.screenToDocumentPosition(row, Math.max(col, 0)); + }; + this.textToScreenCoordinates = function(row, column) { + var canvasPos = this.scroller.getBoundingClientRect(); + var pos = this.session.documentToScreenPosition(row, column); + + var x = this.$padding + Math.round(pos.column * this.characterWidth); + var y = pos.row * this.lineHeight; + + return { + pageX: canvasPos.left + x - this.scrollLeft, + pageY: canvasPos.top + y - this.scrollTop + }; + }; + this.visualizeFocus = function() { + dom.addCssClass(this.container, "ace_focus"); + }; + this.visualizeBlur = function() { + dom.removeCssClass(this.container, "ace_focus"); + }; + this.showComposition = function(position) { + if (!this.$composition) + this.$composition = { + keepTextAreaAtCursor: this.$keepTextAreaAtCursor, + cssText: this.textarea.style.cssText + }; + + this.$keepTextAreaAtCursor = true; + dom.addCssClass(this.textarea, "ace_composition"); + this.textarea.style.cssText = ""; + this.$moveTextAreaToCursor(); + }; + this.setCompositionText = function(text) { + this.$moveTextAreaToCursor(); + }; + this.hideComposition = function() { + if (!this.$composition) + return; + + dom.removeCssClass(this.textarea, "ace_composition"); + this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor; + this.textarea.style.cssText = this.$composition.cssText; + this.$composition = null; + }; + this.setTheme = function(theme, cb) { + var _self = this; + this.$themeId = theme; + _self._dispatchEvent('themeChange',{theme:theme}); + + if (!theme || typeof theme == "string") { + var moduleName = theme || this.$options.theme.initialValue; + config.loadModule(["theme", moduleName], afterLoad); + } else { + afterLoad(theme); + } + + function afterLoad(module) { + if (_self.$themeId != theme) + return cb && cb(); + if (!module.cssClass) + return; + dom.importCssString( + module.cssText, + module.cssClass, + _self.container.ownerDocument + ); + + if (_self.theme) + dom.removeCssClass(_self.container, _self.theme.cssClass); + + var padding = "padding" in module ? module.padding + : "padding" in (_self.theme || {}) ? 4 : _self.$padding; + if (_self.$padding && padding != _self.$padding) + _self.setPadding(padding); + _self.$theme = module.cssClass; + + _self.theme = module; + dom.addCssClass(_self.container, module.cssClass); + dom.setCssClass(_self.container, "ace_dark", module.isDark); + if (_self.$size) { + _self.$size.width = 0; + _self.$updateSizeAsync(); + } + + _self._dispatchEvent('themeLoaded', {theme:module}); + cb && cb(); + } + }; + this.getTheme = function() { + return this.$themeId; + }; + this.setStyle = function(style, include) { + dom.setCssClass(this.container, style, include !== false); + }; + this.unsetStyle = function(style) { + dom.removeCssClass(this.container, style); + }; + + this.setCursorStyle = function(style) { + if (this.content.style.cursor != style) + this.content.style.cursor = style; + }; + this.setMouseCursor = function(cursorStyle) { + this.content.style.cursor = cursorStyle; + }; + this.destroy = function() { + this.$textLayer.destroy(); + this.$cursorLayer.destroy(); + }; + +}).call(VirtualRenderer.prototype); + + +config.defineOptions(VirtualRenderer.prototype, "renderer", { + animatedScroll: {initialValue: false}, + showInvisibles: { + set: function(value) { + if (this.$textLayer.setShowInvisibles(value)) + this.$loop.schedule(this.CHANGE_TEXT); + }, + initialValue: false + }, + showPrintMargin: { + set: function() { this.$updatePrintMargin(); }, + initialValue: true + }, + printMarginColumn: { + set: function() { this.$updatePrintMargin(); }, + initialValue: 80 + }, + printMargin: { + set: function(val) { + if (typeof val == "number") + this.$printMarginColumn = val; + this.$showPrintMargin = !!val; + this.$updatePrintMargin(); + }, + get: function() { + return this.$showPrintMargin && this.$printMarginColumn; + } + }, + showGutter: { + set: function(show){ + this.$gutter.style.display = show ? "block" : "none"; + this.onGutterResize(); + }, + initialValue: true + }, + fadeFoldWidgets: { + set: function(show) { + dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show); + }, + initialValue: false + }, + showFoldWidgets: { + set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)}, + initialValue: true + }, + displayIndentGuides: { + set: function(show) { + if (this.$textLayer.setDisplayIndentGuides(show)) + this.$loop.schedule(this.CHANGE_TEXT); + }, + initialValue: true + }, + highlightGutterLine: { + set: function(shouldHighlight) { + if (!this.$gutterLineHighlight) { + this.$gutterLineHighlight = dom.createElement("div"); + this.$gutterLineHighlight.className = "ace_gutter-active-line"; + this.$gutter.appendChild(this.$gutterLineHighlight); + return; + } + + this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none"; + if (this.$cursorLayer.$pixelPos) + this.$updateGutterLineHighlight(); + }, + initialValue: false, + value: true + }, + hScrollBarAlwaysVisible: { + set: function(val) { + if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: false + }, + vScrollBarAlwaysVisible: { + set: function(val) { + if (!this.$vScrollBarAlwaysVisible || !this.$vScroll) + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: false + }, + fontSize: { + set: function(size) { + if (typeof size == "number") + size = size + "px"; + this.container.style.fontSize = size; + this.updateFontSize(); + }, + initialValue: 12 + }, + fontFamily: { + set: function(name) { + this.container.style.fontFamily = name; + this.updateFontSize(); + } + }, + maxLines: { + set: function(val) { + this.updateFull(); + } + }, + minLines: { + set: function(val) { + this.updateFull(); + } + }, + scrollPastEnd: { + set: function(val) { + val = +val || 0; + if (this.$scrollPastEnd == val) + return; + this.$scrollPastEnd = val; + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: 0, + handlesSet: true + }, + fixedWidthGutter: { + set: function(val) { + this.$gutterLayer.$fixedWidth = !!val; + this.$loop.schedule(this.CHANGE_GUTTER); + } + }, + theme: { + set: function(val) { this.setTheme(val) }, + get: function() { return this.$themeId || this.theme; }, + initialValue: "./theme/textmate", + handlesSet: true + } +}); + +exports.VirtualRenderer = VirtualRenderer; +}); + +ace.define('ace/layer/gutter', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/oop', 'ace/lib/lang', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var dom = require("../lib/dom"); +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; + +var Gutter = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_gutter-layer"; + parentEl.appendChild(this.element); + this.setShowFoldWidgets(this.$showFoldWidgets); + + this.gutterWidth = 0; + + this.$annotations = []; + this.$updateAnnotations = this.$updateAnnotations.bind(this); + + this.$cells = []; +}; + +(function() { + + oop.implement(this, EventEmitter); + + this.setSession = function(session) { + if (this.session) + this.session.removeEventListener("change", this.$updateAnnotations); + this.session = session; + session.on("change", this.$updateAnnotations); + }; + + this.addGutterDecoration = function(row, className){ + if (window.console) + console.warn && console.warn("deprecated use session.addGutterDecoration"); + this.session.addGutterDecoration(row, className); + }; + + this.removeGutterDecoration = function(row, className){ + if (window.console) + console.warn && console.warn("deprecated use session.removeGutterDecoration"); + this.session.removeGutterDecoration(row, className); + }; + + this.setAnnotations = function(annotations) { + this.$annotations = []; + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + var row = annotation.row; + var rowInfo = this.$annotations[row]; + if (!rowInfo) + rowInfo = this.$annotations[row] = {text: []}; + + var annoText = annotation.text; + annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || ""; + + if (rowInfo.text.indexOf(annoText) === -1) + rowInfo.text.push(annoText); + + var type = annotation.type; + if (type == "error") + rowInfo.className = " ace_error"; + else if (type == "warning" && rowInfo.className != " ace_error") + rowInfo.className = " ace_warning"; + else if (type == "info" && (!rowInfo.className)) + rowInfo.className = " ace_info"; + } + }; + + this.$updateAnnotations = function (e) { + if (!this.$annotations.length) + return; + var delta = e.data; + var range = delta.range; + var firstRow = range.start.row; + var len = range.end.row - firstRow; + if (len === 0) { + } else if (delta.action == "removeText" || delta.action == "removeLines") { + this.$annotations.splice(firstRow, len + 1, null); + } else { + var args = new Array(len + 1); + args.unshift(firstRow, 1); + this.$annotations.splice.apply(this.$annotations, args); + } + }; + + this.update = function(config) { + var firstRow = config.firstRow; + var lastRow = config.lastRow; + var session = this.session; + var fold = session.getNextFoldLine(firstRow); + var foldStart = fold ? fold.start.row : Infinity; + var foldWidgets = this.$showFoldWidgets && session.foldWidgets; + var breakpoints = session.$breakpoints; + var decorations = session.$decorations; + var firstLineNumber = session.$firstLineNumber; + var lastLineNumber = 0; + + var gutterRenderer = session.gutterRenderer; + + var cell = null; + var index = -1; + var row = firstRow; + while (true) { + if (row > foldStart) { + row = fold.end.row + 1; + fold = session.getNextFoldLine(row, fold); + foldStart = fold ? fold.start.row : Infinity; + } + if (row > lastRow) { + while (this.$cells.length > index + 1) { + cell = this.$cells.pop(); + this.element.removeChild(cell.element); + } + break; + } + + cell = this.$cells[++index]; + if (!cell) { + cell = {element: null, textNode: null, foldWidget: null}; + cell.element = dom.createElement("div"); + cell.textNode = document.createTextNode(''); + cell.element.appendChild(cell.textNode); + this.element.appendChild(cell.element); + this.$cells[index] = cell; + } + + var className = "ace_gutter-cell "; + if (breakpoints[row]) + className += breakpoints[row]; + if (decorations[row]) + className += decorations[row]; + if (this.$annotations[row]) + className += this.$annotations[row].className; + if (cell.element.className != className) + cell.element.className = className; + + var height = session.getRowLength(row) * config.lineHeight + "px"; + if (height != cell.element.style.height) + cell.element.style.height = height; + + if (foldWidgets) { + var c = foldWidgets[row]; + if (c == null) + c = foldWidgets[row] = session.getFoldWidget(row); + } + + if (c) { + if (!cell.foldWidget) { + cell.foldWidget = dom.createElement("span"); + cell.element.appendChild(cell.foldWidget); + } + var className = "ace_fold-widget ace_" + c; + if (c == "start" && row == foldStart && row < fold.end.row) + className += " ace_closed"; + else + className += " ace_open"; + if (cell.foldWidget.className != className) + cell.foldWidget.className = className; + + var height = config.lineHeight + "px"; + if (cell.foldWidget.style.height != height) + cell.foldWidget.style.height = height; + } else { + if (cell.foldWidget) { + cell.element.removeChild(cell.foldWidget); + cell.foldWidget = null; + } + } + + var text = lastLineNumber = gutterRenderer + ? gutterRenderer.getText(session, row) + : row + firstLineNumber; + if (text != cell.textNode.data) + cell.textNode.data = text; + + row++; + } + + this.element.style.height = config.minHeight + "px"; + + if (this.$fixedWidth || session.$useWrapMode) + lastLineNumber = session.getLength() + firstLineNumber; + + var gutterWidth = gutterRenderer + ? gutterRenderer.getWidth(session, lastLineNumber, config) + : lastLineNumber.toString().length * config.characterWidth; + + var padding = this.$padding || this.$computePadding(); + gutterWidth += padding.left + padding.right; + if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) { + this.gutterWidth = gutterWidth; + this.element.style.width = Math.ceil(this.gutterWidth) + "px"; + this._emit("changeGutterWidth", gutterWidth); + } + }; + + this.$fixedWidth = false; + + this.$showFoldWidgets = true; + this.setShowFoldWidgets = function(show) { + if (show) + dom.addCssClass(this.element, "ace_folding-enabled"); + else + dom.removeCssClass(this.element, "ace_folding-enabled"); + + this.$showFoldWidgets = show; + this.$padding = null; + }; + + this.getShowFoldWidgets = function() { + return this.$showFoldWidgets; + }; + + this.$computePadding = function() { + if (!this.element.firstChild) + return {left: 0, right: 0}; + var style = dom.computedStyle(this.element.firstChild); + this.$padding = {}; + this.$padding.left = parseInt(style.paddingLeft) + 1 || 0; + this.$padding.right = parseInt(style.paddingRight) || 0; + return this.$padding; + }; + + this.getRegion = function(point) { + var padding = this.$padding || this.$computePadding(); + var rect = this.element.getBoundingClientRect(); + if (point.x < padding.left + rect.left) + return "markers"; + if (this.$showFoldWidgets && point.x > rect.right - padding.right) + return "foldWidgets"; + }; + +}).call(Gutter.prototype); + +exports.Gutter = Gutter; + +}); + +ace.define('ace/layer/marker', ['require', 'exports', 'module' , 'ace/range', 'ace/lib/dom'], function(require, exports, module) { + + +var Range = require("../range").Range; +var dom = require("../lib/dom"); + +var Marker = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_marker-layer"; + parentEl.appendChild(this.element); +}; + +(function() { + + this.$padding = 0; + + this.setPadding = function(padding) { + this.$padding = padding; + }; + this.setSession = function(session) { + this.session = session; + }; + + this.setMarkers = function(markers) { + this.markers = markers; + }; + + this.update = function(config) { + var config = config || this.config; + if (!config) + return; + + this.config = config; + + + var html = []; + for (var key in this.markers) { + var marker = this.markers[key]; + + if (!marker.range) { + marker.update(html, this, this.session, config); + continue; + } + + var range = marker.range.clipRows(config.firstRow, config.lastRow); + if (range.isEmpty()) continue; + + range = range.toScreenRange(this.session); + if (marker.renderer) { + var top = this.$getTop(range.start.row, config); + var left = this.$padding + range.start.column * config.characterWidth; + marker.renderer(html, range, left, top, config); + } else if (marker.type == "fullLine") { + this.drawFullLineMarker(html, range, marker.clazz, config); + } else if (marker.type == "screenLine") { + this.drawScreenLineMarker(html, range, marker.clazz, config); + } else if (range.isMultiLine()) { + if (marker.type == "text") + this.drawTextMarker(html, range, marker.clazz, config); + else + this.drawMultiLineMarker(html, range, marker.clazz, config); + } else { + this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config); + } + } + this.element = dom.setInnerHtml(this.element, html.join("")); + }; + + this.$getTop = function(row, layerConfig) { + return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; + }; + this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) { + var row = range.start.row; + + var lineRange = new Range( + row, range.start.column, + row, this.session.getScreenLastRowColumn(row) + ); + this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " ace_start", layerConfig, 1, extraStyle); + row = range.end.row; + lineRange = new Range(row, 0, row, range.end.column); + this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, extraStyle); + + for (row = range.start.row + 1; row < range.end.row; row++) { + lineRange.start.row = row; + lineRange.end.row = row; + lineRange.end.column = this.session.getScreenLastRowColumn(row); + this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, extraStyle); + } + }; + this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var padding = this.$padding; + var height = config.lineHeight; + var top = this.$getTop(range.start.row, config); + var left = padding + range.start.column * config.characterWidth; + extraStyle = extraStyle || ""; + + stringBuilder.push( + "
    " + ); + top = this.$getTop(range.end.row, config); + var width = range.end.column * config.characterWidth; + + stringBuilder.push( + "
    " + ); + height = (range.end.row - range.start.row - 1) * config.lineHeight; + if (height < 0) + return; + top = this.$getTop(range.start.row + 1, config); + + stringBuilder.push( + "
    " + ); + }; + this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { + var height = config.lineHeight; + var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; + + var top = this.$getTop(range.start.row, config); + var left = this.$padding + range.start.column * config.characterWidth; + + stringBuilder.push( + "
    " + ); + }; + + this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var top = this.$getTop(range.start.row, config); + var height = config.lineHeight; + if (range.start.row != range.end.row) + height += this.$getTop(range.end.row, config) - top; + + stringBuilder.push( + "
    " + ); + }; + + this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var top = this.$getTop(range.start.row, config); + var height = config.lineHeight; + + stringBuilder.push( + "
    " + ); + }; + +}).call(Marker.prototype); + +exports.Marker = Marker; + +}); + +ace.define('ace/layer/text', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/useragent', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var dom = require("../lib/dom"); +var lang = require("../lib/lang"); +var useragent = require("../lib/useragent"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; + +var Text = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_text-layer"; + parentEl.appendChild(this.element); + + this.$characterSize = {width: 0, height: 0}; + this.checkForSizeChanges(); + this.$pollSizeChanges(); +}; + +(function() { + + oop.implement(this, EventEmitter); + + this.EOF_CHAR = "\xB6"; //"¶"; + this.EOL_CHAR = "\xAC"; //"¬"; + this.TAB_CHAR = "\u2192"; //"→" "\u21E5"; + this.SPACE_CHAR = "\xB7"; //"·"; + this.$padding = 0; + + this.setPadding = function(padding) { + this.$padding = padding; + this.element.style.padding = "0 " + padding + "px"; + }; + + this.getLineHeight = function() { + return this.$characterSize.height || 0; + }; + + this.getCharacterWidth = function() { + return this.$characterSize.width || 0; + }; + + this.checkForSizeChanges = function() { + var size = this.$measureSizes(); + if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { + this.$measureNode.style.fontWeight = "bold"; + var boldSize = this.$measureSizes(); + this.$measureNode.style.fontWeight = ""; + this.$characterSize = size; + this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; + this._emit("changeCharacterSize", {data: size}); + } + }; + + this.$pollSizeChanges = function() { + var self = this; + this.$pollSizeChangesTimer = setInterval(function() { + self.checkForSizeChanges(); + }, 500); + }; + + this.$fontStyles = { + fontFamily : 1, + fontSize : 1, + fontWeight : 1, + fontStyle : 1, + lineHeight : 1 + }; + + this.$measureSizes = useragent.isIE || useragent.isOldGecko ? function() { + var n = 1000; + if (!this.$measureNode) { + var measureNode = this.$measureNode = dom.createElement("div"); + var style = measureNode.style; + + style.width = style.height = "auto"; + style.left = style.top = (-n * 40) + "px"; + + style.visibility = "hidden"; + style.position = "fixed"; + style.overflow = "visible"; + style.whiteSpace = "nowrap"; + measureNode.innerHTML = lang.stringRepeat("Xy", n); + + if (this.element.ownerDocument.body) { + this.element.ownerDocument.body.appendChild(measureNode); + } else { + var container = this.element.parentNode; + while (!dom.hasCssClass(container, "ace_editor")) + container = container.parentNode; + container.appendChild(measureNode); + } + } + if (!this.element.offsetWidth) + return null; + + var style = this.$measureNode.style; + var computedStyle = dom.computedStyle(this.element); + for (var prop in this.$fontStyles) + style[prop] = computedStyle[prop]; + + var size = { + height: this.$measureNode.offsetHeight, + width: this.$measureNode.offsetWidth / (n * 2) + }; + if (size.width == 0 || size.height == 0) + return null; + + return size; + } + : function() { + if (!this.$measureNode) { + var measureNode = this.$measureNode = dom.createElement("div"); + var style = measureNode.style; + + style.width = style.height = "auto"; + style.left = style.top = -100 + "px"; + + style.visibility = "hidden"; + style.position = "fixed"; + style.overflow = "visible"; + style.whiteSpace = "nowrap"; + measureNode.innerHTML = lang.stringRepeat("X", 100); + + var container = this.element.parentNode; + while (container && !dom.hasCssClass(container, "ace_editor")) + container = container.parentNode; + + if (!container) + return this.$measureNode = null; + + container.appendChild(measureNode); + } + + var rect = this.$measureNode.getBoundingClientRect(); + + var size = { + height: rect.height, + width: rect.width / 100 + }; + if (size.width == 0 || size.height == 0) + return null; + + return size; + }; + + this.setSession = function(session) { + this.session = session; + this.$computeTabString(); + }; + + this.showInvisibles = false; + this.setShowInvisibles = function(showInvisibles) { + if (this.showInvisibles == showInvisibles) + return false; + + this.showInvisibles = showInvisibles; + this.$computeTabString(); + return true; + }; + + this.displayIndentGuides = true; + this.setDisplayIndentGuides = function(display) { + if (this.displayIndentGuides == display) + return false; + + this.displayIndentGuides = display; + this.$computeTabString(); + return true; + }; + + this.$tabStrings = []; + this.onChangeTabSize = + this.$computeTabString = function() { + var tabSize = this.session.getTabSize(); + this.tabSize = tabSize; + var tabStr = this.$tabStrings = [0]; + for (var i = 1; i < tabSize + 1; i++) { + if (this.showInvisibles) { + tabStr.push("" + + this.TAB_CHAR + + lang.stringRepeat("\xa0", i - 1) + + ""); + } else { + tabStr.push(lang.stringRepeat("\xa0", i)); + } + } + if (this.displayIndentGuides) { + this.$indentGuideRe = /\s\S| \t|\t |\s$/; + var className = "ace_indent-guide"; + if (this.showInvisibles) { + className += " ace_invisible"; + var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); + var tabContent = this.TAB_CHAR + lang.stringRepeat("\xa0", this.tabSize - 1); + } else{ + var spaceContent = lang.stringRepeat("\xa0", this.tabSize); + var tabContent = spaceContent; + } + + this.$tabStrings[" "] = "" + spaceContent + ""; + this.$tabStrings["\t"] = "" + tabContent + ""; + } + }; + + this.updateLines = function(config, firstRow, lastRow) { + if (this.config.lastRow != config.lastRow || + this.config.firstRow != config.firstRow) { + this.scrollLines(config); + } + this.config = config; + + var first = Math.max(firstRow, config.firstRow); + var last = Math.min(lastRow, config.lastRow); + + var lineElements = this.element.childNodes; + var lineElementsIdx = 0; + + for (var row = config.firstRow; row < first; row++) { + var foldLine = this.session.getFoldLine(row); + if (foldLine) { + if (foldLine.containsRow(first)) { + first = foldLine.start.row; + break; + } else { + row = foldLine.end.row; + } + } + lineElementsIdx ++; + } + + var row = first; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row :Infinity; + } + if (row > last) + break; + + var lineElement = lineElements[lineElementsIdx++]; + if (lineElement) { + var html = []; + this.$renderLine( + html, row, !this.$useLineGroups(), row == foldStart ? foldLine : false + ); + lineElement.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; + dom.setInnerHtml(lineElement, html.join("")); + } + row++; + } + }; + + this.scrollLines = function(config) { + var oldConfig = this.config; + this.config = config; + + if (!oldConfig || oldConfig.lastRow < config.firstRow) + return this.update(config); + + if (config.lastRow < oldConfig.firstRow) + return this.update(config); + + var el = this.element; + if (oldConfig.firstRow < config.firstRow) + for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) + el.removeChild(el.firstChild); + + if (oldConfig.lastRow > config.lastRow) + for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--) + el.removeChild(el.lastChild); + + if (config.firstRow < oldConfig.firstRow) { + var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1); + if (el.firstChild) + el.insertBefore(fragment, el.firstChild); + else + el.appendChild(fragment); + } + + if (config.lastRow > oldConfig.lastRow) { + var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow); + el.appendChild(fragment); + } + }; + + this.$renderLinesFragment = function(config, firstRow, lastRow) { + var fragment = this.element.ownerDocument.createDocumentFragment(); + var row = firstRow; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row : Infinity; + } + if (row > lastRow) + break; + + var container = dom.createElement("div"); + + var html = []; + this.$renderLine(html, row, false, row == foldStart ? foldLine : false); + container.innerHTML = html.join(""); + if (this.$useLineGroups()) { + container.className = 'ace_line_group'; + fragment.appendChild(container); + container.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; + + } else { + var lines = container.childNodes + while(lines.length) + fragment.appendChild(lines[0]); + } + + row++; + } + return fragment; + }; + + this.update = function(config) { + this.config = config; + + var html = []; + var firstRow = config.firstRow, lastRow = config.lastRow; + + var row = firstRow; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row :Infinity; + } + if (row > lastRow) + break; + + if (this.$useLineGroups()) + html.push("
    ") + + this.$renderLine(html, row, false, row == foldStart ? foldLine : false); + + if (this.$useLineGroups()) + html.push("
    "); // end the line group + + row++; + } + this.element = dom.setInnerHtml(this.element, html.join("")); + }; + + this.$textToken = { + "text": true, + "rparen": true, + "lparen": true + }; + + this.$renderToken = function(stringBuilder, screenColumn, token, value) { + var self = this; + var replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; + var replaceFunc = function(c, a, b, tabIdx, idx4) { + if (a) { + return self.showInvisibles ? + "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" : + lang.stringRepeat("\xa0", c.length); + } else if (c == "&") { + return "&"; + } else if (c == "<") { + return "<"; + } else if (c == "\t") { + var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); + screenColumn += tabSize - 1; + return self.$tabStrings[tabSize]; + } else if (c == "\u3000") { + var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; + var space = self.showInvisibles ? self.SPACE_CHAR : ""; + screenColumn += 1; + return "" + space + ""; + } else if (b) { + return "" + self.SPACE_CHAR + ""; + } else { + screenColumn += 1; + return "" + c + ""; + } + }; + + var output = value.replace(replaceReg, replaceFunc); + + if (!this.$textToken[token.type]) { + var classes = "ace_" + token.type.replace(/\./g, " ace_"); + var style = ""; + if (token.type == "fold") + style = " style='width:" + (token.value.length * this.config.characterWidth) + "px;' "; + stringBuilder.push("", output, ""); + } + else { + stringBuilder.push(output); + } + return screenColumn + value.length; + }; + + this.renderIndentGuide = function(stringBuilder, value, max) { + var cols = value.search(this.$indentGuideRe); + if (cols <= 0 || cols >= max) + return value; + if (value[0] == " ") { + cols -= cols % this.tabSize; + stringBuilder.push(lang.stringRepeat(this.$tabStrings[" "], cols/this.tabSize)); + return value.substr(cols); + } else if (value[0] == "\t") { + stringBuilder.push(lang.stringRepeat(this.$tabStrings["\t"], cols)); + return value.substr(cols); + } + return value; + }; + + this.$renderWrappedLine = function(stringBuilder, tokens, splits, onlyContents) { + var chars = 0; + var split = 0; + var splitChars = splits[0]; + var screenColumn = 0; + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + var value = token.value; + if (i == 0 && this.displayIndentGuides) { + chars = value.length; + value = this.renderIndentGuide(stringBuilder, value, splitChars); + if (!value) + continue; + chars -= value.length; + } + + if (chars + value.length < splitChars) { + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + chars += value.length; + } else { + while (chars + value.length >= splitChars) { + screenColumn = this.$renderToken( + stringBuilder, screenColumn, + token, value.substring(0, splitChars - chars) + ); + value = value.substring(splitChars - chars); + chars = splitChars; + + if (!onlyContents) { + stringBuilder.push("", + "
    " + ); + } + + split ++; + screenColumn = 0; + splitChars = splits[split] || Number.MAX_VALUE; + } + if (value.length != 0) { + chars += value.length; + screenColumn = this.$renderToken( + stringBuilder, screenColumn, token, value + ); + } + } + } + }; + + this.$renderSimpleLine = function(stringBuilder, tokens) { + var screenColumn = 0; + var token = tokens[0]; + var value = token.value; + if (this.displayIndentGuides) + value = this.renderIndentGuide(stringBuilder, value); + if (value) + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + for (var i = 1; i < tokens.length; i++) { + token = tokens[i]; + value = token.value; + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + } + }; + this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) { + if (!foldLine && foldLine != false) + foldLine = this.session.getFoldLine(row); + + if (foldLine) + var tokens = this.$getFoldLineTokens(row, foldLine); + else + var tokens = this.session.getTokens(row); + + + if (!onlyContents) { + stringBuilder.push( + "
    " + ); + } + + if (tokens.length) { + var splits = this.session.getRowSplitData(row); + if (splits && splits.length) + this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents); + else + this.$renderSimpleLine(stringBuilder, tokens); + } + + if (this.showInvisibles) { + if (foldLine) + row = foldLine.end.row + + stringBuilder.push( + "", + row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, + "" + ); + } + if (!onlyContents) + stringBuilder.push("
    "); + }; + + this.$getFoldLineTokens = function(row, foldLine) { + var session = this.session; + var renderTokens = []; + + function addTokens(tokens, from, to) { + var idx = 0, col = 0; + while ((col + tokens[idx].value.length) < from) { + col += tokens[idx].value.length; + idx++; + + if (idx == tokens.length) + return; + } + if (col != from) { + var value = tokens[idx].value.substring(from - col); + if (value.length > (to - from)) + value = value.substring(0, to - from); + + renderTokens.push({ + type: tokens[idx].type, + value: value + }); + + col = from + value.length; + idx += 1; + } + + while (col < to && idx < tokens.length) { + var value = tokens[idx].value; + if (value.length + col > to) { + renderTokens.push({ + type: tokens[idx].type, + value: value.substring(0, to - col) + }); + } else + renderTokens.push(tokens[idx]); + col += value.length; + idx += 1; + } + } + + var tokens = session.getTokens(row); + foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { + if (placeholder != null) { + renderTokens.push({ + type: "fold", + value: placeholder + }); + } else { + if (isNewRow) + tokens = session.getTokens(row); + + if (tokens.length) + addTokens(tokens, lastColumn, column); + } + }, foldLine.end.row, this.session.getLine(foldLine.end.row).length); + + return renderTokens; + }; + + this.$useLineGroups = function() { + return this.session.getUseWrapMode(); + }; + + this.destroy = function() { + clearInterval(this.$pollSizeChangesTimer); + if (this.$measureNode) + this.$measureNode.parentNode.removeChild(this.$measureNode); + delete this.$measureNode; + }; + +}).call(Text.prototype); + +exports.Text = Text; + +}); + +ace.define('ace/layer/cursor', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { + + +var dom = require("../lib/dom"); + +var Cursor = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_cursor-layer"; + parentEl.appendChild(this.element); + + this.isVisible = false; + this.isBlinking = true; + this.blinkInterval = 1000; + this.smoothBlinking = false; + + this.cursors = []; + this.cursor = this.addCursor(); + dom.addCssClass(this.element, "ace_hidden-cursors"); +}; + +(function() { + + this.$padding = 0; + this.setPadding = function(padding) { + this.$padding = padding; + }; + + this.setSession = function(session) { + this.session = session; + }; + + this.setBlinking = function(blinking) { + if (blinking != this.isBlinking){ + this.isBlinking = blinking; + this.restartTimer(); + } + }; + + this.setBlinkInterval = function(blinkInterval) { + if (blinkInterval != this.blinkInterval){ + this.blinkInterval = blinkInterval; + this.restartTimer(); + } + }; + + this.setSmoothBlinking = function(smoothBlinking) { + if (smoothBlinking != this.smoothBlinking) { + this.smoothBlinking = smoothBlinking; + if (smoothBlinking) + dom.addCssClass(this.element, "ace_smooth-blinking"); + else + dom.removeCssClass(this.element, "ace_smooth-blinking"); + this.restartTimer(); + } + }; + + this.addCursor = function() { + var el = dom.createElement("div"); + el.className = "ace_cursor"; + this.element.appendChild(el); + this.cursors.push(el); + return el; + }; + + this.removeCursor = function() { + if (this.cursors.length > 1) { + var el = this.cursors.pop(); + el.parentNode.removeChild(el); + return el; + } + }; + + this.hideCursor = function() { + this.isVisible = false; + dom.addCssClass(this.element, "ace_hidden-cursors"); + this.restartTimer(); + }; + + this.showCursor = function() { + this.isVisible = true; + dom.removeCssClass(this.element, "ace_hidden-cursors"); + this.restartTimer(); + }; + + this.restartTimer = function() { + clearInterval(this.intervalId); + clearTimeout(this.timeoutId); + if (this.smoothBlinking) + dom.removeCssClass(this.element, "ace_smooth-blinking"); + for (var i = this.cursors.length; i--; ) + this.cursors[i].style.opacity = ""; + + if (!this.isBlinking || !this.blinkInterval || !this.isVisible) + return; + + if (this.smoothBlinking) + setTimeout(function(){ + dom.addCssClass(this.element, "ace_smooth-blinking"); + }.bind(this)); + + var blink = function(){ + this.timeoutId = setTimeout(function() { + for (var i = this.cursors.length; i--; ) { + this.cursors[i].style.opacity = 0; + } + }.bind(this), 0.6 * this.blinkInterval); + }.bind(this); + + this.intervalId = setInterval(function() { + for (var i = this.cursors.length; i--; ) { + this.cursors[i].style.opacity = ""; + } + blink(); + }.bind(this), this.blinkInterval); + + blink(); + }; + + this.getPixelPosition = function(position, onScreen) { + if (!this.config || !this.session) + return {left : 0, top : 0}; + + if (!position) + position = this.session.selection.getCursor(); + var pos = this.session.documentToScreenPosition(position); + var cursorLeft = this.$padding + pos.column * this.config.characterWidth; + var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * + this.config.lineHeight; + + return {left : cursorLeft, top : cursorTop}; + }; + + this.update = function(config) { + this.config = config; + + var selections = this.session.$selectionMarkers; + var i = 0, cursorIndex = 0; + + if (selections === undefined || selections.length === 0){ + selections = [{cursor: null}]; + } + + for (var i = 0, n = selections.length; i < n; i++) { + var pixelPos = this.getPixelPosition(selections[i].cursor, true); + if ((pixelPos.top > config.height + config.offset || + pixelPos.top < -config.offset) && i > 1) { + continue; + } + + var style = (this.cursors[cursorIndex++] || this.addCursor()).style; + + style.left = pixelPos.left + "px"; + style.top = pixelPos.top + "px"; + style.width = config.characterWidth + "px"; + style.height = config.lineHeight + "px"; + } + while (this.cursors.length > cursorIndex) + this.removeCursor(); + + var overwrite = this.session.getOverwrite(); + this.$setOverwrite(overwrite); + this.$pixelPos = pixelPos; + this.restartTimer(); + }; + + this.$setOverwrite = function(overwrite) { + if (overwrite != this.overwrite) { + this.overwrite = overwrite; + if (overwrite) + dom.addCssClass(this.element, "ace_overwrite-cursors"); + else + dom.removeCssClass(this.element, "ace_overwrite-cursors"); + } + }; + + this.destroy = function() { + clearInterval(this.intervalId); + clearTimeout(this.timeoutId); + }; + +}).call(Cursor.prototype); + +exports.Cursor = Cursor; + +}); + +ace.define('ace/scrollbar', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/event', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var event = require("./lib/event"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var ScrollBar = function(parent) { + this.element = dom.createElement("div"); + this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix; + + this.inner = dom.createElement("div"); + this.inner.className = "ace_scrollbar-inner"; + this.element.appendChild(this.inner); + + parent.appendChild(this.element); + + this.setVisible(false); + this.skipEvent = false; + + event.addListener(this.element, "scroll", this.onScroll.bind(this)); + event.addListener(this.element, "mousedown", event.preventDefault); +}; + +(function() { + oop.implement(this, EventEmitter); + + this.setVisible = function(isVisible) { + this.element.style.display = isVisible ? "" : "none"; + this.isVisible = isVisible; + }; +}).call(ScrollBar.prototype); +var VScrollBar = function(parent, renderer) { + ScrollBar.call(this, parent); + this.scrollTop = 0; + renderer.$scrollbarWidth = + this.width = dom.scrollbarWidth(parent.ownerDocument); + this.inner.style.width = + this.element.style.width = (this.width || 15) + 5 + "px"; +}; + +oop.inherits(VScrollBar, ScrollBar); + +(function() { + + this.classSuffix = '-v'; + this.onScroll = function() { + if (!this.skipEvent) { + this.scrollTop = this.element.scrollTop; + this._emit("scroll", {data: this.scrollTop}); + } + this.skipEvent = false; + }; + this.getWidth = function() { + return this.isVisible ? this.width : 0; + }; + this.setHeight = function(height) { + this.element.style.height = height + "px"; + }; + this.setInnerHeight = function(height) { + this.inner.style.height = height + "px"; + }; + this.setScrollHeight = function(height) { + this.inner.style.height = height + "px"; + }; + this.setScrollTop = function(scrollTop) { + if (this.scrollTop != scrollTop) { + this.skipEvent = true; + this.scrollTop = this.element.scrollTop = scrollTop; + } + }; + +}).call(VScrollBar.prototype); +var HScrollBar = function(parent, renderer) { + ScrollBar.call(this, parent); + this.scrollLeft = 0; + this.height = renderer.$scrollbarWidth; + this.inner.style.height = + this.element.style.height = (this.height || 15) + 5 + "px"; +}; + +oop.inherits(HScrollBar, ScrollBar); + +(function() { + + this.classSuffix = '-h'; + this.onScroll = function() { + if (!this.skipEvent) { + this.scrollLeft = this.element.scrollLeft; + this._emit("scroll", {data: this.scrollLeft}); + } + this.skipEvent = false; + }; + this.getHeight = function() { + return this.isVisible ? this.height : 0; + }; + this.setWidth = function(width) { + this.element.style.width = width + "px"; + }; + this.setInnerWidth = function(width) { + this.inner.style.width = width + "px"; + }; + this.setScrollWidth = function(width) { + this.inner.style.width = width + "px"; + }; + this.setScrollLeft = function(scrollLeft) { + if (this.scrollLeft != scrollLeft) { + this.skipEvent = true; + this.scrollLeft = this.element.scrollLeft = scrollLeft; + } + }; + +}).call(HScrollBar.prototype); + + +exports.ScrollBar = VScrollBar; // backward compatibility +exports.ScrollBarV = VScrollBar; // backward compatibility +exports.ScrollBarH = HScrollBar; // backward compatibility + +exports.VScrollBar = VScrollBar; +exports.HScrollBar = HScrollBar; +}); + +ace.define('ace/renderloop', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) { + + +var event = require("./lib/event"); + + +var RenderLoop = function(onRender, win) { + this.onRender = onRender; + this.pending = false; + this.changes = 0; + this.window = win || window; +}; + +(function() { + + + this.schedule = function(change) { + this.changes = this.changes | change; + if (!this.pending && this.changes) { + this.pending = true; + var _self = this; + event.nextFrame(function() { + _self.pending = false; + var changes; + while (changes = _self.changes) { + _self.changes = 0; + _self.onRender(changes); + } + }, this.window); + } + }; + +}).call(RenderLoop.prototype); + +exports.RenderLoop = RenderLoop; +}); + +ace.define('ace/multi_select', ['require', 'exports', 'module' , 'ace/range_list', 'ace/range', 'ace/selection', 'ace/mouse/multi_select_handler', 'ace/lib/event', 'ace/lib/lang', 'ace/commands/multi_select_commands', 'ace/search', 'ace/edit_session', 'ace/editor', 'ace/config'], function(require, exports, module) { + +var RangeList = require("./range_list").RangeList; +var Range = require("./range").Range; +var Selection = require("./selection").Selection; +var onMouseDown = require("./mouse/multi_select_handler").onMouseDown; +var event = require("./lib/event"); +var lang = require("./lib/lang"); +var commands = require("./commands/multi_select_commands"); +exports.commands = commands.defaultCommands.concat(commands.multiSelectCommands); +var Search = require("./search").Search; +var search = new Search(); + +function find(session, needle, dir) { + search.$options.wrap = true; + search.$options.needle = needle; + search.$options.backwards = dir == -1; + return search.find(session); +} +var EditSession = require("./edit_session").EditSession; +(function() { + this.getSelectionMarkers = function() { + return this.$selectionMarkers; + }; +}).call(EditSession.prototype); +(function() { + this.ranges = null; + this.rangeList = null; + this.addRange = function(range, $blockChangeEvents) { + if (!range) + return; + + if (!this.inMultiSelectMode && this.rangeCount == 0) { + var oldRange = this.toOrientedRange(); + this.rangeList.add(oldRange); + this.rangeList.add(range); + if (this.rangeList.ranges.length != 2) { + this.rangeList.removeAll(); + return $blockChangeEvents || this.fromOrientedRange(range); + } + this.rangeList.removeAll(); + this.rangeList.add(oldRange); + this.$onAddRange(oldRange); + } + + if (!range.cursor) + range.cursor = range.end; + + var removed = this.rangeList.add(range); + + this.$onAddRange(range); + + if (removed.length) + this.$onRemoveRange(removed); + + if (this.rangeCount > 1 && !this.inMultiSelectMode) { + this._emit("multiSelect"); + this.inMultiSelectMode = true; + this.session.$undoSelect = false; + this.rangeList.attach(this.session); + } + + return $blockChangeEvents || this.fromOrientedRange(range); + }; + + this.toSingleRange = function(range) { + range = range || this.ranges[0]; + var removed = this.rangeList.removeAll(); + if (removed.length) + this.$onRemoveRange(removed); + + range && this.fromOrientedRange(range); + }; + this.substractPoint = function(pos) { + var removed = this.rangeList.substractPoint(pos); + if (removed) { + this.$onRemoveRange(removed); + return removed[0]; + } + }; + this.mergeOverlappingRanges = function() { + var removed = this.rangeList.merge(); + if (removed.length) + this.$onRemoveRange(removed); + else if(this.ranges[0]) + this.fromOrientedRange(this.ranges[0]); + }; + + this.$onAddRange = function(range) { + this.rangeCount = this.rangeList.ranges.length; + this.ranges.unshift(range); + this._emit("addRange", {range: range}); + }; + + this.$onRemoveRange = function(removed) { + this.rangeCount = this.rangeList.ranges.length; + if (this.rangeCount == 1 && this.inMultiSelectMode) { + var lastRange = this.rangeList.ranges.pop(); + removed.push(lastRange); + this.rangeCount = 0; + } + + for (var i = removed.length; i--; ) { + var index = this.ranges.indexOf(removed[i]); + this.ranges.splice(index, 1); + } + + this._emit("removeRange", {ranges: removed}); + + if (this.rangeCount == 0 && this.inMultiSelectMode) { + this.inMultiSelectMode = false; + this._emit("singleSelect"); + this.session.$undoSelect = true; + this.rangeList.detach(this.session); + } + + lastRange = lastRange || this.ranges[0]; + if (lastRange && !lastRange.isEqual(this.getRange())) + this.fromOrientedRange(lastRange); + }; + this.$initRangeList = function() { + if (this.rangeList) + return; + + this.rangeList = new RangeList(); + this.ranges = []; + this.rangeCount = 0; + }; + this.getAllRanges = function() { + return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()]; + }; + + this.splitIntoLines = function () { + if (this.rangeCount > 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var range = this.getRange(); + var isBackwards = this.isBackwards(); + var startRow = range.start.row; + var endRow = range.end.row; + if (startRow == endRow) { + if (isBackwards) + var start = range.end, end = range.start; + else + var start = range.start, end = range.end; + + this.addRange(Range.fromPoints(end, end)); + this.addRange(Range.fromPoints(start, start)); + return; + } + + var rectSel = []; + var r = this.getLineRange(startRow, true); + r.start.column = range.start.column; + rectSel.push(r); + + for (var i = startRow + 1; i < endRow; i++) + rectSel.push(this.getLineRange(i, true)); + + r = this.getLineRange(endRow, true); + r.end.column = range.end.column; + rectSel.push(r); + + rectSel.forEach(this.addRange, this); + } + }; + this.toggleBlockSelection = function () { + if (this.rangeCount > 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var cursor = this.session.documentToScreenPosition(this.selectionLead); + var anchor = this.session.documentToScreenPosition(this.selectionAnchor); + + var rectSel = this.rectangularRangeBlock(cursor, anchor); + rectSel.forEach(this.addRange, this); + } + }; + this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) { + var rectSel = []; + + var xBackwards = screenCursor.column < screenAnchor.column; + if (xBackwards) { + var startColumn = screenCursor.column; + var endColumn = screenAnchor.column; + } else { + var startColumn = screenAnchor.column; + var endColumn = screenCursor.column; + } + + var yBackwards = screenCursor.row < screenAnchor.row; + if (yBackwards) { + var startRow = screenCursor.row; + var endRow = screenAnchor.row; + } else { + var startRow = screenAnchor.row; + var endRow = screenCursor.row; + } + + if (startColumn < 0) + startColumn = 0; + if (startRow < 0) + startRow = 0; + + if (startRow == endRow) + includeEmptyLines = true; + + for (var row = startRow; row <= endRow; row++) { + var range = Range.fromPoints( + this.session.screenToDocumentPosition(row, startColumn), + this.session.screenToDocumentPosition(row, endColumn) + ); + if (range.isEmpty()) { + if (docEnd && isSamePoint(range.end, docEnd)) + break; + var docEnd = range.end; + } + range.cursor = xBackwards ? range.start : range.end; + rectSel.push(range); + } + + if (yBackwards) + rectSel.reverse(); + + if (!includeEmptyLines) { + var end = rectSel.length - 1; + while (rectSel[end].isEmpty() && end > 0) + end--; + if (end > 0) { + var start = 0; + while (rectSel[start].isEmpty()) + start++; + } + for (var i = end; i >= start; i--) { + if (rectSel[i].isEmpty()) + rectSel.splice(i, 1); + } + } + + return rectSel; + }; +}).call(Selection.prototype); +var Editor = require("./editor").Editor; +(function() { + this.updateSelectionMarkers = function() { + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + this.addSelectionMarker = function(orientedRange) { + if (!orientedRange.cursor) + orientedRange.cursor = orientedRange.end; + + var style = this.getSelectionStyle(); + orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style); + + this.session.$selectionMarkers.push(orientedRange); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + return orientedRange; + }; + this.removeSelectionMarker = function(range) { + if (!range.marker) + return; + this.session.removeMarker(range.marker); + var index = this.session.$selectionMarkers.indexOf(range); + if (index != -1) + this.session.$selectionMarkers.splice(index, 1); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + }; + + this.removeSelectionMarkers = function(ranges) { + var markerList = this.session.$selectionMarkers; + for (var i = ranges.length; i--; ) { + var range = ranges[i]; + if (!range.marker) + continue; + this.session.removeMarker(range.marker); + var index = markerList.indexOf(range); + if (index != -1) + markerList.splice(index, 1); + } + this.session.selectionMarkerCount = markerList.length; + }; + + this.$onAddRange = function(e) { + this.addSelectionMarker(e.range); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onRemoveRange = function(e) { + this.removeSelectionMarkers(e.ranges); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onMultiSelect = function(e) { + if (this.inMultiSelectMode) + return; + this.inMultiSelectMode = true; + + this.setStyle("ace_multiselect"); + this.keyBinding.addKeyboardHandler(commands.keyboardHandler); + this.commands.setDefaultHandler("exec", this.$onMultiSelectExec); + + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onSingleSelect = function(e) { + if (this.session.multiSelect.inVirtualMode) + return; + this.inMultiSelectMode = false; + + this.unsetStyle("ace_multiselect"); + this.keyBinding.removeKeyboardHandler(commands.keyboardHandler); + + this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onMultiSelectExec = function(e) { + var command = e.command; + var editor = e.editor; + if (!editor.multiSelect) + return; + if (!command.multiSelectAction) { + var result = command.exec(editor, e.args || {}); + editor.multiSelect.addRange(editor.multiSelect.toOrientedRange()); + editor.multiSelect.mergeOverlappingRanges(); + } else if (command.multiSelectAction == "forEach") { + result = editor.forEachSelection(command, e.args); + } else if (command.multiSelectAction == "forEachLine") { + result = editor.forEachSelection(command, e.args, true); + } else if (command.multiSelectAction == "single") { + editor.exitMultiSelectMode(); + result = command.exec(editor, e.args || {}); + } else { + result = command.multiSelectAction(editor, e.args || {}); + } + return result; + }; + this.forEachSelection = function(cmd, args, $byLines) { + if (this.inVirtualSelectionMode) + return; + + var session = this.session; + var selection = this.selection; + var rangeList = selection.rangeList; + var result; + + var reg = selection._eventRegistry; + selection._eventRegistry = {}; + + var tmpSel = new Selection(session); + this.inVirtualSelectionMode = true; + for (var i = rangeList.ranges.length; i--;) { + if ($byLines) { + while (i > 0 && rangeList.ranges[i].start.row == rangeList.ranges[i - 1].end.row) + i--; + } + tmpSel.fromOrientedRange(rangeList.ranges[i]); + this.selection = session.selection = tmpSel; + var cmdResult = cmd.exec(this, args || {}); + if (!result == undefined) + result = cmdResult; + tmpSel.toOrientedRange(rangeList.ranges[i]); + } + tmpSel.detach(); + + this.selection = session.selection = selection; + this.inVirtualSelectionMode = false; + selection._eventRegistry = reg; + selection.mergeOverlappingRanges(); + + var anim = this.renderer.$scrollAnimation; + this.onCursorChange(); + this.onSelectionChange(); + if (anim && anim.from == anim.to) + this.renderer.animateScrolling(anim.from); + + return result; + }; + this.exitMultiSelectMode = function() { + if (!this.inMultiSelectMode || this.inVirtualSelectionMode) + return; + this.multiSelect.toSingleRange(); + }; + + this.getSelectedText = function() { + var text = ""; + if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { + var ranges = this.multiSelect.rangeList.ranges; + var buf = []; + for (var i = 0; i < ranges.length; i++) { + buf.push(this.session.getTextRange(ranges[i])); + } + var nl = this.session.getDocument().getNewLineCharacter(); + text = buf.join(nl); + if (text.length == (buf.length - 1) * nl.length) + text = ""; + } else if (!this.selection.isEmpty()) { + text = this.session.getTextRange(this.getSelectionRange()); + } + return text; + }; + this.onPaste = function(text) { + if (this.$readOnly) + return; + + this._signal("paste", text); + if (!this.inMultiSelectMode || this.inVirtualSelectionMode) + return this.insert(text); + + var lines = text.split(/\r\n|\r|\n/); + var ranges = this.selection.rangeList.ranges; + + if (lines.length > ranges.length || lines.length < 2 || !lines[1]) + return this.commands.exec("insertstring", this, text); + + for (var i = ranges.length; i--;) { + var range = ranges[i]; + if (!range.isEmpty()) + this.session.remove(range); + + this.session.insert(range.start, lines[i]); + } + }; + this.findAll = function(needle, options, additive) { + options = options || {}; + options.needle = needle || options.needle; + this.$search.set(options); + + var ranges = this.$search.findAll(this.session); + if (!ranges.length) + return 0; + + this.$blockScrolling += 1; + var selection = this.multiSelect; + + if (!additive) + selection.toSingleRange(ranges[0]); + + for (var i = ranges.length; i--; ) + selection.addRange(ranges[i], true); + + this.$blockScrolling -= 1; + + return ranges.length; + }; + this.selectMoreLines = function(dir, skip) { + var range = this.selection.toOrientedRange(); + var isBackwards = range.cursor == range.end; + + var screenLead = this.session.documentToScreenPosition(range.cursor); + if (this.selection.$desiredColumn) + screenLead.column = this.selection.$desiredColumn; + + var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column); + + if (!range.isEmpty()) { + var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start); + var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column); + } else { + var anchor = lead; + } + + if (isBackwards) { + var newRange = Range.fromPoints(lead, anchor); + newRange.cursor = newRange.start; + } else { + var newRange = Range.fromPoints(anchor, lead); + newRange.cursor = newRange.end; + } + + newRange.desiredColumn = screenLead.column; + if (!this.selection.inMultiSelectMode) { + this.selection.addRange(range); + } else { + if (skip) + var toRemove = range.cursor; + } + + this.selection.addRange(newRange); + if (toRemove) + this.selection.substractPoint(toRemove); + }; + this.transposeSelections = function(dir) { + var session = this.session; + var sel = session.multiSelect; + var all = sel.ranges; + + for (var i = all.length; i--; ) { + var range = all[i]; + if (range.isEmpty()) { + var tmp = session.getWordRange(range.start.row, range.start.column); + range.start.row = tmp.start.row; + range.start.column = tmp.start.column; + range.end.row = tmp.end.row; + range.end.column = tmp.end.column; + } + } + sel.mergeOverlappingRanges(); + + var words = []; + for (var i = all.length; i--; ) { + var range = all[i]; + words.unshift(session.getTextRange(range)); + } + + if (dir < 0) + words.unshift(words.pop()); + else + words.push(words.shift()); + + for (var i = all.length; i--; ) { + var range = all[i]; + var tmp = range.clone(); + session.replace(range, words[i]); + range.start.row = tmp.start.row; + range.start.column = tmp.start.column; + } + }; + this.selectMore = function(dir, skip) { + var session = this.session; + var sel = session.multiSelect; + + var range = sel.toOrientedRange(); + if (range.isEmpty()) { + range = session.getWordRange(range.start.row, range.start.column); + range.cursor = dir == -1 ? range.start : range.end; + this.multiSelect.addRange(range); + } + var needle = session.getTextRange(range); + + var newRange = find(session, needle, dir); + if (newRange) { + newRange.cursor = dir == -1 ? newRange.start : newRange.end; + this.$blockScrolling += 1; + this.session.unfold(newRange); + this.multiSelect.addRange(newRange); + this.$blockScrolling -= 1; + this.renderer.scrollCursorIntoView(null, 0.5); + } + if (skip) + this.multiSelect.substractPoint(range.cursor); + }; + this.alignCursors = function() { + var session = this.session; + var sel = session.multiSelect; + var ranges = sel.ranges; + + if (!ranges.length) { + var range = this.selection.getRange(); + var fr = range.start.row, lr = range.end.row; + var guessRange = fr == lr; + if (guessRange) { + var max = this.session.getLength(); + var line; + do { + line = this.session.getLine(lr); + } while (/[=:]/.test(line) && ++lr < max); + do { + line = this.session.getLine(fr); + } while (/[=:]/.test(line) && --fr > 0); + + if (fr < 0) fr = 0; + if (lr >= max) lr = max - 1; + } + var lines = this.session.doc.removeLines(fr, lr); + lines = this.$reAlignText(lines, guessRange); + this.session.doc.insert({row: fr, column: 0}, lines.join("\n") + "\n"); + if (!guessRange) { + range.start.column = 0; + range.end.column = lines[lines.length - 1].length; + } + this.selection.setRange(range); + } else { + var row = -1; + var sameRowRanges = ranges.filter(function(r) { + if (r.cursor.row == row) + return true; + row = r.cursor.row; + }); + sel.$onRemoveRange(sameRowRanges); + + var maxCol = 0; + var minSpace = Infinity; + var spaceOffsets = ranges.map(function(r) { + var p = r.cursor; + var line = session.getLine(p.row); + var spaceOffset = line.substr(p.column).search(/\S/g); + if (spaceOffset == -1) + spaceOffset = 0; + + if (p.column > maxCol) + maxCol = p.column; + if (spaceOffset < minSpace) + minSpace = spaceOffset; + return spaceOffset; + }); + ranges.forEach(function(r, i) { + var p = r.cursor; + var l = maxCol - p.column; + var d = spaceOffsets[i] - minSpace; + if (l > d) + session.insert(p, lang.stringRepeat(" ", l - d)); + else + session.remove(new Range(p.row, p.column, p.row, p.column - l + d)); + + r.start.column = r.end.column = maxCol; + r.start.row = r.end.row = p.row; + r.cursor = r.end; + }); + sel.fromOrientedRange(ranges[0]); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + } + }; + + this.$reAlignText = function(lines, forceLeft) { + var isLeftAligned = true, isRightAligned = true; + var startW, textW, endW; + + return lines.map(function(line) { + var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/); + if (!m) + return [line]; + + if (startW == null) { + startW = m[1].length; + textW = m[2].length; + endW = m[3].length; + return m; + } + + if (startW + textW + endW != m[1].length + m[2].length + m[3].length) + isRightAligned = false; + if (startW != m[1].length) + isLeftAligned = false; + + if (startW > m[1].length) + startW = m[1].length; + if (textW < m[2].length) + textW = m[2].length; + if (endW > m[3].length) + endW = m[3].length; + + return m; + }).map(forceLeft ? alignLeft : + isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign); + + function spaces(n) { + return lang.stringRepeat(" ", n); + } + + function alignLeft(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(textW - m[2].length + endW) + + m[4].replace(/^([=:])\s+/, "$1 ") + } + function alignRight(m) { + return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2] + + spaces(endW, " ") + + m[4].replace(/^([=:])\s+/, "$1 ") + } + function unAlign(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(endW) + + m[4].replace(/^([=:])\s+/, "$1 ") + } + } +}).call(Editor.prototype); + + +function isSamePoint(p1, p2) { + return p1.row == p2.row && p1.column == p2.column; +} +exports.onSessionChange = function(e) { + var session = e.session; + if (!session.multiSelect) { + session.$selectionMarkers = []; + session.selection.$initRangeList(); + session.multiSelect = session.selection; + } + this.multiSelect = session.multiSelect; + + var oldSession = e.oldSession; + if (oldSession) { + oldSession.multiSelect.removeEventListener("addRange", this.$onAddRange); + oldSession.multiSelect.removeEventListener("removeRange", this.$onRemoveRange); + oldSession.multiSelect.removeEventListener("multiSelect", this.$onMultiSelect); + oldSession.multiSelect.removeEventListener("singleSelect", this.$onSingleSelect); + } + + session.multiSelect.on("addRange", this.$onAddRange); + session.multiSelect.on("removeRange", this.$onRemoveRange); + session.multiSelect.on("multiSelect", this.$onMultiSelect); + session.multiSelect.on("singleSelect", this.$onSingleSelect); + + if (this.inMultiSelectMode != session.selection.inMultiSelectMode) { + if (session.selection.inMultiSelectMode) + this.$onMultiSelect(); + else + this.$onSingleSelect(); + } +}; +function MultiSelect(editor) { + if (editor.$multiselectOnSessionChange) + return; + editor.$onAddRange = editor.$onAddRange.bind(editor); + editor.$onRemoveRange = editor.$onRemoveRange.bind(editor); + editor.$onMultiSelect = editor.$onMultiSelect.bind(editor); + editor.$onSingleSelect = editor.$onSingleSelect.bind(editor); + editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor); + + editor.$multiselectOnSessionChange(editor); + editor.on("changeSession", editor.$multiselectOnSessionChange); + + editor.on("mousedown", onMouseDown); + editor.commands.addCommands(commands.defaultCommands); + + addAltCursorListeners(editor); +} + +function addAltCursorListeners(editor){ + var el = editor.textInput.getElement(); + var altCursor = false; + event.addListener(el, "keydown", function(e) { + if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) { + if (!altCursor) { + editor.renderer.setMouseCursor("crosshair"); + altCursor = true; + } + } else if (altCursor) { + reset(); + } + }); + + event.addListener(el, "keyup", reset); + event.addListener(el, "blur", reset); + function reset(e) { + if (altCursor) { + editor.renderer.setMouseCursor(""); + altCursor = false; + } + } +} + +exports.MultiSelect = MultiSelect; + + +require("./config").defineOptions(Editor.prototype, "editor", { + enableMultiselect: { + set: function(val) { + MultiSelect(this); + if (val) { + this.on("changeSession", this.$multiselectOnSessionChange); + this.on("mousedown", onMouseDown); + } else { + this.off("changeSession", this.$multiselectOnSessionChange); + this.off("mousedown", onMouseDown); + } + }, + value: true + } +}) + + + +}); + +ace.define('ace/mouse/multi_select_handler', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) { + +var event = require("../lib/event"); +function isSamePoint(p1, p2) { + return p1.row == p2.row && p1.column == p2.column; +} + +function onMouseDown(e) { + var ev = e.domEvent; + var alt = ev.altKey; + var shift = ev.shiftKey; + var ctrl = e.getAccelKey(); + var button = e.getButton(); + + if (e.editor.inMultiSelectMode && button == 2) { + e.editor.textInput.onContextMenu(e.domEvent); + return; + } + + if (!ctrl && !alt) { + if (button == 0 && e.editor.inMultiSelectMode) + e.editor.exitMultiSelectMode(); + return; + } + + var editor = e.editor; + var selection = editor.selection; + var isMultiSelect = editor.inMultiSelectMode; + var pos = e.getDocumentPosition(); + var cursor = selection.getCursor(); + var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor)); + + + var mouseX = e.x, mouseY = e.y; + var onMouseSelection = function(e) { + mouseX = e.clientX; + mouseY = e.clientY; + }; + + var blockSelect = function() { + var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); + var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column); + + if (isSamePoint(screenCursor, newCursor) + && isSamePoint(cursor, selection.selectionLead)) + return; + screenCursor = newCursor; + + editor.selection.moveCursorToPosition(cursor); + editor.selection.clearSelection(); + editor.renderer.scrollCursorIntoView(); + + editor.removeSelectionMarkers(rectSel); + rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor); + rectSel.forEach(editor.addSelectionMarker, editor); + editor.updateSelectionMarkers(); + }; + + var session = editor.session; + var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); + var screenCursor = screenAnchor; + + + + if (ctrl && !shift && !alt && button == 0) { + if (!isMultiSelect && inSelection) + return; // dragging + + if (!isMultiSelect) { + var range = selection.toOrientedRange(); + editor.addSelectionMarker(range); + } + + var oldRange = selection.rangeList.rangeAtPoint(pos); + + editor.$blockScrolling++; + editor.once("mouseup", function() { + var tmpSel = selection.toOrientedRange(); + + if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor)) + selection.substractPoint(tmpSel.cursor); + else { + if (range) { + editor.removeSelectionMarker(range); + selection.addRange(range); + } + selection.addRange(tmpSel); + } + editor.$blockScrolling--; + }); + + } else if (alt && button == 0) { + e.stop(); + + if (isMultiSelect && !ctrl) + selection.toSingleRange(); + else if (!isMultiSelect && ctrl) + selection.addRange(); + + var rectSel = []; + if (shift) { + screenAnchor = session.documentToScreenPosition(selection.lead); + blockSelect(); + } else { + selection.moveCursorToPosition(pos); + selection.clearSelection(); + } + + + var onMouseSelectionEnd = function(e) { + clearInterval(timerId); + editor.removeSelectionMarkers(rectSel); + for (var i = 0; i < rectSel.length; i++) + selection.addRange(rectSel[i]); + }; + + var onSelectionInterval = blockSelect; + + event.capture(editor.container, onMouseSelection, onMouseSelectionEnd); + var timerId = setInterval(function() {onSelectionInterval();}, 20); + + return e.preventDefault(); + } +} + + +exports.onMouseDown = onMouseDown; + +}); + +ace.define('ace/commands/multi_select_commands', ['require', 'exports', 'module' , 'ace/keyboard/hash_handler'], function(require, exports, module) { +exports.defaultCommands = [{ + name: "addCursorAbove", + exec: function(editor) { editor.selectMoreLines(-1); }, + bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"}, + readonly: true +}, { + name: "addCursorBelow", + exec: function(editor) { editor.selectMoreLines(1); }, + bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"}, + readonly: true +}, { + name: "addCursorAboveSkipCurrent", + exec: function(editor) { editor.selectMoreLines(-1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"}, + readonly: true +}, { + name: "addCursorBelowSkipCurrent", + exec: function(editor) { editor.selectMoreLines(1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"}, + readonly: true +}, { + name: "selectMoreBefore", + exec: function(editor) { editor.selectMore(-1); }, + bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"}, + readonly: true +}, { + name: "selectMoreAfter", + exec: function(editor) { editor.selectMore(1); }, + bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"}, + readonly: true +}, { + name: "selectNextBefore", + exec: function(editor) { editor.selectMore(-1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"}, + readonly: true +}, { + name: "selectNextAfter", + exec: function(editor) { editor.selectMore(1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"}, + readonly: true +}, { + name: "splitIntoLines", + exec: function(editor) { editor.multiSelect.splitIntoLines(); }, + bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"}, + readonly: true +}, { + name: "alignCursors", + exec: function(editor) { editor.alignCursors(); }, + bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"} +}]; +exports.multiSelectCommands = [{ + name: "singleSelection", + bindKey: "esc", + exec: function(editor) { editor.exitMultiSelectMode(); }, + readonly: true, + isAvailable: function(editor) {return editor && editor.inMultiSelectMode} +}]; + +var HashHandler = require("../keyboard/hash_handler").HashHandler; +exports.keyboardHandler = new HashHandler(exports.multiSelectCommands); + +}); + +ace.define('ace/worker/worker_client', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/config'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; +var config = require("../config"); + +var WorkerClient = function(topLevelNamespaces, mod, classname) { + this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); + this.changeListener = this.changeListener.bind(this); + this.onMessage = this.onMessage.bind(this); + if (require.nameToUrl && !require.toUrl) + require.toUrl = require.nameToUrl; + + var workerUrl; + if (config.get("packaged") || !require.toUrl) { + workerUrl = config.moduleUrl(mod, "worker"); + } else { + var normalizePath = this.$normalizePath; + workerUrl = normalizePath(require.toUrl("ace/worker/worker.js", null, '_')); + + var tlns = {}; + topLevelNamespaces.forEach(function(ns) { + tlns[ns] = normalizePath(require.toUrl(ns, null, '_').replace(/(\.js)?(\?.*)?$/, "")); + }); + } + + this.$worker = new Worker(workerUrl); + this.$worker.postMessage({ + init : true, + tlns: tlns, + module: mod, + classname: classname + }); + + this.callbackId = 1; + this.callbacks = {}; + + this.$worker.onmessage = this.onMessage; +}; + +(function(){ + + oop.implement(this, EventEmitter); + + this.onMessage = function(e) { + var msg = e.data; + switch(msg.type) { + case "log": + window.console && console.log && console.log.apply(console, msg.data); + break; + + case "event": + this._emit(msg.name, {data: msg.data}); + break; + + case "call": + var callback = this.callbacks[msg.id]; + if (callback) { + callback(msg.data); + delete this.callbacks[msg.id]; + } + break; + } + }; + + this.$normalizePath = function(path) { + if (!location.host) // needed for file:// protocol + return path; + path = path.replace(/^[a-z]+:\/\/[^\/]+/, ""); // Remove domain name and rebuild it + path = location.protocol + "//" + location.host + + (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, "")) + + "/" + path.replace(/^[\/]+/, ""); + return path; + }; + + this.terminate = function() { + this._emit("terminate", {}); + this.deltaQueue = null; + this.$worker.terminate(); + this.$worker = null; + this.$doc.removeEventListener("change", this.changeListener); + this.$doc = null; + }; + + this.send = function(cmd, args) { + this.$worker.postMessage({command: cmd, args: args}); + }; + + this.call = function(cmd, args, callback) { + if (callback) { + var id = this.callbackId++; + this.callbacks[id] = callback; + args.push(id); + } + this.send(cmd, args); + }; + + this.emit = function(event, data) { + try { + this.$worker.postMessage({event: event, data: {data: data.data}}); + } + catch(ex) {} + }; + + this.attachToDocument = function(doc) { + if(this.$doc) + this.terminate(); + + this.$doc = doc; + this.call("setValue", [doc.getValue()]); + doc.on("change", this.changeListener); + }; + + this.changeListener = function(e) { + if (!this.deltaQueue) { + this.deltaQueue = [e.data]; + setTimeout(this.$sendDeltaQueue, 0); + } else + this.deltaQueue.push(e.data); + }; + + this.$sendDeltaQueue = function() { + var q = this.deltaQueue; + if (!q) return; + this.deltaQueue = null; + if (q.length > 20 && q.length > this.$doc.getLength() >> 1) { + this.call("setValue", [this.$doc.getValue()]); + } else + this.emit("change", {data: q}); + } + +}).call(WorkerClient.prototype); + + +var UIWorkerClient = function(topLevelNamespaces, mod, classname) { + this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); + this.changeListener = this.changeListener.bind(this); + this.callbackId = 1; + this.callbacks = {}; + this.messageBuffer = []; + + var main = null; + var sender = Object.create(EventEmitter); + var _self = this; + + this.$worker = {}; + this.$worker.terminate = function() {}; + this.$worker.postMessage = function(e) { + _self.messageBuffer.push(e); + main && setTimeout(processNext); + }; + + var processNext = function() { + var msg = _self.messageBuffer.shift(); + if (msg.command) + main[msg.command].apply(main, msg.args); + else if (msg.event) + sender._emit(msg.event, msg.data); + }; + + sender.postMessage = function(msg) { + _self.onMessage({data: msg}); + }; + sender.callback = function(data, callbackId) { + this.postMessage({type: "call", id: callbackId, data: data}); + }; + sender.emit = function(name, data) { + this.postMessage({type: "event", name: name, data: data}); + }; + + config.loadModule(["worker", mod], function(Main) { + main = new Main[classname](sender); + while (_self.messageBuffer.length) + processNext(); + }); +}; + +UIWorkerClient.prototype = WorkerClient.prototype; + +exports.UIWorkerClient = UIWorkerClient; +exports.WorkerClient = WorkerClient; + +}); +ace.define('ace/placeholder', ['require', 'exports', 'module' , 'ace/range', 'ace/lib/event_emitter', 'ace/lib/oop'], function(require, exports, module) { + + +var Range = require("./range").Range; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var oop = require("./lib/oop"); + +var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) { + var _self = this; + this.length = length; + this.session = session; + this.doc = session.getDocument(); + this.mainClass = mainClass; + this.othersClass = othersClass; + this.$onUpdate = this.onUpdate.bind(this); + this.doc.on("change", this.$onUpdate); + this.$others = others; + + this.$onCursorChange = function() { + setTimeout(function() { + _self.onCursorChange(); + }); + }; + + this.$pos = pos; + var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1}; + this.$undoStackDepth = undoStack.length; + this.setup(); + + session.selection.on("changeCursor", this.$onCursorChange); +}; + +(function() { + + oop.implement(this, EventEmitter); + this.setup = function() { + var _self = this; + var doc = this.doc; + var session = this.session; + var pos = this.$pos; + + this.pos = doc.createAnchor(pos.row, pos.column); + this.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false); + this.pos.on("change", function(event) { + session.removeMarker(_self.markerId); + _self.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.mainClass, null, false); + }); + this.others = []; + this.$others.forEach(function(other) { + var anchor = doc.createAnchor(other.row, other.column); + _self.others.push(anchor); + }); + session.setUndoSelect(false); + }; + this.showOtherMarkers = function() { + if(this.othersActive) return; + var session = this.session; + var _self = this; + this.othersActive = true; + this.others.forEach(function(anchor) { + anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false); + anchor.on("change", function(event) { + session.removeMarker(anchor.markerId); + anchor.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.othersClass, null, false); + }); + }); + }; + this.hideOtherMarkers = function() { + if(!this.othersActive) return; + this.othersActive = false; + for (var i = 0; i < this.others.length; i++) { + this.session.removeMarker(this.others[i].markerId); + } + }; + this.onUpdate = function(event) { + var delta = event.data; + var range = delta.range; + if(range.start.row !== range.end.row) return; + if(range.start.row !== this.pos.row) return; + if (this.$updating) return; + this.$updating = true; + var lengthDiff = delta.action === "insertText" ? range.end.column - range.start.column : range.start.column - range.end.column; + + if(range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1) { + var distanceFromStart = range.start.column - this.pos.column; + this.length += lengthDiff; + if(!this.session.$fromUndo) { + if(delta.action === "insertText") { + for (var i = this.others.length - 1; i >= 0; i--) { + var otherPos = this.others[i]; + var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + if(otherPos.row === range.start.row && range.start.column < otherPos.column) + newPos.column += lengthDiff; + this.doc.insert(newPos, delta.text); + } + } else if(delta.action === "removeText") { + for (var i = this.others.length - 1; i >= 0; i--) { + var otherPos = this.others[i]; + var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + if(otherPos.row === range.start.row && range.start.column < otherPos.column) + newPos.column += lengthDiff; + this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff)); + } + } + if(range.start.column === this.pos.column && delta.action === "insertText") { + setTimeout(function() { + this.pos.setPosition(this.pos.row, this.pos.column - lengthDiff); + for (var i = 0; i < this.others.length; i++) { + var other = this.others[i]; + var newPos = {row: other.row, column: other.column - lengthDiff}; + if(other.row === range.start.row && range.start.column < other.column) + newPos.column += lengthDiff; + other.setPosition(newPos.row, newPos.column); + } + }.bind(this), 0); + } + else if(range.start.column === this.pos.column && delta.action === "removeText") { + setTimeout(function() { + for (var i = 0; i < this.others.length; i++) { + var other = this.others[i]; + if(other.row === range.start.row && range.start.column < other.column) { + other.setPosition(other.row, other.column - lengthDiff); + } + } + }.bind(this), 0); + } + } + this.pos._emit("change", {value: this.pos}); + for (var i = 0; i < this.others.length; i++) { + this.others[i]._emit("change", {value: this.others[i]}); + } + } + this.$updating = false; + }; + + this.onCursorChange = function(event) { + if (this.$updating) return; + var pos = this.session.selection.getCursor(); + if(pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) { + this.showOtherMarkers(); + this._emit("cursorEnter", event); + } else { + this.hideOtherMarkers(); + this._emit("cursorLeave", event); + } + }; + this.detach = function() { + this.session.removeMarker(this.markerId); + this.hideOtherMarkers(); + this.doc.removeEventListener("change", this.$onUpdate); + this.session.selection.removeEventListener("changeCursor", this.$onCursorChange); + this.pos.detach(); + for (var i = 0; i < this.others.length; i++) { + this.others[i].detach(); + } + this.session.setUndoSelect(true); + }; + this.cancel = function() { + if(this.$undoStackDepth === -1) + throw Error("Canceling placeholders only supported with undo manager attached to session."); + var undoManager = this.session.getUndoManager(); + var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth; + for (var i = 0; i < undosRequired; i++) { + undoManager.undo(true); + } + }; +}).call(PlaceHolder.prototype); + + +exports.PlaceHolder = PlaceHolder; +}); + +ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { + + +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; + +(function() { + + this.foldingStartMarker = null; + this.foldingStopMarker = null; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + if (this.foldingStartMarker.test(line)) + return "start"; + if (foldStyle == "markbeginend" + && this.foldingStopMarker + && this.foldingStopMarker.test(line)) + return "end"; + return ""; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + return null; + }; + + this.indentationBlock = function(session, row, column) { + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1) + return; + + var startColumn = column || line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + var level = session.getLine(row).search(re); + + if (level == -1) + continue; + + if (level <= startLevel) + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + + this.openingBracketBlock = function(session, bracket, row, column, typeRe) { + var start = {row: row, column: column + 1}; + var end = session.$findClosingBracket(bracket, start, typeRe); + if (!end) + return; + + var fw = session.foldWidgets[end.row]; + if (fw == null) + fw = session.getFoldWidget(end.row); + + if (fw == "start" && end.row > start.row) { + end.row --; + end.column = session.getLine(end.row).length; + } + return Range.fromPoints(start, end); + }; + + this.closingBracketBlock = function(session, bracket, row, column, typeRe) { + var end = {row: row, column: column}; + var start = session.$findOpeningBracket(bracket, end); + + if (!start) + return; + + start.column++; + end.column--; + + return Range.fromPoints(start, end); + }; +}).call(FoldMode.prototype); + +}); + +ace.define('ace/theme/textmate', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { + + +exports.isDark = false; +exports.cssClass = "ace-tm"; +exports.cssText = ".ace-tm .ace_gutter {\ +background: #f0f0f0;\ +color: #333;\ +}\ +.ace-tm .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-tm .ace_fold {\ +background-color: #6B72E6;\ +}\ +.ace-tm {\ +background-color: #FFFFFF;\ +}\ +.ace-tm .ace_cursor {\ +color: black;\ +}\ +.ace-tm .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-tm .ace_storage,\ +.ace-tm .ace_keyword {\ +color: blue;\ +}\ +.ace-tm .ace_constant {\ +color: rgb(197, 6, 11);\ +}\ +.ace-tm .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-tm .ace_constant.ace_language {\ +color: rgb(88, 92, 246);\ +}\ +.ace-tm .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_invalid {\ +background-color: rgba(255, 0, 0, 0.1);\ +color: red;\ +}\ +.ace-tm .ace_support.ace_function {\ +color: rgb(60, 76, 114);\ +}\ +.ace-tm .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_support.ace_type,\ +.ace-tm .ace_support.ace_class {\ +color: rgb(109, 121, 222);\ +}\ +.ace-tm .ace_keyword.ace_operator {\ +color: rgb(104, 118, 135);\ +}\ +.ace-tm .ace_string {\ +color: rgb(3, 106, 7);\ +}\ +.ace-tm .ace_comment {\ +color: rgb(76, 136, 107);\ +}\ +.ace-tm .ace_comment.ace_doc {\ +color: rgb(0, 102, 255);\ +}\ +.ace-tm .ace_comment.ace_doc.ace_tag {\ +color: rgb(128, 159, 191);\ +}\ +.ace-tm .ace_constant.ace_numeric {\ +color: rgb(0, 0, 205);\ +}\ +.ace-tm .ace_variable {\ +color: rgb(49, 132, 149);\ +}\ +.ace-tm .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-tm .ace_entity.ace_name.ace_function {\ +color: #0000A2;\ +}\ +.ace-tm .ace_heading {\ +color: rgb(12, 7, 255);\ +}\ +.ace-tm .ace_list {\ +color:rgb(185, 6, 144);\ +}\ +.ace-tm .ace_meta.ace_tag {\ +color:rgb(0, 22, 142);\ +}\ +.ace-tm .ace_string.ace_regex {\ +color: rgb(255, 0, 0)\ +}\ +.ace-tm .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-tm.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px white;\ +border-radius: 2px;\ +}\ +.ace-tm .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-tm .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-tm .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-tm .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.07);\ +}\ +.ace-tm .ace_gutter-active-line {\ +background-color : #dcdcdc;\ +}\ +.ace-tm .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-tm .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); + +ace.define('ace/ext/error_marker', ['require', 'exports', 'module' , 'ace/line_widgets', 'ace/lib/dom', 'ace/range'], function(require, exports, module) { + +var LineWidgets = require("ace/line_widgets").LineWidgets; +var dom = require("ace/lib/dom"); +var Range = require("ace/range").Range; + +function binarySearch(array, needle, comparator) { + var first = 0; + var last = array.length - 1; + + while (first <= last) { + var mid = (first + last) >> 1; + var c = comparator(needle, array[mid]); + if (c > 0) + first = mid + 1; + else if (c < 0) + last = mid - 1; + else + return mid; + } + return -(first + 1); +} + +function findAnnotations(session, row, dir) { + var annotations = session.getAnnotations().sort(Range.comparePoints); + if (!annotations.length) + return; + + var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints); + if (i < 0) + i = -i - 1; + + if (i >= annotations.length - 1) + i = dir > 0 ? 0 : annotations.length - 1; + else if (i === 0 && dir < 0) + i = annotations.length - 1; + + var annotation = annotations[i]; + if (!annotation || !dir) + return; + + if (annotation.row === row) { + do { + annotation = annotations[i += dir]; + } while (annotation && annotation.row === row); + if (!annotation) + return annotations.slice(); + } + + + var matched = []; + row = annotation.row; + do { + matched[dir < 0 ? "unshift" : "push"](annotation); + annotation = annotations[i += dir]; + } while (annotation && annotation.row == row); + return matched.length && matched; +} + +exports.showErrorMarker = function(editor, dir) { + var session = editor.session; + if (!session.widgetManager) { + session.widgetManager = new LineWidgets(session); + session.widgetManager.attach(editor); + } + + var pos = editor.getCursorPosition(); + var row = pos.row; + var oldWidget = session.lineWidgets && session.lineWidgets[row]; + if (oldWidget) { + oldWidget.destroy(); + } else { + row -= dir; + } + var annotations = findAnnotations(session, row, dir); + var gutterAnno; + if (annotations) { + var annotation = annotations[0]; + if (annotation.pos && annotation.column == null) + pos.column = annotation.pos.sc; + pos.row = annotation.row; + gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; + } else if (oldWidget) { + return; + } else { + gutterAnno = { + text: ["Looks good!"], + className: "ace_ok" + }; + } + editor.session.unfold(pos.row); + editor.selection.moveCursorToPosition(pos); + editor.selection.clearSelection(); + + var w = { + row: pos.row, + fixedWidth: true, + coverGutter: true, + el: dom.createElement("div") + }; + var el = w.el.appendChild(dom.createElement("div")); + var arrow = w.el.appendChild(dom.createElement("div")); + arrow.className = "error_widget_arrow " + gutterAnno.className; + + var left = editor.renderer.$cursorLayer + .getPixelPosition(pos).left; + arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; + + w.el.className = "error_widget_wrapper"; + el.className = "error_widget " + gutterAnno.className; + el.innerHTML = gutterAnno.text.join("
    "); + + var kb = { + handleKeyboard:function(_,hashId, keyString) { + if (hashId === 0 && keyString === "esc") { + w.destroy(); + return true; + } + } + }; + + w.destroy = function() { + if (editor.$mouseHandler.isMousePressed) + return; + editor.keyBinding.removeKeyboardHandler(kb); + session.widgetManager.removeLineWidget(w); + editor.off("changeSelection", w.destroy); + editor.off("changeSession", w.destroy); + editor.off("mouseup", w.destroy); + editor.off("change", w.destroy); + }; + + editor.keyBinding.addKeyboardHandler(kb); + editor.on("changeSelection", w.destroy); + editor.on("changeSession", w.destroy); + editor.on("mouseup", w.destroy); + editor.on("change", w.destroy); + + editor.session.widgetManager.addLineWidget(w); + + w.el.onmousedown = editor.focus.bind(editor); +}; + + +dom.importCssString("\ + .error_widget_wrapper {\ + background: inherit;\ + color: inherit;\ + border:none\ + }\ + .error_widget {\ + border-top: solid 2px;\ + border-bottom: solid 2px;\ + margin: 5px 0;\ + padding: 10px 40px;\ + white-space: pre-wrap;\ + }\ + .error_widget.ace_error, .error_widget_arrow.ace_error{\ + border-color: #ff5a5a\ + }\ + .error_widget.ace_warning, .error_widget_arrow.ace_warning{\ + border-color: #F1D817\ + }\ + .error_widget.ace_info, .error_widget_arrow.ace_info{\ + border-color: #5a5a5a\ + }\ + .error_widget.ace_ok, .error_widget_arrow.ace_ok{\ + border-color: #5aaa5a\ + }\ + .error_widget_arrow {\ + position: absolute;\ + border: solid 5px;\ + border-top-color: transparent!important;\ + border-right-color: transparent!important;\ + border-left-color: transparent!important;\ + top: -5px;\ + }\ +", ""); + +}); + +ace.define('ace/line_widgets', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/range'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var Range = require("./range").Range; + + +function LineWidgets(session) { + this.session = session; + this.session.widgetManager = this; + this.session.getRowLength = this.getRowLength; + this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; + this.updateOnChange = this.updateOnChange.bind(this); + this.renderWidgets = this.renderWidgets.bind(this); + this.measureWidgets = this.measureWidgets.bind(this); + this.session._changedWidgets = []; + this.detach = this.detach.bind(this); + + this.session.on("change", this.updateOnChange); +} + +(function() { + this.getRowLength = function(row) { + var h; + if (this.lineWidgets) + h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0; + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1 + h; + } else { + return this.$wrapData[row].length + 1 + h; + } + }; + + this.$getWidgetScreenLength = function() { + var screenRows = 0; + this.lineWidgets.forEach(function(w){ + if (w && w.rowCount) + screenRows +=w.rowCount; + }); + return screenRows; + }; + + this.attach = function(editor) { + if (editor.widgetManager && editor.widgetManager != this) + editor.widgetManager.detach(); + + if (this.editor == editor) + return; + + this.detach(); + this.editor = editor; + + this.editor.on("changeSession", this.detach); + + editor.widgetManager = this; + + editor.setOption("enableLineWidgets", true); + editor.renderer.on("beforeRender", this.measureWidgets); + editor.renderer.on("afterRender", this.renderWidgets); + }; + this.detach = function(e) { + if (e && e.session == this.session) + return; // sometimes attach can be called before setSession + var editor = this.editor; + if (!editor) + return; + + editor.off("changeSession", this.detach); + + this.editor = null; + editor.widgetManager = null; + + editor.renderer.off("beforeRender", this.measureWidgets); + editor.renderer.off("afterRender", this.renderWidgets); + var lineWidgets = this.session.lineWidgets; + lineWidgets && lineWidgets.forEach(function(w) { + if (w && w.el && w.el.parentNode) { + w._inDocument = false; + w.el.parentNode.removeChild(w.el); + } + }); + }; + + this.updateOnChange = function(e) { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) return; + + var delta = e.data; + var range = delta.range; + var startRow = range.start.row; + var len = range.end.row - startRow; + + if (len === 0) { + } else if (delta.action == "removeText" || delta.action == "removeLines") { + var removed = lineWidgets.splice(startRow + 1, len); + removed.forEach(function(w) { + w && this.removeLineWidget(w); + }, this); + this.$updateRows(); + } else { + var args = new Array(len); + args.unshift(startRow, 0); + lineWidgets.splice.apply(lineWidgets, args); + this.$updateRows(); + } + }; + + this.$updateRows = function() { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) return; + var noWidgets = true; + lineWidgets.forEach(function(w, i) { + if (w) { + noWidgets = false; + w.row = i; + } + }); + if (noWidgets) + this.session.lineWidgets = null; + }; + + this.addLineWidget = function(w) { + if (!this.session.lineWidgets) + this.session.lineWidgets = new Array(this.session.getLength()); + + this.session.lineWidgets[w.row] = w; + + var renderer = this.editor.renderer; + if (w.html && !w.el) { + w.el = dom.createElement("div"); + w.el.innerHTML = w.html; + } + if (w.el) { + dom.addCssClass(w.el, "ace_lineWidgetContainer"); + w.el.style.position = "absolute"; + w.el.style.zIndex = 5; + renderer.container.appendChild(w.el); + w._inDocument = true; + } + + if (!w.coverGutter) { + w.el.style.zIndex = 3; + } + if (!w.pixelHeight) { + w.pixelHeight = w.el.offsetHeight; + } + if (w.rowCount == null) + w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; + + this.session._emit("changeFold", {data:{start:{row: w.row}}}); + + this.$updateRows(); + this.renderWidgets(null, renderer); + return w; + }; + + this.removeLineWidget = function(w) { + w._inDocument = false; + if (w.el && w.el.parentNode) + w.el.parentNode.removeChild(w.el); + if (w.editor && w.editor.destroy) try { + w.editor.destroy(); + } catch(e){} + if (this.session.lineWidgets) + this.session.lineWidgets[w.row] = undefined; + this.session._emit("changeFold", {data:{start:{row: w.row}}}); + this.$updateRows(); + }; + + this.onWidgetChanged = function(w) { + this.session._changedWidgets.push(w); + this.editor && this.editor.renderer.updateFull(); + }; + + this.measureWidgets = function(e, renderer) { + var changedWidgets = this.session._changedWidgets; + var config = renderer.layerConfig; + + if (!changedWidgets || !changedWidgets.length) return; + var min = Infinity; + for (var i = 0; i < changedWidgets.length; i++) { + var w = changedWidgets[i]; + if (!w._inDocument) { + w._inDocument = true; + renderer.container.appendChild(w.el); + } + + w.h = w.el.offsetHeight; + + if (!w.fixedWidth) { + w.w = w.el.offsetWidth; + w.screenWidth = Math.ceil(w.w / config.characterWidth); + } + + var rowCount = w.h / config.lineHeight; + if (w.coverLine) { + rowCount -= this.session.getRowLineCount(w.row); + if (rowCount < 0) + rowCount = 0; + } + if (w.rowCount != rowCount) { + w.rowCount = rowCount; + if (w.row < min) + min = w.row; + } + } + if (min != Infinity) { + this.session._emit("changeFold", {data:{start:{row: min}}}); + this.session.lineWidgetWidth = null; + } + this.session._changedWidgets = []; + }; + + this.renderWidgets = function(e, renderer) { + var config = renderer.layerConfig; + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var first = Math.min(this.firstRow, config.firstRow); + var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); + + while (first > 0 && !lineWidgets[first]) + first--; + + this.firstRow = config.firstRow; + this.lastRow = config.lastRow; + + renderer.$cursorLayer.config = config; + for (var i = first; i <= last; i++) { + var w = lineWidgets[i]; + if (!w || !w.el) continue; + + if (!w._inDocument) { + w._inDocument = true; + renderer.container.appendChild(w.el); + } + var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top; + if (!w.coverLine) + top += config.lineHeight * this.session.getRowLineCount(w.row); + w.el.style.top = top - config.offset + "px"; + + var left = w.coverGutter ? 0 : renderer.gutterWidth; + if (!w.fixedWidth) + left -= renderer.scrollLeft; + w.el.style.left = left + "px"; + + if (w.fixedWidth) { + w.el.style.right = renderer.scrollBar.getWidth() + "px"; + } else { + w.el.style.right = ""; + } + } + }; + +}).call(LineWidgets.prototype); + + +exports.LineWidgets = LineWidgets; + +}); + + + + +; + (function() { + ace.require(["ace/ace"], function(a) { + a && a.config.init(); + if (!window.ace) + window.ace = {}; + for (var key in a) if (a.hasOwnProperty(key)) + ace[key] = a[key]; + }); + })(); + \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ext-language_tools.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ext-language_tools.js new file mode 100644 index 0000000..c456633 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ext-language_tools.js @@ -0,0 +1,1665 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +ace.define('ace/ext/language_tools', ['require', 'exports', 'module' , 'ace/snippets', 'ace/autocomplete', 'ace/config', 'ace/autocomplete/text_completer', 'ace/editor'], function(require, exports, module) { + + +var snippetManager = require("../snippets").snippetManager; +var Autocomplete = require("../autocomplete").Autocomplete; +var config = require("../config"); + +var textCompleter = require("../autocomplete/text_completer"); +var keyWordCompleter = { + getCompletions: function(editor, session, pos, prefix, callback) { + var state = editor.session.getState(pos.row); + var completions = session.$mode.getCompletions(state, session, pos, prefix); + callback(null, completions); + } +}; + +var snippetCompleter = { + getCompletions: function(editor, session, pos, prefix, callback) { + var snippetMap = snippetManager.snippetMap; + var completions = []; + snippetManager.getActiveScopes(editor).forEach(function(scope) { + var snippets = snippetMap[scope] || []; + for (var i = snippets.length; i--;) { + var s = snippets[i]; + var caption = s.name || s.tabTrigger; + if (!caption) + continue; + completions.push({ + caption: caption, + snippet: s.content, + meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet" + }); + } + }, this); + callback(null, completions); + } +}; + +var completers = [snippetCompleter, textCompleter, keyWordCompleter]; +exports.addCompleter = function(completer) { + completers.push(completer); +}; + +var expandSnippet = { + name: "expandSnippet", + exec: function(editor) { + var success = snippetManager.expandWithTab(editor); + if (!success) + editor.execCommand("indent"); + }, + bindKey: "tab" +}; + +var onChangeMode = function(e, editor) { + loadSnippetsForMode(editor.session.$mode); +}; + +var loadSnippetsForMode = function(mode) { + var id = mode.$id; + if (!snippetManager.files) + snippetManager.files = {}; + loadSnippetFile(id); + if (mode.modes) + mode.modes.forEach(loadSnippetsForMode); +}; + +var loadSnippetFile = function(id) { + if (!id || snippetManager.files[id]) + return; + var snippetFilePath = id.replace("mode", "snippets"); + snippetManager.files[id] = {}; + config.loadModule(snippetFilePath, function(m) { + if (m) { + snippetManager.files[id] = m; + m.snippets = snippetManager.parseSnippetFile(m.snippetText); + snippetManager.register(m.snippets, m.scope); + if (m.includeScopes) { + snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes; + m.includeScopes.forEach(function(x) { + loadSnippetFile("ace/mode/" + x); + }); + } + } + }); +}; + +var Editor = require("../editor").Editor; +require("../config").defineOptions(Editor.prototype, "editor", { + enableBasicAutocompletion: { + set: function(val) { + if (val) { + this.completers = completers; + this.commands.addCommand(Autocomplete.startCommand); + } else { + this.commands.removeCommand(Autocomplete.startCommand); + } + }, + value: false + }, + enableSnippets: { + set: function(val) { + if (val) { + this.commands.addCommand(expandSnippet); + this.on("changeMode", onChangeMode); + onChangeMode(null, this); + } else { + this.commands.removeCommand(expandSnippet); + this.off("changeMode", onChangeMode); + } + }, + value: false + } +}); + +}); + +ace.define('ace/snippets', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/range', 'ace/keyboard/hash_handler', 'ace/tokenizer', 'ace/lib/dom'], function(require, exports, module) { + +var lang = require("./lib/lang") +var Range = require("./range").Range +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var Tokenizer = require("./tokenizer").Tokenizer; +var comparePoints = Range.comparePoints; + +var SnippetManager = function() { + this.snippetMap = {}; + this.snippetNameMap = {}; +}; + +(function() { + this.getTokenizer = function() { + function TabstopToken(str, _, stack) { + str = str.substr(1); + if (/^\d+$/.test(str) && !stack.inFormatString) + return [{tabstopId: parseInt(str, 10)}]; + return [{text: str}] + } + function escape(ch) { + return "(?:[^\\\\" + ch + "]|\\\\.)"; + } + SnippetManager.$tokenizer = new Tokenizer({ + start: [ + {regex: /:/, onMatch: function(val, state, stack) { + if (stack.length && stack[0].expectIf) { + stack[0].expectIf = false; + stack[0].elseBranch = stack[0]; + return [stack[0]]; + } + return ":"; + }}, + {regex: /\\./, onMatch: function(val, state, stack) { + var ch = val[1]; + if (ch == "}" && stack.length) { + val = ch; + }else if ("`$\\".indexOf(ch) != -1) { + val = ch; + } else if (stack.inFormatString) { + if (ch == "n") + val = "\n"; + else if (ch == "t") + val = "\n"; + else if ("ulULE".indexOf(ch) != -1) { + val = {changeCase: ch, local: ch > "a"}; + } + } + + return [val]; + }}, + {regex: /}/, onMatch: function(val, state, stack) { + return [stack.length ? stack.shift() : val]; + }}, + {regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken}, + {regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) { + var t = TabstopToken(str.substr(1), state, stack); + stack.unshift(t[0]); + return t; + }, next: "snippetVar"}, + {regex: /\n/, token: "newline", merge: false} + ], + snippetVar: [ + {regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) { + stack[0].choices = val.slice(1, -1).split(","); + }, next: "start"}, + {regex: "/(" + escape("/") + "+)/(?:(" + escape("/") + "*)/)(\\w*):?", + onMatch: function(val, state, stack) { + var ts = stack[0]; + ts.fmtString = val; + + val = this.splitRegex.exec(val); + ts.guard = val[1]; + ts.fmt = val[2]; + ts.flag = val[3]; + return ""; + }, next: "start"}, + {regex: "`" + escape("`") + "*`", onMatch: function(val, state, stack) { + stack[0].code = val.splice(1, -1); + return ""; + }, next: "start"}, + {regex: "\\?", onMatch: function(val, state, stack) { + if (stack[0]) + stack[0].expectIf = true; + }, next: "start"}, + {regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"} + ], + formatString: [ + {regex: "/(" + escape("/") + "+)/", token: "regex"}, + {regex: "", onMatch: function(val, state, stack) { + stack.inFormatString = true; + }, next: "start"} + ] + }); + SnippetManager.prototype.getTokenizer = function() { + return SnippetManager.$tokenizer; + } + return SnippetManager.$tokenizer; + }; + + this.tokenizeTmSnippet = function(str, startState) { + return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) { + return x.value || x; + }); + }; + + this.$getDefaultValue = function(editor, name) { + if (/^[A-Z]\d+$/.test(name)) { + var i = name.substr(1); + return (this.variables[name[0] + "__"] || {})[i]; + } + if (/^\d+$/.test(name)) { + return (this.variables.__ || {})[name]; + } + name = name.replace(/^TM_/, ""); + + if (!editor) + return; + var s = editor.session; + switch(name) { + case "CURRENT_WORD": + var r = s.getWordRange(); + case "SELECTION": + case "SELECTED_TEXT": + return s.getTextRange(r); + case "CURRENT_LINE": + return s.getLine(editor.getCursorPosition().row); + case "PREV_LINE": // not possible in textmate + return s.getLine(editor.getCursorPosition().row - 1); + case "LINE_INDEX": + return editor.getCursorPosition().column; + case "LINE_NUMBER": + return editor.getCursorPosition().row + 1; + case "SOFT_TABS": + return s.getUseSoftTabs() ? "YES" : "NO"; + case "TAB_SIZE": + return s.getTabSize(); + case "FILENAME": + case "FILEPATH": + return "ace.ajax.org"; + case "FULLNAME": + return "Ace"; + } + }; + this.variables = {}; + this.getVariableValue = function(editor, varName) { + if (this.variables.hasOwnProperty(varName)) + return this.variables[varName](editor, varName) || ""; + return this.$getDefaultValue(editor, varName) || ""; + }; + this.tmStrFormat = function(str, ch, editor) { + var flag = ch.flag || ""; + var re = ch.guard; + re = new RegExp(re, flag.replace(/[^gi]/, "")); + var fmtTokens = this.tokenizeTmSnippet(ch.fmt, "formatString"); + var _self = this; + var formatted = str.replace(re, function() { + _self.variables.__ = arguments; + var fmtParts = _self.resolveVariables(fmtTokens, editor); + var gChangeCase = "E"; + for (var i = 0; i < fmtParts.length; i++) { + var ch = fmtParts[i]; + if (typeof ch == "object") { + fmtParts[i] = ""; + if (ch.changeCase && ch.local) { + var next = fmtParts[i + 1]; + if (next && typeof next == "string") { + if (ch.changeCase == "u") + fmtParts[i] = next[0].toUpperCase(); + else + fmtParts[i] = next[0].toLowerCase(); + fmtParts[i + 1] = next.substr(1); + } + } else if (ch.changeCase) { + gChangeCase = ch.changeCase; + } + } else if (gChangeCase == "U") { + fmtParts[i] = ch.toUpperCase(); + } else if (gChangeCase == "L") { + fmtParts[i] = ch.toLowerCase(); + } + } + return fmtParts.join(""); + }); + this.variables.__ = null; + return formatted; + }; + + this.resolveVariables = function(snippet, editor) { + var result = []; + for (var i = 0; i < snippet.length; i++) { + var ch = snippet[i]; + if (typeof ch == "string") { + result.push(ch); + } else if (typeof ch != "object") { + continue; + } else if (ch.skip) { + gotoNext(ch); + } else if (ch.processed < i) { + continue; + } else if (ch.text) { + var value = this.getVariableValue(editor, ch.text); + if (value && ch.fmtString) + value = this.tmStrFormat(value, ch); + ch.processed = i; + if (ch.expectIf == null) { + if (value) { + result.push(value); + gotoNext(ch); + } + } else { + if (value) { + ch.skip = ch.elseBranch; + } else + gotoNext(ch); + } + } else if (ch.tabstopId != null) { + result.push(ch); + } else if (ch.changeCase != null) { + result.push(ch); + } + } + function gotoNext(ch) { + var i1 = snippet.indexOf(ch, i + 1); + if (i1 != -1) + i = i1; + } + return result; + }; + + this.insertSnippet = function(editor, snippetText) { + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var indentString = line.match(/^\s*/)[0]; + var tabString = editor.session.getTabString(); + + var tokens = this.tokenizeTmSnippet(snippetText); + tokens = this.resolveVariables(tokens, editor); + tokens = tokens.map(function(x) { + if (x == "\n") + return x + indentString; + if (typeof x == "string") + return x.replace(/\t/g, tabString); + return x; + }); + var tabstops = []; + tokens.forEach(function(p, i) { + if (typeof p != "object") + return; + var id = p.tabstopId; + var ts = tabstops[id]; + if (!ts) { + ts = tabstops[id] = []; + ts.index = id; + ts.value = ""; + } + if (ts.indexOf(p) !== -1) + return; + ts.push(p); + var i1 = tokens.indexOf(p, i + 1); + if (i1 === -1) + return; + + var value = tokens.slice(i + 1, i1); + var isNested = value.some(function(t) {return typeof t === "object"}); + if (isNested && !ts.value) { + ts.value = value; + } else if (value.length && (!ts.value || typeof ts.value !== "string")) { + ts.value = value.join(""); + } + }); + tabstops.forEach(function(ts) {ts.length = 0}); + var expanding = {}; + function copyValue(val) { + var copy = [] + for (var i = 0; i < val.length; i++) { + var p = val[i]; + if (typeof p == "object") { + if (expanding[p.tabstopId]) + continue; + var j = val.lastIndexOf(p, i - 1); + p = copy[j] || {tabstopId: p.tabstopId}; + } + copy[i] = p; + } + return copy; + } + for (var i = 0; i < tokens.length; i++) { + var p = tokens[i]; + if (typeof p != "object") + continue; + var id = p.tabstopId; + var i1 = tokens.indexOf(p, i + 1); + if (expanding[id] == p) { + expanding[id] = null; + continue; + } + + var ts = tabstops[id]; + var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value); + arg.unshift(i + 1, Math.max(0, i1 - i)); + arg.push(p); + expanding[id] = p; + tokens.splice.apply(tokens, arg); + + if (ts.indexOf(p) === -1) + ts.push(p); + }; + var row = 0, column = 0; + var text = ""; + tokens.forEach(function(t) { + if (typeof t === "string") { + if (t[0] === "\n"){ + column = t.length - 1; + row ++; + } else + column += t.length; + text += t; + } else { + if (!t.start) + t.start = {row: row, column: column}; + else + t.end = {row: row, column: column}; + } + }); + var range = editor.getSelectionRange(); + var end = editor.session.replace(range, text); + + var tabstopManager = new TabstopManager(editor); + tabstopManager.addTabstops(tabstops, range.start, end); + tabstopManager.tabNext(); + }; + + this.$getScope = function(editor) { + var scope = editor.session.$mode.$id || ""; + scope = scope.split("/").pop(); + if (scope === "html" || scope === "php") { + if (scope === "php") + scope = "html"; + var c = editor.getCursorPosition() + var state = editor.session.getState(c.row); + if (typeof state === "object") { + state = state[0]; + } + if (state.substring) { + if (state.substring(0, 3) == "js-") + scope = "javascript"; + else if (state.substring(0, 4) == "css-") + scope = "css"; + else if (state.substring(0, 4) == "php-") + scope = "php"; + } + } + + return scope; + }; + + this.getActiveScopes = function(editor) { + var scope = this.$getScope(editor); + var scopes = [scope]; + var snippetMap = this.snippetMap; + if (snippetMap[scope] && snippetMap[scope].includeScopes) { + scopes.push.apply(scopes, snippetMap[scope].includeScopes); + } + scopes.push("_"); + return scopes; + }; + + this.expandWithTab = function(editor) { + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var before = line.substring(0, cursor.column); + var after = line.substr(cursor.column); + + var snippetMap = this.snippetMap; + var snippet; + this.getActiveScopes(editor).some(function(scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = this.findMatchingSnippet(snippets, before, after); + return !!snippet; + }, this); + if (!snippet) + return false; + + editor.session.doc.removeInLine(cursor.row, + cursor.column - snippet.replaceBefore.length, + cursor.column + snippet.replaceAfter.length + ); + + this.variables.M__ = snippet.matchBefore; + this.variables.T__ = snippet.matchAfter; + this.insertSnippet(editor, snippet.content); + + this.variables.M__ = this.variables.T__ = null; + return true; + }; + + this.findMatchingSnippet = function(snippetList, before, after) { + for (var i = snippetList.length; i--;) { + var s = snippetList[i]; + if (s.startRe && !s.startRe.test(before)) + continue; + if (s.endRe && !s.endRe.test(after)) + continue; + if (!s.startRe && !s.endRe) + continue; + + s.matchBefore = s.startRe ? s.startRe.exec(before) : [""]; + s.matchAfter = s.endRe ? s.endRe.exec(after) : [""]; + s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : ""; + s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : ""; + return s; + } + }; + + this.snippetMap = {}; + this.snippetNameMap = {}; + this.register = function(snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + var self = this; + function wrapRegexp(src) { + if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src)) + src = "(?:" + src + ")" + + return src || ""; + } + function guardedRegexp(re, guard, opening) { + re = wrapRegexp(re); + guard = wrapRegexp(guard); + if (opening) { + re = guard + re; + if (re && re[re.length - 1] != "$") + re = re + "$"; + } else { + re = re + guard; + if (re && re[0] != "^") + re = "^" + re; + } + return new RegExp(re); + } + + function addSnippet(s) { + if (!s.scope) + s.scope = scope || "_"; + scope = s.scope + if (!snippetMap[scope]) { + snippetMap[scope] = []; + snippetNameMap[scope] = {}; + } + + var map = snippetNameMap[scope]; + if (s.name) { + var old = map[s.name]; + if (old) + self.unregister(old); + map[s.name] = s; + } + snippetMap[scope].push(s); + + if (s.tabTrigger && !s.trigger) { + if (!s.guard && /^\w/.test(s.tabTrigger)) + s.guard = "\\b"; + s.trigger = lang.escapeRegExp(s.tabTrigger); + } + + s.startRe = guardedRegexp(s.trigger, s.guard, true); + s.triggerRe = new RegExp(s.trigger, "", true); + + s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true); + s.endTriggerRe = new RegExp(s.endTrigger, "", true); + }; + + if (snippets.content) + addSnippet(snippets); + else if (Array.isArray(snippets)) + snippets.forEach(addSnippet); + }; + this.unregister = function(snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + + function removeSnippet(s) { + var nameMap = snippetNameMap[s.scope||scope]; + if (nameMap && nameMap[s.name]) { + delete nameMap[s.name]; + var map = snippetMap[s.scope||scope]; + var i = map && map.indexOf(s); + if (i >= 0) + map.splice(i, 1); + } + } + if (snippets.content) + removeSnippet(snippets); + else if (Array.isArray(snippets)) + snippets.forEach(removeSnippet); + }; + this.parseSnippetFile = function(str) { + str = str.replace(/\r/g, ""); + var list = [], snippet = {}; + var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm; + var m; + while (m = re.exec(str)) { + if (m[1]) { + try { + snippet = JSON.parse(m[1]) + list.push(snippet); + } catch (e) {} + } if (m[4]) { + snippet.content = m[4].replace(/^\t/gm, ""); + list.push(snippet); + snippet = {}; + } else { + var key = m[2], val = m[3]; + if (key == "regex") { + var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g; + snippet.guard = guardRe.exec(val)[1]; + snippet.trigger = guardRe.exec(val)[1]; + snippet.endTrigger = guardRe.exec(val)[1]; + snippet.endGuard = guardRe.exec(val)[1]; + } else if (key == "snippet") { + snippet.tabTrigger = val.match(/^\S*/)[0]; + if (!snippet.name) + snippet.name = val; + } else { + snippet[key] = val; + } + } + } + return list; + }; + this.getSnippetByName = function(name, editor) { + var snippetMap = this.snippetNameMap; + var snippet; + this.getActiveScopes(editor).some(function(scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = snippets[name]; + return !!snippet; + }, this); + return snippet; + }; + +}).call(SnippetManager.prototype); + + +var TabstopManager = function(editor) { + if (editor.tabstopManager) + return editor.tabstopManager; + editor.tabstopManager = this; + this.$onChange = this.onChange.bind(this); + this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule; + this.$onChangeSession = this.onChangeSession.bind(this); + this.$onAfterExec = this.onAfterExec.bind(this); + this.attach(editor); +}; +(function() { + this.attach = function(editor) { + this.index = -1; + this.ranges = []; + this.tabstops = []; + this.selectedTabstop = null; + + this.editor = editor; + this.editor.on("change", this.$onChange); + this.editor.on("changeSelection", this.$onChangeSelection); + this.editor.on("changeSession", this.$onChangeSession); + this.editor.commands.on("afterExec", this.$onAfterExec); + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + }; + this.detach = function() { + this.tabstops.forEach(this.removeTabstopMarkers, this); + this.ranges = null; + this.tabstops = null; + this.selectedTabstop = null; + this.editor.removeListener("change", this.$onChange); + this.editor.removeListener("changeSelection", this.$onChangeSelection); + this.editor.removeListener("changeSession", this.$onChangeSession); + this.editor.commands.removeListener("afterExec", this.$onAfterExec); + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.tabstopManager = null; + this.editor = null; + }; + + this.onChange = function(e) { + var changeRange = e.data.range; + var isRemove = e.data.action[0] == "r"; + var start = changeRange.start; + var end = changeRange.end; + var startRow = start.row; + var endRow = end.row; + var lineDif = endRow - startRow; + var colDiff = end.column - start.column; + + if (isRemove) { + lineDif = -lineDif; + colDiff = -colDiff; + } + if (!this.$inChange && isRemove) { + var ts = this.selectedTabstop; + var changedOutside = !ts.some(function(r) { + return comparePoints(r.start, start) <= 0 && comparePoints(r.end, end) >= 0; + }); + if (changedOutside) + return this.detach(); + } + var ranges = this.ranges; + for (var i = 0; i < ranges.length; i++) { + var r = ranges[i]; + if (r.end.row < start.row) + continue; + + if (comparePoints(start, r.start) < 0 && comparePoints(end, r.end) > 0) { + this.removeRange(r); + i--; + continue; + } + + if (r.start.row == startRow && r.start.column > start.column) + r.start.column += colDiff; + if (r.end.row == startRow && r.end.column >= start.column) + r.end.column += colDiff; + if (r.start.row >= startRow) + r.start.row += lineDif; + if (r.end.row >= startRow) + r.end.row += lineDif; + + if (comparePoints(r.start, r.end) > 0) + this.removeRange(r); + } + if (!ranges.length) + this.detach(); + }; + this.updateLinkedFields = function() { + var ts = this.selectedTabstop; + if (!ts.hasLinkedRanges) + return; + this.$inChange = true; + var session = this.editor.session; + var text = session.getTextRange(ts.firstNonLinked); + for (var i = ts.length; i--;) { + var range = ts[i]; + if (!range.linked) + continue; + var fmt = exports.snippetManager.tmStrFormat(text, range.original) + session.replace(range, fmt); + } + this.$inChange = false; + }; + this.onAfterExec = function(e) { + if (e.command && !e.command.readOnly) + this.updateLinkedFields(); + }; + this.onChangeSelection = function() { + if (!this.editor) + return + var lead = this.editor.selection.lead; + var anchor = this.editor.selection.anchor; + var isEmpty = this.editor.selection.isEmpty(); + for (var i = this.ranges.length; i--;) { + if (this.ranges[i].linked) + continue; + var containsLead = this.ranges[i].contains(lead.row, lead.column); + var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column); + if (containsLead && containsAnchor) + return; + } + this.detach(); + }; + this.onChangeSession = function() { + this.detach(); + }; + this.tabNext = function(dir) { + var max = this.tabstops.length - 1; + var index = this.index + (dir || 1); + index = Math.min(Math.max(index, 0), max); + this.selectTabstop(index); + if (index == max) + this.detach(); + }; + this.selectTabstop = function(index) { + var ts = this.tabstops[this.index]; + if (ts) + this.addTabstopMarkers(ts); + this.index = index; + ts = this.tabstops[this.index]; + if (!ts || !ts.length) + return; + + this.selectedTabstop = ts; + if (!this.editor.inVirtualSelectionMode) { + var sel = this.editor.multiSelect; + sel.toSingleRange(ts.firstNonLinked.clone()); + for (var i = ts.length; i--;) { + if (ts.hasLinkedRanges && ts[i].linked) + continue; + sel.addRange(ts[i].clone(), true); + } + } else { + this.editor.selection.setRange(ts.firstNonLinked); + } + + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + }; + this.addTabstops = function(tabstops, start, end) { + if (!tabstops[0]) { + var p = Range.fromPoints(end, end); + moveRelative(p.start, start); + moveRelative(p.end, start); + tabstops[0] = [p]; + tabstops[0].index = 0; + } + + var i = this.index; + var arg = [i, 0]; + var ranges = this.ranges; + var editor = this.editor; + tabstops.forEach(function(ts) { + for (var i = ts.length; i--;) { + var p = ts[i]; + var range = Range.fromPoints(p.start, p.end || p.start); + movePoint(range.start, start); + movePoint(range.end, start); + range.original = p; + range.tabstop = ts; + ranges.push(range); + ts[i] = range; + if (p.fmtString) { + range.linked = true; + ts.hasLinkedRanges = true; + } else if (!ts.firstNonLinked) + ts.firstNonLinked = range; + } + if (!ts.firstNonLinked) + ts.hasLinkedRanges = false; + arg.push(ts); + this.addTabstopMarkers(ts); + }, this); + arg.push(arg.splice(2, 1)[0]); + this.tabstops.splice.apply(this.tabstops, arg); + }; + + this.addTabstopMarkers = function(ts) { + var session = this.editor.session; + ts.forEach(function(range) { + if (!range.markerId) + range.markerId = session.addMarker(range, "ace_snippet-marker", "text"); + }); + }; + this.removeTabstopMarkers = function(ts) { + var session = this.editor.session; + ts.forEach(function(range) { + session.removeMarker(range.markerId); + range.markerId = null; + }); + }; + this.removeRange = function(range) { + var i = range.tabstop.indexOf(range); + range.tabstop.splice(i, 1); + i = this.ranges.indexOf(range); + this.ranges.splice(i, 1); + this.editor.session.removeMarker(range.markerId); + }; + + this.keyboardHandler = new HashHandler(); + this.keyboardHandler.bindKeys({ + "Tab": function(ed) { + if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) { + return; + } + + ed.tabstopManager.tabNext(1); + }, + "Shift-Tab": function(ed) { + ed.tabstopManager.tabNext(-1); + }, + "Esc": function(ed) { + ed.tabstopManager.detach(); + }, + "Return": function(ed) { + return false; + } + }); +}).call(TabstopManager.prototype); + + +var movePoint = function(point, diff) { + if (point.row == 0) + point.column += diff.column; + point.row += diff.row; +}; + +var moveRelative = function(point, start) { + if (point.row == start.row) + point.column -= start.column; + point.row -= start.row; +}; + + +require("./lib/dom").importCssString("\ +.ace_snippet-marker {\ + -moz-box-sizing: border-box;\ + box-sizing: border-box;\ + background: rgba(194, 193, 208, 0.09);\ + border: 1px dotted rgba(211, 208, 235, 0.62);\ + position: absolute;\ +}"); + +exports.snippetManager = new SnippetManager(); + + +}); + +ace.define('ace/autocomplete', ['require', 'exports', 'module' , 'ace/keyboard/hash_handler', 'ace/autocomplete/popup', 'ace/autocomplete/util', 'ace/lib/event', 'ace/lib/lang', 'ace/snippets'], function(require, exports, module) { + + +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var AcePopup = require("./autocomplete/popup").AcePopup; +var util = require("./autocomplete/util"); +var event = require("./lib/event"); +var lang = require("./lib/lang"); +var snippetManager = require("./snippets").snippetManager; + +var Autocomplete = function() { + this.autoInsert = true; + this.keyboardHandler = new HashHandler(); + this.keyboardHandler.bindKeys(this.commands); + + this.blurListener = this.blurListener.bind(this); + this.changeListener = this.changeListener.bind(this); + this.mousedownListener = this.mousedownListener.bind(this); + this.mousewheelListener = this.mousewheelListener.bind(this); + + this.changeTimer = lang.delayedCall(function() { + this.updateCompletions(true); + }.bind(this)) +}; + +(function() { + this.$init = function() { + this.popup = new AcePopup(document.body || document.documentElement); + this.popup.on("click", function(e) { + this.insertMatch(); + e.stop(); + }.bind(this)); + }; + + this.openPopup = function(editor, prefix, keepPopupPosition) { + if (!this.popup) + this.$init(); + + this.popup.setData(this.completions.filtered); + + var renderer = editor.renderer; + if (!keepPopupPosition) { + this.popup.setRow(0); + this.popup.setFontSize(editor.getFontSize()); + + var lineHeight = renderer.layerConfig.lineHeight; + + var pos = renderer.$cursorLayer.getPixelPosition(this.base, true); + pos.left -= this.popup.getTextLeftOffset(); + + var rect = editor.container.getBoundingClientRect(); + pos.top += rect.top - renderer.layerConfig.offset; + pos.left += rect.left - editor.renderer.scrollLeft; + pos.left += renderer.$gutterLayer.gutterWidth; + + this.popup.show(pos, lineHeight); + } + }; + + this.detach = function() { + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.off("changeSelection", this.changeListener); + this.editor.off("blur", this.changeListener); + this.editor.off("mousedown", this.mousedownListener); + this.editor.off("mousewheel", this.mousewheelListener); + this.changeTimer.cancel(); + + if (this.popup) + this.popup.hide(); + + this.activated = false; + this.completions = this.base = null; + }; + + this.changeListener = function(e) { + var cursor = this.editor.selection.lead; + if (cursor.row != this.base.row || cursor.column < this.base.column) { + this.detach(); + } + if (this.activated) + this.changeTimer.schedule(); + else + this.detach(); + }; + + this.blurListener = function() { + if (document.activeElement != this.editor.textInput.getElement()) + this.detach(); + }; + + this.mousedownListener = function(e) { + this.detach(); + }; + + this.mousewheelListener = function(e) { + this.detach(); + }; + + this.goTo = function(where) { + var row = this.popup.getRow(); + var max = this.popup.session.getLength() - 1; + + switch(where) { + case "up": row = row < 0 ? max : row - 1; break; + case "down": row = row >= max ? -1 : row + 1; break; + case "start": row = 0; break; + case "end": row = max; break; + } + + this.popup.setRow(row); + }; + + this.insertMatch = function(data) { + if (!data) + data = this.popup.getData(this.popup.getRow()); + if (!data) + return false; + if (data.completer && data.completer.insertMatch) { + data.completer.insertMatch(this.editor); + } else { + if (this.completions.filterText) { + var ranges = this.editor.selection.getAllRanges(); + for (var i = 0, range; range = ranges[i]; i++) { + range.start.column -= this.completions.filterText.length; + this.editor.session.remove(range); + } + } + if (data.snippet) + snippetManager.insertSnippet(this.editor, data.snippet); + else + this.editor.execCommand("insertstring", data.value || data); + } + this.detach(); + }; + + this.commands = { + "Up": function(editor) { editor.completer.goTo("up"); }, + "Down": function(editor) { editor.completer.goTo("down"); }, + "Ctrl-Up|Ctrl-Home": function(editor) { editor.completer.goTo("start"); }, + "Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); }, + + "Esc": function(editor) { editor.completer.detach(); }, + "Space": function(editor) { editor.completer.detach(); editor.insert(" ");}, + "Return": function(editor) { editor.completer.insertMatch(); }, + "Shift-Return": function(editor) { editor.completer.insertMatch(true); }, + "Tab": function(editor) { editor.completer.insertMatch(); }, + + "PageUp": function(editor) { editor.completer.popup.gotoPageUp(); }, + "PageDown": function(editor) { editor.completer.popup.gotoPageDown(); } + }; + + this.gatherCompletions = function(editor, callback) { + var session = editor.getSession(); + var pos = editor.getCursorPosition(); + + var line = session.getLine(pos.row); + var prefix = util.retrievePrecedingIdentifier(line, pos.column); + + this.base = editor.getCursorPosition(); + this.base.column -= prefix.length; + + var matches = []; + util.parForEach(editor.completers, function(completer, next) { + completer.getCompletions(editor, session, pos, prefix, function(err, results) { + if (!err) + matches = matches.concat(results); + next(); + }); + }, function() { + callback(null, { + prefix: prefix, + matches: matches + }); + }); + return true; + }; + + this.showPopup = function(editor) { + if (this.editor) + this.detach(); + + this.activated = true; + + this.editor = editor; + if (editor.completer != this) { + if (editor.completer) + editor.completer.detach(); + editor.completer = this; + } + + editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + editor.on("changeSelection", this.changeListener); + editor.on("blur", this.blurListener); + editor.on("mousedown", this.mousedownListener); + editor.on("mousewheel", this.mousewheelListener); + + this.updateCompletions(); + }; + + this.updateCompletions = function(keepPopupPosition) { + if (keepPopupPosition && this.base && this.completions) { + var pos = this.editor.getCursorPosition(); + var prefix = this.editor.session.getTextRange({start: this.base, end: pos}); + if (prefix == this.completions.filterText) + return; + this.completions.setFilter(prefix); + if (!this.completions.filtered.length) + return this.detach(); + this.openPopup(this.editor, prefix, keepPopupPosition); + return; + } + this.gatherCompletions(this.editor, function(err, results) { + var matches = results && results.matches; + if (!matches || !matches.length) + return this.detach(); + + this.completions = new FilteredList(matches); + this.completions.setFilter(results.prefix); + var filtered = this.completions.filtered; + if (!filtered.length) + return this.detach(); + if (this.autoInsert && filtered.length == 1) + return this.insertMatch(filtered[0]); + this.openPopup(this.editor, results.prefix, keepPopupPosition); + }.bind(this)); + }; + + this.cancelContextMenu = function() { + var stop = function(e) { + this.editor.off("nativecontextmenu", stop); + if (e && e.domEvent) + event.stopEvent(e.domEvent); + }.bind(this); + setTimeout(stop, 10); + this.editor.on("nativecontextmenu", stop); + }; + +}).call(Autocomplete.prototype); + +Autocomplete.startCommand = { + name: "startAutocomplete", + exec: function(editor) { + if (!editor.completer) + editor.completer = new Autocomplete(); + editor.completer.showPopup(editor); + editor.completer.cancelContextMenu(); + }, + bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" +}; + +var FilteredList = function(array, filterText, mutateData) { + this.all = array; + this.filtered = array; + this.filterText = filterText || ""; +}; +(function(){ + this.setFilter = function(str) { + if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0) + var matches = this.filtered; + else + var matches = this.all; + + this.filterText = str; + matches = this.filterCompletions(matches, this.filterText); + matches = matches.sort(function(a, b) { + return b.exactMatch - a.exactMatch || b.score - a.score; + }); + var prev = null; + matches = matches.filter(function(item){ + var caption = item.value || item.caption || item.snippet; + if (caption === prev) return false; + prev = caption; + return true; + }); + + this.filtered = matches; + }; + this.filterCompletions = function(items, needle) { + var results = []; + var upper = needle.toUpperCase(); + var lower = needle.toLowerCase(); + loop: for (var i = 0, item; item = items[i]; i++) { + var caption = item.value || item.caption || item.snippet; + if (!caption) continue; + var lastIndex = -1; + var matchMask = 0; + var penalty = 0; + var index, distance; + for (var j = 0; j < needle.length; j++) { + var i1 = caption.indexOf(lower[j], lastIndex + 1); + var i2 = caption.indexOf(upper[j], lastIndex + 1); + index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2; + if (index < 0) + continue loop; + distance = index - lastIndex - 1; + if (distance > 0) { + if (lastIndex === -1) + penalty += 10; + penalty += distance; + } + matchMask = matchMask | (1 << index); + lastIndex = index; + } + item.matchMask = matchMask; + item.exactMatch = penalty ? 0 : 1; + item.score = (item.score || 0) - penalty; + results.push(item); + } + return results; + }; +}).call(FilteredList.prototype); + +exports.Autocomplete = Autocomplete; +exports.FilteredList = FilteredList; + +}); + +ace.define('ace/autocomplete/popup', ['require', 'exports', 'module' , 'ace/edit_session', 'ace/virtual_renderer', 'ace/editor', 'ace/range', 'ace/lib/event', 'ace/lib/lang', 'ace/lib/dom'], function(require, exports, module) { + + +var EditSession = require("../edit_session").EditSession; +var Renderer = require("../virtual_renderer").VirtualRenderer; +var Editor = require("../editor").Editor; +var Range = require("../range").Range; +var event = require("../lib/event"); +var lang = require("../lib/lang"); +var dom = require("../lib/dom"); + +var $singleLineEditor = function(el) { + var renderer = new Renderer(el); + + renderer.$maxLines = 4; + + var editor = new Editor(renderer); + + editor.setHighlightActiveLine(false); + editor.setShowPrintMargin(false); + editor.renderer.setShowGutter(false); + editor.renderer.setHighlightGutterLine(false); + + editor.$mouseHandler.$focusWaitTimout = 0; + + return editor; +}; + +var AcePopup = function(parentNode) { + var el = dom.createElement("div"); + var popup = new $singleLineEditor(el); + + if (parentNode) + parentNode.appendChild(el); + el.style.display = "none"; + popup.renderer.content.style.cursor = "default"; + popup.renderer.setStyle("ace_autocomplete"); + + popup.setOption("displayIndentGuides", false); + + var noop = function(){}; + + popup.focus = noop; + popup.$isFocused = true; + + popup.renderer.$cursorLayer.restartTimer = noop; + popup.renderer.$cursorLayer.element.style.opacity = 0; + + popup.renderer.$maxLines = 8; + popup.renderer.$keepTextAreaAtCursor = false; + + popup.setHighlightActiveLine(false); + popup.session.highlight(""); + popup.session.$searchHighlight.clazz = "ace_highlight-marker"; + + popup.on("mousedown", function(e) { + var pos = e.getDocumentPosition(); + popup.moveCursorToPosition(pos); + popup.selection.clearSelection(); + selectionMarker.start.row = selectionMarker.end.row = pos.row; + e.stop(); + }); + + var lastMouseEvent; + var hoverMarker = new Range(-1,0,-1,Infinity); + var selectionMarker = new Range(-1,0,-1,Infinity); + selectionMarker.id = popup.session.addMarker(selectionMarker, "ace_active-line", "fullLine"); + popup.setSelectOnHover = function(val) { + if (!val) { + hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine"); + } else if (hoverMarker.id) { + popup.session.removeMarker(hoverMarker.id); + hoverMarker.id = null; + } + } + popup.setSelectOnHover(false); + popup.on("mousemove", function(e) { + if (!lastMouseEvent) { + lastMouseEvent = e; + return; + } + if (lastMouseEvent.x == e.x && lastMouseEvent.y == e.y) { + return; + } + lastMouseEvent = e; + lastMouseEvent.scrollTop = popup.renderer.scrollTop; + var row = lastMouseEvent.getDocumentPosition().row; + if (hoverMarker.start.row != row) { + if (!hoverMarker.id) + popup.setRow(row); + setHoverMarker(row); + } + }); + popup.renderer.on("beforeRender", function() { + if (lastMouseEvent && hoverMarker.start.row != -1) { + lastMouseEvent.$pos = null; + var row = lastMouseEvent.getDocumentPosition().row; + if (!hoverMarker.id) + popup.setRow(row); + setHoverMarker(row, true); + } + }); + popup.renderer.on("afterRender", function() { + var row = popup.getRow(); + var t = popup.renderer.$textLayer; + var selected = t.element.childNodes[row - t.config.firstRow]; + if (selected == t.selectedNode) + return; + if (t.selectedNode) + dom.removeCssClass(t.selectedNode, "ace_selected"); + t.selectedNode = selected; + if (selected) + dom.addCssClass(selected, "ace_selected"); + }); + var hideHoverMarker = function() { setHoverMarker(-1) }; + var setHoverMarker = function(row, suppressRedraw) { + if (row !== hoverMarker.start.row) { + hoverMarker.start.row = hoverMarker.end.row = row; + if (!suppressRedraw) + popup.session._emit("changeBackMarker"); + popup._emit("changeHoverMarker"); + } + }; + popup.getHoveredRow = function() { + return hoverMarker.start.row; + }; + + event.addListener(popup.container, "mouseout", hideHoverMarker); + popup.on("hide", hideHoverMarker); + popup.on("changeSelection", hideHoverMarker); + + popup.session.doc.getLength = function() { + return popup.data.length; + }; + popup.session.doc.getLine = function(i) { + var data = popup.data[i]; + if (typeof data == "string") + return data; + return (data && data.value) || ""; + }; + + var bgTokenizer = popup.session.bgTokenizer; + bgTokenizer.$tokenizeRow = function(i) { + var data = popup.data[i]; + var tokens = []; + if (!data) + return tokens; + if (typeof data == "string") + data = {value: data}; + if (!data.caption) + data.caption = data.value; + + var last = -1; + var flag, c; + for (var i = 0; i < data.caption.length; i++) { + c = data.caption[i]; + flag = data.matchMask & (1 << i) ? 1 : 0; + if (last !== flag) { + tokens.push({type: data.className || "" + ( flag ? "completion-highlight" : ""), value: c}); + last = flag; + } else { + tokens[tokens.length - 1].value += c; + } + } + + if (data.meta) { + var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth; + if (data.meta.length + data.caption.length < maxW - 2) + tokens.push({type: "rightAlignedText", value: data.meta}); + } + return tokens; + }; + bgTokenizer.$updateOnChange = noop; + bgTokenizer.start = noop; + + popup.session.$computeWidth = function() { + return this.screenWidth = 0; + } + popup.isOpen = false; + popup.isTopdown = false; + + popup.data = []; + popup.setData = function(list) { + popup.data = list || []; + popup.setValue(lang.stringRepeat("\n", list.length), -1); + popup.setRow(0); + }; + popup.getData = function(row) { + return popup.data[row]; + }; + + popup.getRow = function() { + return selectionMarker.start.row; + }; + popup.setRow = function(line) { + line = Math.max(-1, Math.min(this.data.length, line)); + if (selectionMarker.start.row != line) { + popup.selection.clearSelection(); + selectionMarker.start.row = selectionMarker.end.row = line || 0; + popup.session._emit("changeBackMarker"); + popup.moveCursorTo(line || 0, 0); + if (popup.isOpen) + popup._signal("select"); + } + }; + + popup.on("changeSelection", function() { + if (popup.isOpen) + popup.setRow(popup.selection.lead.row); + }); + + popup.hide = function() { + this.container.style.display = "none"; + this._signal("hide"); + popup.isOpen = false; + }; + popup.show = function(pos, lineHeight, topdownOnly) { + var el = this.container; + var screenHeight = window.innerHeight; + var screenWidth = window.innerWidth; + var renderer = this.renderer; + var maxH = renderer.$maxLines * lineHeight * 1.4; + var top = pos.top + this.$borderSize; + if (top + maxH > screenHeight - lineHeight && !topdownOnly) { + el.style.top = ""; + el.style.bottom = screenHeight - top + "px"; + popup.isTopdown = false; + } else { + top += lineHeight; + el.style.top = top + "px"; + el.style.bottom = ""; + popup.isTopdown = true; + } + + el.style.display = ""; + this.renderer.$textLayer.checkForSizeChanges(); + + var left = pos.left; + if (left + el.offsetWidth > screenWidth) + left = screenWidth - el.offsetWidth; + + el.style.left = left + "px"; + + this._signal("show"); + lastMouseEvent = null; + popup.isOpen = true; + }; + + popup.getTextLeftOffset = function() { + return this.$borderSize + this.renderer.$padding + this.$imageSize; + }; + + popup.$imageSize = 0; + popup.$borderSize = 1; + + return popup; +}; + +dom.importCssString("\ +.ace_autocomplete.ace-tm .ace_marker-layer .ace_active-line {\ + background-color: #CAD6FA;\ + z-index: 1;\ +}\ +.ace_autocomplete.ace-tm .ace_line-hover {\ + border: 1px solid #abbffe;\ + margin-top: -1px;\ + background: rgba(233,233,253,0.4);\ +}\ +.ace_autocomplete .ace_line-hover {\ + position: absolute;\ + z-index: 2;\ +}\ +.ace_rightAlignedText {\ + color: gray;\ + display: inline-block;\ + position: absolute;\ + right: 4px;\ + text-align: right;\ + z-index: -1;\ +}\ +.ace_autocomplete .ace_completion-highlight{\ + color: #000;\ + text-shadow: 0 0 0.01em;\ +}\ +.ace_autocomplete {\ + width: 280px;\ + z-index: 200000;\ + background: #fbfbfb;\ + color: #444;\ + border: 1px lightgray solid;\ + position: fixed;\ + box-shadow: 2px 3px 5px rgba(0,0,0,.2);\ + line-height: 1.4;\ +}"); + +exports.AcePopup = AcePopup; + +}); + +ace.define('ace/autocomplete/util', ['require', 'exports', 'module' ], function(require, exports, module) { + + +exports.parForEach = function(array, fn, callback) { + var completed = 0; + var arLength = array.length; + if (arLength === 0) + callback(); + for (var i = 0; i < arLength; i++) { + fn(array[i], function(result, err) { + completed++; + if (completed === arLength) + callback(result, err); + }); + } +} + +var ID_REGEX = /[a-zA-Z_0-9\$-]/; + +exports.retrievePrecedingIdentifier = function(text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos-1; i >= 0; i--) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf.reverse().join(""); +} + +exports.retrieveFollowingIdentifier = function(text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos; i < text.length; i++) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf; +} + +}); + +ace.define('ace/autocomplete/text_completer', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { + var Range = require("ace/range").Range; + + var splitRegex = /[^a-zA-Z_0-9\$\-]+/; + + function getWordIndex(doc, pos) { + var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos)); + return textBefore.split(splitRegex).length - 1; + } + function wordDistance(doc, pos) { + var prefixPos = getWordIndex(doc, pos); + var words = doc.getValue().split(splitRegex); + var wordScores = Object.create(null); + + var currentWord = words[prefixPos]; + + words.forEach(function(word, idx) { + if (!word || word === currentWord) return; + + var distance = Math.abs(prefixPos - idx); + var score = words.length - distance; + if (wordScores[word]) { + wordScores[word] = Math.max(score, wordScores[word]); + } else { + wordScores[word] = score; + } + }); + return wordScores; + } + + exports.getCompletions = function(editor, session, pos, prefix, callback) { + var wordScore = wordDistance(session, pos, prefix); + var wordList = Object.keys(wordScore); + callback(null, wordList.map(function(word) { + return { + name: word, + value: word, + score: wordScore[word], + meta: "local" + }; + })); + }; +}); \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ext-searchbox.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ext-searchbox.js new file mode 100644 index 0000000..b75c193 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/ext-searchbox.js @@ -0,0 +1,421 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +ace.define('ace/ext/searchbox', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/event', 'ace/keyboard/hash_handler', 'ace/lib/keys'], function(require, exports, module) { + + +var dom = require("../lib/dom"); +var lang = require("../lib/lang"); +var event = require("../lib/event"); +var searchboxCss = "\ +/* ------------------------------------------------------------------------------------------\ +* Editor Search Form\ +* --------------------------------------------------------------------------------------- */\ +.ace_search {\ +background-color: #ddd;\ +border: 1px solid #cbcbcb;\ +border-top: 0 none;\ +max-width: 297px;\ +overflow: hidden;\ +margin: 0;\ +padding: 4px;\ +padding-right: 6px;\ +padding-bottom: 0;\ +position: absolute;\ +top: 0px;\ +z-index: 99;\ +white-space: normal;\ +}\ +.ace_search.left {\ +border-left: 0 none;\ +border-radius: 0px 0px 5px 0px;\ +left: 0;\ +}\ +.ace_search.right {\ +border-radius: 0px 0px 0px 5px;\ +border-right: 0 none;\ +right: 0;\ +}\ +.ace_search_form, .ace_replace_form {\ +border-radius: 3px;\ +border: 1px solid #cbcbcb;\ +float: left;\ +margin-bottom: 4px;\ +overflow: hidden;\ +}\ +.ace_search_form.ace_nomatch {\ +outline: 1px solid red;\ +}\ +.ace_search_field {\ +background-color: white;\ +border-right: 1px solid #cbcbcb;\ +border: 0 none;\ +-webkit-box-sizing: border-box;\ +-moz-box-sizing: border-box;\ +box-sizing: border-box;\ +display: block;\ +float: left;\ +height: 22px;\ +outline: 0;\ +padding: 0 7px;\ +width: 214px;\ +margin: 0;\ +}\ +.ace_searchbtn,\ +.ace_replacebtn {\ +background: #fff;\ +border: 0 none;\ +border-left: 1px solid #dcdcdc;\ +cursor: pointer;\ +display: block;\ +float: left;\ +height: 22px;\ +margin: 0;\ +padding: 0;\ +position: relative;\ +}\ +.ace_searchbtn:last-child,\ +.ace_replacebtn:last-child {\ +border-top-right-radius: 3px;\ +border-bottom-right-radius: 3px;\ +}\ +.ace_searchbtn:disabled {\ +background: none;\ +cursor: default;\ +}\ +.ace_searchbtn {\ +background-position: 50% 50%;\ +background-repeat: no-repeat;\ +width: 27px;\ +}\ +.ace_searchbtn.prev {\ +background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \ +}\ +.ace_searchbtn.next {\ +background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \ +}\ +.ace_searchbtn_close {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\ +border-radius: 50%;\ +border: 0 none;\ +color: #656565;\ +cursor: pointer;\ +display: block;\ +float: right;\ +font-family: Arial;\ +font-size: 16px;\ +height: 14px;\ +line-height: 16px;\ +margin: 5px 1px 9px 5px;\ +padding: 0;\ +text-align: center;\ +width: 14px;\ +}\ +.ace_searchbtn_close:hover {\ +background-color: #656565;\ +background-position: 50% 100%;\ +color: white;\ +}\ +.ace_replacebtn.prev {\ +width: 54px\ +}\ +.ace_replacebtn.next {\ +width: 27px\ +}\ +.ace_button {\ +margin-left: 2px;\ +cursor: pointer;\ +-webkit-user-select: none;\ +-moz-user-select: none;\ +-o-user-select: none;\ +-ms-user-select: none;\ +user-select: none;\ +overflow: hidden;\ +opacity: 0.7;\ +border: 1px solid rgba(100,100,100,0.23);\ +padding: 1px;\ +-moz-box-sizing: border-box;\ +box-sizing: border-box;\ +color: black;\ +}\ +.ace_button:hover {\ +background-color: #eee;\ +opacity:1;\ +}\ +.ace_button:active {\ +background-color: #ddd;\ +}\ +.ace_button.checked {\ +border-color: #3399ff;\ +opacity:1;\ +}\ +.ace_search_options{\ +margin-bottom: 3px;\ +text-align: right;\ +-webkit-user-select: none;\ +-moz-user-select: none;\ +-o-user-select: none;\ +-ms-user-select: none;\ +user-select: none;\ +}"; +var HashHandler = require("../keyboard/hash_handler").HashHandler; +var keyUtil = require("../lib/keys"); + +dom.importCssString(searchboxCss, "ace_searchbox"); + +var html = ''.replace(/>\s+/g, ">"); + +var SearchBox = function(editor, range, showReplaceForm) { + var div = dom.createElement("div"); + div.innerHTML = html; + this.element = div.firstChild; + + this.$init(); + this.setEditor(editor); +}; + +(function() { + this.setEditor = function(editor) { + editor.searchBox = this; + editor.container.appendChild(this.element); + this.editor = editor; + }; + + this.$initElements = function(sb) { + this.searchBox = sb.querySelector(".ace_search_form"); + this.replaceBox = sb.querySelector(".ace_replace_form"); + this.searchOptions = sb.querySelector(".ace_search_options"); + this.regExpOption = sb.querySelector("[action=toggleRegexpMode]"); + this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]"); + this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]"); + this.searchInput = this.searchBox.querySelector(".ace_search_field"); + this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); + }; + + this.$init = function() { + var sb = this.element; + + this.$initElements(sb); + + var _this = this; + event.addListener(sb, "mousedown", function(e) { + setTimeout(function(){ + _this.activeInput.focus(); + }, 0); + event.stopPropagation(e); + }); + event.addListener(sb, "click", function(e) { + var t = e.target || e.srcElement; + var action = t.getAttribute("action"); + if (action && _this[action]) + _this[action](); + else if (_this.$searchBarKb.commands[action]) + _this.$searchBarKb.commands[action].exec(_this); + event.stopPropagation(e); + }); + + event.addCommandKeyListener(sb, function(e, hashId, keyCode) { + var keyString = keyUtil.keyCodeToString(keyCode); + var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); + if (command && command.exec) { + command.exec(_this); + event.stopEvent(e); + } + }); + + this.$onChange = lang.delayedCall(function() { + _this.find(false, false); + }); + + event.addListener(this.searchInput, "input", function() { + _this.$onChange.schedule(20); + }); + event.addListener(this.searchInput, "focus", function() { + _this.activeInput = _this.searchInput; + _this.searchInput.value && _this.highlight(); + }); + event.addListener(this.replaceInput, "focus", function() { + _this.activeInput = _this.replaceInput; + _this.searchInput.value && _this.highlight(); + }); + }; + this.$closeSearchBarKb = new HashHandler([{ + bindKey: "Esc", + name: "closeSearchBar", + exec: function(editor) { + editor.searchBox.hide(); + } + }]); + this.$searchBarKb = new HashHandler(); + this.$searchBarKb.bindKeys({ + "Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(sb) { + var isReplace = sb.isReplace = !sb.isReplace; + sb.replaceBox.style.display = isReplace ? "" : "none"; + sb[isReplace ? "replaceInput" : "searchInput"].focus(); + }, + "Ctrl-G|Command-G": function(sb) { + sb.findNext(); + }, + "Ctrl-Shift-G|Command-Shift-G": function(sb) { + sb.findPrev(); + }, + "esc": function(sb) { + setTimeout(function() { sb.hide();}); + }, + "Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findNext(); + }, + "Shift-Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findPrev(); + }, + "Tab": function(sb) { + (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); + } + }); + + this.$searchBarKb.addCommands([{ + name: "toggleRegexpMode", + bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, + exec: function(sb) { + sb.regExpOption.checked = !sb.regExpOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleCaseSensitive", + bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, + exec: function(sb) { + sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleWholeWords", + bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, + exec: function(sb) { + sb.wholeWordOption.checked = !sb.wholeWordOption.checked; + sb.$syncOptions(); + } + }]); + + this.$syncOptions = function() { + dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); + dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); + dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); + this.find(false, false); + }; + + this.highlight = function(re) { + this.editor.session.highlight(re || this.editor.$search.$options.re); + this.editor.renderer.updateBackMarkers() + }; + this.find = function(skipCurrent, backwards) { + var range = this.editor.find(this.searchInput.value, { + skipCurrent: skipCurrent, + backwards: backwards, + wrap: true, + regExp: this.regExpOption.checked, + caseSensitive: this.caseSensitiveOption.checked, + wholeWord: this.wholeWordOption.checked + }); + var noMatch = !range && this.searchInput.value; + dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); + this.editor._emit("findSearchBox", { match: !noMatch }); + this.highlight(); + }; + this.findNext = function() { + this.find(true, false); + }; + this.findPrev = function() { + this.find(true, true); + }; + this.replace = function() { + if (!this.editor.getReadOnly()) + this.editor.replace(this.replaceInput.value); + }; + this.replaceAndFindNext = function() { + if (!this.editor.getReadOnly()) { + this.editor.replace(this.replaceInput.value); + this.findNext() + } + }; + this.replaceAll = function() { + if (!this.editor.getReadOnly()) + this.editor.replaceAll(this.replaceInput.value); + }; + + this.hide = function() { + this.element.style.display = "none"; + this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); + this.editor.focus(); + }; + this.show = function(value, isReplace) { + this.element.style.display = ""; + this.replaceBox.style.display = isReplace ? "" : "none"; + + this.isReplace = isReplace; + + if (value) + this.searchInput.value = value; + this.searchInput.focus(); + this.searchInput.select(); + + this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); + }; + +}).call(SearchBox.prototype); + +exports.SearchBox = SearchBox; + +exports.Search = function(editor, isReplace) { + var sb = editor.searchBox || new SearchBox(editor); + sb.show(editor.session.getTextRange(), isReplace); +}; + +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/mode-json.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/mode-json.js new file mode 100644 index 0000000..1972bd6 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/mode-json.js @@ -0,0 +1,625 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +ace.define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var HighlightRules = require("./json_highlight_rules").JsonHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var WorkerClient = require("../worker/worker_client").WorkerClient; + +var Mode = function() { + this.HighlightRules = HighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("error", function(e) { + session.setAnnotations([e.data]); + }); + + worker.on("ok", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + + this.$id = "ace/mode/json"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define('ace/mode/json_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JsonHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "variable", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' + }, { + token : "string", // single line + regex : '"', + next : "string" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : "invalid.illegal", // single quoted strings are not allowed + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "invalid.illegal", // comments are not allowed + regex : "\\/\\/.*$" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "string" : [ + { + token : "constant.language.escape", + regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ + }, { + token : "string", + regex : '[^"\\\\]+' + }, { + token : "string", + regex : '"', + next : "start" + }, { + token : "string", + regex : "", + next : "start" + } + ] + }; + +}; + +oop.inherits(JsonHighlightRules, TextHighlightRules); + +exports.JsonHighlightRules = JsonHighlightRules; +}); + +ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { + + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { + + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +var SAFE_INSERT_IN_TOKENS = + ["text", "paren.rparen", "punctuation.operator"]; +var SAFE_INSERT_BEFORE_TOKENS = + ["text", "paren.rparen", "punctuation.operator", "comment"]; + + +var autoInsertedBrackets = 0; +var autoInsertedRow = -1; +var autoInsertedLineEnd = ""; +var maybeInsertedBrackets = 0; +var maybeInsertedRow = -1; +var maybeInsertedLineStart = ""; +var maybeInsertedLineEnd = ""; + +var CstyleBehaviour = function () { + + CstyleBehaviour.isSaneInsertion = function(editor, session) { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { + var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); + if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) + return false; + } + iterator.stepForward(); + return iterator.getCurrentTokenRow() !== cursor.row || + this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); + }; + + CstyleBehaviour.$matchTokenType = function(token, types) { + return types.indexOf(token.type || token) > -1; + }; + + CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0])) + autoInsertedBrackets = 0; + autoInsertedRow = cursor.row; + autoInsertedLineEnd = bracket + line.substr(cursor.column); + autoInsertedBrackets++; + }; + + CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isMaybeInsertedClosing(cursor, line)) + maybeInsertedBrackets = 0; + maybeInsertedRow = cursor.row; + maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; + maybeInsertedLineEnd = line.substr(cursor.column); + maybeInsertedBrackets++; + }; + + CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { + return autoInsertedBrackets > 0 && + cursor.row === autoInsertedRow && + bracket === autoInsertedLineEnd[0] && + line.substr(cursor.column) === autoInsertedLineEnd; + }; + + CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { + return maybeInsertedBrackets > 0 && + cursor.row === maybeInsertedRow && + line.substr(cursor.column) === maybeInsertedLineEnd && + line.substr(0, cursor.column) == maybeInsertedLineStart; + }; + + CstyleBehaviour.popAutoInsertedClosing = function() { + autoInsertedLineEnd = autoInsertedLineEnd.substr(1); + autoInsertedBrackets--; + }; + + CstyleBehaviour.clearMaybeInsertedClosing = function() { + maybeInsertedBrackets = 0; + maybeInsertedRow = -1; + }; + + this.add("braces", "insertion", function (state, action, editor, session, text) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (text == '{') { + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { + return { + text: '{' + selected + '}', + selection: false + }; + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { + CstyleBehaviour.recordAutoInsert(editor, session, "}"); + return { + text: '{}', + selection: [1, 1] + }; + } else { + CstyleBehaviour.recordMaybeInsert(editor, session, "{"); + return { + text: '{', + selection: [1, 1] + }; + } + } + } else if (text == '}') { + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '}') { + var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } else if (text == "\n" || text == "\r\n") { + var closing = ""; + if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { + closing = lang.stringRepeat("}", maybeInsertedBrackets); + CstyleBehaviour.clearMaybeInsertedClosing(); + } + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === '}') { + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); + if (!openBracePos) + return null; + var next_indent = this.$getIndent(session.getLine(openBracePos.row)); + } else if (closing) { + var next_indent = this.$getIndent(line); + } else { + return; + } + var indent = next_indent + session.getTabString(); + + return { + text: '\n' + indent + '\n' + next_indent + closing, + selection: [1, indent.length, 1, indent.length] + }; + } else { + CstyleBehaviour.clearMaybeInsertedClosing(); + } + }); + + this.add("braces", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '{') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar == '}') { + range.end.column++; + return range; + } else { + maybeInsertedBrackets--; + } + } + }); + + this.add("parens", "insertion", function (state, action, editor, session, text) { + if (text == '(') { + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return { + text: '(' + selected + ')', + selection: false + }; + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, ")"); + return { + text: '()', + selection: [1, 1] + }; + } + } else if (text == ')') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ')') { + var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("parens", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '(') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ')') { + range.end.column++; + return range; + } + } + }); + + this.add("brackets", "insertion", function (state, action, editor, session, text) { + if (text == '[') { + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return { + text: '[' + selected + ']', + selection: false + }; + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, "]"); + return { + text: '[]', + selection: [1, 1] + }; + } + } else if (text == ']') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ']') { + var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("brackets", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '[') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ']') { + range.end.column++; + return range; + } + } + }); + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } else { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var leftChar = line.substring(cursor.column-1, cursor.column); + if (leftChar == '\\') { + return null; + } + var tokens = session.getTokens(selection.start.row); + var col = 0, token; + var quotepos = -1; // Track whether we're inside an open quote. + + for (var x = 0; x < tokens.length; x++) { + token = tokens[x]; + if (token.type == "string") { + quotepos = -1; + } else if (quotepos < 0) { + quotepos = token.value.indexOf(quote); + } + if ((token.value.length + col) > selection.start.column) { + break; + } + col += tokens[x].value.length; + } + if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { + if (!CstyleBehaviour.isSaneInsertion(editor, session)) + return; + return { + text: quote + quote, + selection: [1,1] + }; + } else if (token && token.type === "string") { + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == quote) { + return { + text: '', + selection: [1, 1] + }; + } + } + } + } + }); + + this.add("string_dquotes", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + +}; + +oop.inherits(CstyleBehaviour, Behaviour); + +exports.CstyleBehaviour = CstyleBehaviour; +}); + +ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { + + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + +}).call(FoldMode.prototype); + +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/mode-yaml.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/mode-yaml.js new file mode 100644 index 0000000..f1650fc --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/mode-yaml.js @@ -0,0 +1,290 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +ace.define('ace/mode/yaml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/yaml_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/coffee'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var YamlHighlightRules = require("./yaml_highlight_rules").YamlHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = YamlHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + + this.$id = "ace/mode/yaml"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define('ace/mode/yaml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var YamlHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*$" + }, { + token : "list.markup", + regex : /^(?:-{3}|\.{3})\s*(?=#|$)/ + }, { + token : "list.markup", + regex : /^\s*[\-?](?:$|\s)/ + }, { + token: "constant", + regex: "!![\\w//]+" + }, { + token: "constant.language", + regex: "[&\\*][a-zA-Z0-9-_]+" + }, { + token: ["meta.tag", "keyword"], + regex: /^(\s*\w.*?)(\:(?:\s+|$))/ + },{ + token: ["meta.tag", "keyword"], + regex: /(\w+?)(\s*\:(?:\s+|$))/ + }, { + token : "keyword.operator", + regex : "<<\\w*:\\w*" + }, { + token : "keyword.operator", + regex : "-\\s*(?=[{])" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + regex : '[|>][-+\\d\\s]*$', + next : "qqstring" + }, { + token : "string", // single quoted string + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // float + regex : /[+\-]?[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?\b/ + }, { + token : "constant.numeric", // other number + regex : /[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/ + }, { + token : "constant.language.boolean", + regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b" + }, { + token : "invalid.illegal", // comments are not allowed + regex : "\\/\\/.*$" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?=(?:(?:\\\\.)|(?:[^:]))*?:)', + next : "start" + }, { + token : "string", + regex : '.+' + } + ]}; + +}; + +oop.inherits(YamlHighlightRules, TextHighlightRules); + +exports.YamlHighlightRules = YamlHighlightRules; +}); + +ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { + + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { + + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/worker-json.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/worker-json.js new file mode 100644 index 0000000..d9e7127 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ace/worker-json.js @@ -0,0 +1,2289 @@ +"no use strict"; +;(function(window) { +if (typeof window.window != "undefined" && window.document) { + return; +} + +window.console = function() { + var msgs = Array.prototype.slice.call(arguments, 0); + postMessage({type: "log", data: msgs}); +}; +window.console.error = +window.console.warn = +window.console.log = +window.console.trace = window.console; + +window.window = window; +window.ace = window; + +window.onerror = function(message, file, line, col, err) { + console.error("Worker " + err.stack); +}; + +window.normalizeModule = function(parentId, moduleName) { + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); + } + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = (base ? base + "/" : "") + moduleName; + + while(moduleName.indexOf(".") !== -1 && previous != moduleName) { + var previous = moduleName; + moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + + return moduleName; +}; + +window.require = function(parentId, id) { + if (!id) { + id = parentId + parentId = null; + } + if (!id.charAt) + throw new Error("worker.js require() accepts only (parentId, id) as arguments"); + + id = window.normalizeModule(parentId, id); + + var module = window.require.modules[id]; + if (module) { + if (!module.initialized) { + module.initialized = true; + module.exports = module.factory().exports; + } + return module.exports; + } + + var chunks = id.split("/"); + if (!window.require.tlns) + return console.log("unable to load " + id); + chunks[0] = window.require.tlns[chunks[0]] || chunks[0]; + var path = chunks.join("/") + ".js"; + + window.require.id = id; + importScripts(path); + return window.require(parentId, id); +}; +window.require.modules = {}; +window.require.tlns = {}; + +window.define = function(id, deps, factory) { + if (arguments.length == 2) { + factory = deps; + if (typeof id != "string") { + deps = id; + id = window.require.id; + } + } else if (arguments.length == 1) { + factory = id; + deps = [] + id = window.require.id; + } + + if (!deps.length) + deps = ['require', 'exports', 'module'] + + if (id.indexOf("text!") === 0) + return; + + var req = function(childId) { + return window.require(id, childId); + }; + + window.require.modules[id] = { + exports: {}, + factory: function() { + var module = this; + var returnExports = factory.apply(this, deps.map(function(dep) { + switch(dep) { + case 'require': return req + case 'exports': return module.exports + case 'module': return module + default: return req(dep) + } + })); + if (returnExports) + module.exports = returnExports; + return module; + } + }; +}; +window.define.amd = {} + +window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { + require.tlns = topLevelNamespaces; +} + +window.initSender = function initSender() { + + var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; + var oop = window.require("ace/lib/oop"); + + var Sender = function() {}; + + (function() { + + oop.implement(this, EventEmitter); + + this.callback = function(data, callbackId) { + postMessage({ + type: "call", + id: callbackId, + data: data + }); + }; + + this.emit = function(name, data) { + postMessage({ + type: "event", + name: name, + data: data + }); + }; + + }).call(Sender.prototype); + + return new Sender(); +} + +window.main = null; +window.sender = null; + +window.onmessage = function(e) { + var msg = e.data; + if (msg.command) { + if (main[msg.command]) + main[msg.command].apply(main, msg.args); + else + throw new Error("Unknown command:" + msg.command); + } + else if (msg.init) { + initBaseUrls(msg.tlns); + require("ace/lib/es5-shim"); + sender = initSender(); + var clazz = require(msg.module)[msg.classname]; + main = new clazz(sender); + } + else if (msg.event && sender) { + sender._emit(msg.event, msg.data); + } +}; +})(this);// https://github.com/kriskowal/es5-shim + +ace.define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) { + +function Empty() {} + +if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { // .length is 1 + var target = this; + if (typeof target != "function") { + throw new TypeError("Function.prototype.bind called on incompatible " + target); + } + var args = slice.call(arguments, 1); // for normal call + var bound = function () { + + if (this instanceof bound) { + + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + if(target.prototype) { + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; +} +var call = Function.prototype.call; +var prototypeOfArray = Array.prototype; +var prototypeOfObject = Object.prototype; +var slice = prototypeOfArray.slice; +var _toString = call.bind(prototypeOfObject.toString); +var owns = call.bind(prototypeOfObject.hasOwnProperty); +var defineGetter; +var defineSetter; +var lookupGetter; +var lookupSetter; +var supportsAccessors; +if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { + defineGetter = call.bind(prototypeOfObject.__defineGetter__); + defineSetter = call.bind(prototypeOfObject.__defineSetter__); + lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); + lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); +} +if ([1,2].splice(0).length != 2) { + if(function() { // test IE < 9 to splice bug - see issue #138 + function makeArray(l) { + var a = new Array(l+2); + a[0] = a[1] = 0; + return a; + } + var array = [], lengthBefore; + + array.splice.apply(array, makeArray(20)); + array.splice.apply(array, makeArray(26)); + + lengthBefore = array.length; //46 + array.splice(5, 0, "XXX"); // add one element + + lengthBefore + 1 == array.length + + if (lengthBefore + 1 == array.length) { + return true;// has right splice implementation without bugs + } + }()) {//IE 6/7 + var array_splice = Array.prototype.splice; + Array.prototype.splice = function(start, deleteCount) { + if (!arguments.length) { + return []; + } else { + return array_splice.apply(this, [ + start === void 0 ? 0 : start, + deleteCount === void 0 ? (this.length - start) : deleteCount + ].concat(slice.call(arguments, 2))) + } + }; + } else {//IE8 + Array.prototype.splice = function(pos, removeCount){ + var length = this.length; + if (pos > 0) { + if (pos > length) + pos = length; + } else if (pos == void 0) { + pos = 0; + } else if (pos < 0) { + pos = Math.max(length + pos, 0); + } + + if (!(pos+removeCount < length)) + removeCount = length - pos; + + var removed = this.slice(pos, pos+removeCount); + var insert = slice.call(arguments, 2); + var add = insert.length; + if (pos === length) { + if (add) { + this.push.apply(this, insert); + } + } else { + var remove = Math.min(removeCount, length - pos); + var tailOldPos = pos + remove; + var tailNewPos = tailOldPos + add - remove; + var tailCount = length - tailOldPos; + var lengthAfterRemove = length - remove; + + if (tailNewPos < tailOldPos) { // case A + for (var i = 0; i < tailCount; ++i) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } else if (tailNewPos > tailOldPos) { // case B + for (i = tailCount; i--; ) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } // else, add == remove (nothing to do) + + if (add && pos === lengthAfterRemove) { + this.length = lengthAfterRemove; // truncate array + this.push.apply(this, insert); + } else { + this.length = lengthAfterRemove + add; // reserves space + for (i = 0; i < add; ++i) { + this[pos+i] = insert[i]; + } + } + } + return removed; + }; + } +} +if (!Array.isArray) { + Array.isArray = function isArray(obj) { + return _toString(obj) == "[object Array]"; + }; +} +var boxedString = Object("a"), + splitString = boxedString[0] != "a" || !(0 in boxedString); + +if (!Array.prototype.forEach) { + Array.prototype.forEach = function forEach(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + thisp = arguments[1], + i = -1, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(); // TODO message + } + + while (++i < length) { + if (i in self) { + fun.call(thisp, self[i], i, object); + } + } + }; +} +if (!Array.prototype.map) { + Array.prototype.map = function map(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = Array(length), + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) + result[i] = fun.call(thisp, self[i], i, object); + } + return result; + }; +} +if (!Array.prototype.filter) { + Array.prototype.filter = function filter(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = [], + value, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) { + value = self[i]; + if (fun.call(thisp, value, i, object)) { + result.push(value); + } + } + } + return result; + }; +} +if (!Array.prototype.every) { + Array.prototype.every = function every(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && !fun.call(thisp, self[i], i, object)) { + return false; + } + } + return true; + }; +} +if (!Array.prototype.some) { + Array.prototype.some = function some(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && fun.call(thisp, self[i], i, object)) { + return true; + } + } + return false; + }; +} +if (!Array.prototype.reduce) { + Array.prototype.reduce = function reduce(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduce of empty array with no initial value"); + } + + var i = 0; + var result; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i++]; + break; + } + if (++i >= length) { + throw new TypeError("reduce of empty array with no initial value"); + } + } while (true); + } + + for (; i < length; i++) { + if (i in self) { + result = fun.call(void 0, result, self[i], i, object); + } + } + + return result; + }; +} +if (!Array.prototype.reduceRight) { + Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + + var result, i = length - 1; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i--]; + break; + } + if (--i < 0) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + } while (true); + } + + do { + if (i in this) { + result = fun.call(void 0, result, self[i], i, object); + } + } while (i--); + + return result; + }; +} +if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { + Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + + var i = 0; + if (arguments.length > 1) { + i = toInteger(arguments[1]); + } + i = i >= 0 ? i : Math.max(0, length + i); + for (; i < length; i++) { + if (i in self && self[i] === sought) { + return i; + } + } + return -1; + }; +} +if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { + Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + var i = length - 1; + if (arguments.length > 1) { + i = Math.min(i, toInteger(arguments[1])); + } + i = i >= 0 ? i : length - Math.abs(i); + for (; i >= 0; i--) { + if (i in self && sought === self[i]) { + return i; + } + } + return -1; + }; +} +if (!Object.getPrototypeOf) { + Object.getPrototypeOf = function getPrototypeOf(object) { + return object.__proto__ || ( + object.constructor ? + object.constructor.prototype : + prototypeOfObject + ); + }; +} +if (!Object.getOwnPropertyDescriptor) { + var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + + "non-object: "; + Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT + object); + if (!owns(object, property)) + return; + + var descriptor, getter, setter; + descriptor = { enumerable: true, configurable: true }; + if (supportsAccessors) { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + + var getter = lookupGetter(object, property); + var setter = lookupSetter(object, property); + object.__proto__ = prototype; + + if (getter || setter) { + if (getter) descriptor.get = getter; + if (setter) descriptor.set = setter; + return descriptor; + } + } + descriptor.value = object[property]; + return descriptor; + }; +} +if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + return Object.keys(object); + }; +} +if (!Object.create) { + var createEmpty; + if (Object.prototype.__proto__ === null) { + createEmpty = function () { + return { "__proto__": null }; + }; + } else { + createEmpty = function () { + var empty = {}; + for (var i in empty) + empty[i] = null; + empty.constructor = + empty.hasOwnProperty = + empty.propertyIsEnumerable = + empty.isPrototypeOf = + empty.toLocaleString = + empty.toString = + empty.valueOf = + empty.__proto__ = null; + return empty; + } + } + + Object.create = function create(prototype, properties) { + var object; + if (prototype === null) { + object = createEmpty(); + } else { + if (typeof prototype != "object") + throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); + var Type = function () {}; + Type.prototype = prototype; + object = new Type(); + object.__proto__ = prototype; + } + if (properties !== void 0) + Object.defineProperties(object, properties); + return object; + }; +} + +function doesDefinePropertyWork(object) { + try { + Object.defineProperty(object, "sentinel", {}); + return "sentinel" in object; + } catch (exception) { + } +} +if (Object.defineProperty) { + var definePropertyWorksOnObject = doesDefinePropertyWork({}); + var definePropertyWorksOnDom = typeof document == "undefined" || + doesDefinePropertyWork(document.createElement("div")); + if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { + var definePropertyFallback = Object.defineProperty; + } +} + +if (!Object.defineProperty || definePropertyFallback) { + var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; + var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " + var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + + "on this javascript engine"; + + Object.defineProperty = function defineProperty(object, property, descriptor) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT_TARGET + object); + if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) + throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); + if (definePropertyFallback) { + try { + return definePropertyFallback.call(Object, object, property, descriptor); + } catch (exception) { + } + } + if (owns(descriptor, "value")) { + + if (supportsAccessors && (lookupGetter(object, property) || + lookupSetter(object, property))) + { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + delete object[property]; + object[property] = descriptor.value; + object.__proto__ = prototype; + } else { + object[property] = descriptor.value; + } + } else { + if (!supportsAccessors) + throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); + if (owns(descriptor, "get")) + defineGetter(object, property, descriptor.get); + if (owns(descriptor, "set")) + defineSetter(object, property, descriptor.set); + } + + return object; + }; +} +if (!Object.defineProperties) { + Object.defineProperties = function defineProperties(object, properties) { + for (var property in properties) { + if (owns(properties, property)) + Object.defineProperty(object, property, properties[property]); + } + return object; + }; +} +if (!Object.seal) { + Object.seal = function seal(object) { + return object; + }; +} +if (!Object.freeze) { + Object.freeze = function freeze(object) { + return object; + }; +} +try { + Object.freeze(function () {}); +} catch (exception) { + Object.freeze = (function freeze(freezeObject) { + return function freeze(object) { + if (typeof object == "function") { + return object; + } else { + return freezeObject(object); + } + }; + })(Object.freeze); +} +if (!Object.preventExtensions) { + Object.preventExtensions = function preventExtensions(object) { + return object; + }; +} +if (!Object.isSealed) { + Object.isSealed = function isSealed(object) { + return false; + }; +} +if (!Object.isFrozen) { + Object.isFrozen = function isFrozen(object) { + return false; + }; +} +if (!Object.isExtensible) { + Object.isExtensible = function isExtensible(object) { + if (Object(object) === object) { + throw new TypeError(); // TODO message + } + var name = ''; + while (owns(object, name)) { + name += '?'; + } + object[name] = true; + var returnValue = owns(object, name); + delete object[name]; + return returnValue; + }; +} +if (!Object.keys) { + var hasDontEnumBug = true, + dontEnums = [ + "toString", + "toLocaleString", + "valueOf", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "constructor" + ], + dontEnumsLength = dontEnums.length; + + for (var key in {"toString": null}) { + hasDontEnumBug = false; + } + + Object.keys = function keys(object) { + + if ( + (typeof object != "object" && typeof object != "function") || + object === null + ) { + throw new TypeError("Object.keys called on a non-object"); + } + + var keys = []; + for (var name in object) { + if (owns(object, name)) { + keys.push(name); + } + } + + if (hasDontEnumBug) { + for (var i = 0, ii = dontEnumsLength; i < ii; i++) { + var dontEnum = dontEnums[i]; + if (owns(object, dontEnum)) { + keys.push(dontEnum); + } + } + } + return keys; + }; + +} +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + + "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + + "\u2029\uFEFF"; +if (!String.prototype.trim || ws.trim()) { + ws = "[" + ws + "]"; + var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), + trimEndRegexp = new RegExp(ws + ws + "*$"); + String.prototype.trim = function trim() { + return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); + }; +} + +function toInteger(n) { + n = +n; + if (n !== n) { // isNaN + n = 0; + } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + return n; +} + +function isPrimitive(input) { + var type = typeof input; + return ( + input === null || + type === "undefined" || + type === "boolean" || + type === "number" || + type === "string" + ); +} + +function toPrimitive(input) { + var val, valueOf, toString; + if (isPrimitive(input)) { + return input; + } + valueOf = input.valueOf; + if (typeof valueOf === "function") { + val = valueOf.call(input); + if (isPrimitive(val)) { + return val; + } + } + toString = input.toString; + if (typeof toString === "function") { + val = toString.call(input); + if (isPrimitive(val)) { + return val; + } + } + throw new TypeError(); +} +var toObject = function (o) { + if (o == null) { // this matches both null and undefined + throw new TypeError("can't convert "+o+" to object"); + } + return Object(o); +}; + +}); + +ace.define('ace/mode/json_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/json/json_parse'], function(require, exports, module) { + + +var oop = require("../lib/oop"); +var Mirror = require("../worker/mirror").Mirror; +var parse = require("./json/json_parse"); + +var JsonWorker = exports.JsonWorker = function(sender) { + Mirror.call(this, sender); + this.setTimeout(200); +}; + +oop.inherits(JsonWorker, Mirror); + +(function() { + + this.onUpdate = function() { + var value = this.doc.getValue(); + + try { + var result = parse(value); + } catch (e) { + var pos = this.doc.indexToPosition(e.at-1); + this.sender.emit("error", { + row: pos.row, + column: pos.column, + text: e.message, + type: "error" + }); + return; + } + this.sender.emit("ok"); + }; + +}).call(JsonWorker.prototype); + +}); + +ace.define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) { + + +exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); +}; + +exports.mixin = function(obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; +}; + +exports.implement = function(proto, mixin) { + exports.mixin(proto, mixin); +}; + +}); +ace.define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { + + +var Document = require("../document").Document; +var lang = require("../lib/lang"); + +var Mirror = exports.Mirror = function(sender) { + this.sender = sender; + var doc = this.doc = new Document(""); + + var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); + + var _self = this; + sender.on("change", function(e) { + doc.applyDeltas(e.data); + if (_self.$timeout) + return deferredUpdate.schedule(_self.$timeout); + _self.onUpdate(); + }); +}; + +(function() { + + this.$timeout = 500; + + this.setTimeout = function(timeout) { + this.$timeout = timeout; + }; + + this.setValue = function(value) { + this.doc.setValue(value); + this.deferredUpdate.schedule(this.$timeout); + }; + + this.getValue = function(callbackId) { + this.sender.callback(this.doc.getValue(), callbackId); + }; + + this.onUpdate = function() { + }; + + this.isPending = function() { + return this.deferredUpdate.isPending(); + }; + +}).call(Mirror.prototype); + +}); + +ace.define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Range = require("./range").Range; +var Anchor = require("./anchor").Anchor; + +var Document = function(text) { + this.$lines = []; + if (text.length == 0) { + this.$lines = [""]; + } else if (Array.isArray(text)) { + this._insertLines(0, text); + } else { + this.insert({row: 0, column:0}, text); + } +}; + +(function() { + + oop.implement(this, EventEmitter); + this.setValue = function(text) { + var len = this.getLength(); + this.remove(new Range(0, 0, len, this.getLine(len-1).length)); + this.insert({row: 0, column:0}, text); + }; + this.getValue = function() { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function(row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length == 0) + this.$split = function(text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + } + else + this.$split = function(text) { + return text.split(/\r\n|\r|\n/); + }; + + + this.$detectNewLine = function(text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + }; + this.getNewLineCharacter = function() { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine; + } + }; + + this.$autoNewLine = "\n"; + this.$newLineMode = "auto"; + this.setNewLineMode = function(newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + }; + this.getNewLineMode = function() { + return this.$newLineMode; + }; + this.isNewLine = function(text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function(row) { + return this.$lines[row] || ""; + }; + this.getLines = function(firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function() { + return this.getLines(0, this.getLength()); + }; + this.getLength = function() { + return this.$lines.length; + }; + this.getTextRange = function(range) { + if (range.start.row == range.end.row) { + return this.getLine(range.start.row) + .substring(range.start.column, range.end.column); + } + var lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + return lines.join(this.getNewLineCharacter()); + }; + + this.$clipPosition = function(position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length-1).length; + } else if (position.row < 0) + position.row = 0; + return position; + }; + this.insert = function(position, text) { + if (!text || text.length === 0) + return position; + + position = this.$clipPosition(position); + if (this.getLength() <= 1) + this.$detectNewLine(text); + + var lines = this.$split(text); + var firstLine = lines.splice(0, 1)[0]; + var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; + + position = this.insertInLine(position, firstLine); + if (lastLine !== null) { + position = this.insertNewLine(position); // terminate first line + position = this._insertLines(position.row, lines); + position = this.insertInLine(position, lastLine || ""); + } + return position; + }; + this.insertLines = function(row, lines) { + if (row >= this.getLength()) + return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); + return this._insertLines(Math.max(row, 0), lines); + }; + this._insertLines = function(row, lines) { + if (lines.length == 0) + return {row: row, column: 0}; + if (lines.length > 0xFFFF) { + var end = this._insertLines(row, lines.slice(0xFFFF)); + lines = lines.slice(0, 0xFFFF); + } + + var args = [row, 0]; + args.push.apply(args, lines); + this.$lines.splice.apply(this.$lines, args); + + var range = new Range(row, 0, row + lines.length, 0); + var delta = { + action: "insertLines", + range: range, + lines: lines + }; + this._emit("change", { data: delta }); + return end || range.end; + }; + this.insertNewLine = function(position) { + position = this.$clipPosition(position); + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column); + this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); + + var end = { + row : position.row + 1, + column : 0 + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + + return end; + }; + this.insertInLine = function(position, text) { + if (text.length == 0) + return position; + + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column) + text + + line.substring(position.column); + + var end = { + row : position.row, + column : position.column + text.length + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: text + }; + this._emit("change", { data: delta }); + + return end; + }; + this.remove = function(range) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + range.start = this.$clipPosition(range.start); + range.end = this.$clipPosition(range.end); + + if (range.isEmpty()) + return range.start; + + var firstRow = range.start.row; + var lastRow = range.end.row; + + if (range.isMultiLine()) { + var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; + var lastFullRow = lastRow - 1; + + if (range.end.column > 0) + this.removeInLine(lastRow, 0, range.end.column); + + if (lastFullRow >= firstFullRow) + this._removeLines(firstFullRow, lastFullRow); + + if (firstFullRow != firstRow) { + this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); + this.removeNewLine(range.start.row); + } + } + else { + this.removeInLine(firstRow, range.start.column, range.end.column); + } + return range.start; + }; + this.removeInLine = function(row, startColumn, endColumn) { + if (startColumn == endColumn) + return; + + var range = new Range(row, startColumn, row, endColumn); + var line = this.getLine(row); + var removed = line.substring(startColumn, endColumn); + var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); + this.$lines.splice(row, 1, newLine); + + var delta = { + action: "removeText", + range: range, + text: removed + }; + this._emit("change", { data: delta }); + return range.start; + }; + this.removeLines = function(firstRow, lastRow) { + if (firstRow < 0 || lastRow >= this.getLength()) + return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); + return this._removeLines(firstRow, lastRow); + }; + + this._removeLines = function(firstRow, lastRow) { + var range = new Range(firstRow, 0, lastRow + 1, 0); + var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); + + var delta = { + action: "removeLines", + range: range, + nl: this.getNewLineCharacter(), + lines: removed + }; + this._emit("change", { data: delta }); + return removed; + }; + this.removeNewLine = function(row) { + var firstLine = this.getLine(row); + var secondLine = this.getLine(row+1); + + var range = new Range(row, firstLine.length, row+1, 0); + var line = firstLine + secondLine; + + this.$lines.splice(row, 2, line); + + var delta = { + action: "removeText", + range: range, + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + }; + this.replace = function(range, text) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + if (text.length == 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + if (text) { + var end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function(deltas) { + for (var i=0; i=0; i--) { + var delta = deltas[i]; + + var range = Range.fromPoints(delta.range.start, delta.range.end); + + if (delta.action == "insertLines") + this._removeLines(range.start.row, range.end.row - 1); + else if (delta.action == "insertText") + this.remove(range); + else if (delta.action == "removeLines") + this._insertLines(range.start.row, delta.lines); + else if (delta.action == "removeText") + this.insert(range.start, delta.text); + } + }; + this.indexToPosition = function(index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l-1, column: lines[l-1].length}; + }; + this.positionToIndex = function(pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + +}).call(Document.prototype); + +exports.Document = Document; +}); + +ace.define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) { + + +var EventEmitter = {}; +var stopPropagation = function() { this.propagationStopped = true; }; +var preventDefault = function() { this.defaultPrevented = true; }; + +EventEmitter._emit = +EventEmitter._dispatchEvent = function(eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + + if (typeof e != "object" || !e) + e = {}; + + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + + listeners = listeners.slice(); + for (var i=0; i [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function(row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function(range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function(p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function(range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function(range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function(row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function(row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function(row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function(row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function(row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + }; + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function(row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function(firstRow, lastRow) { + if (this.end.row > lastRow) + var end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + var end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + var start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + var start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function(row, column) { + var cmp = this.compare(row, column); + + if (cmp == 0) + return this; + else if (cmp == -1) + var start = {row: row, column: column}; + else + var end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function() { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function() { + return (this.start.row !== this.end.row); + }; + this.clone = function() { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function() { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function(session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function(row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + +}).call(Range.prototype); +Range.fromPoints = function(start, end) { + return new Range(start.row, start.column, end.row, end.column); +}; +Range.comparePoints = comparePoints; + +Range.comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; +}; + + +exports.Range = Range; +}); + +ace.define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { + + +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; + +var Anchor = exports.Anchor = function(doc, row, column) { + this.$onChange = this.onChange.bind(this); + this.attach(doc); + + if (typeof column == "undefined") + this.setPosition(row.row, row.column); + else + this.setPosition(row, column); +}; + +(function() { + + oop.implement(this, EventEmitter); + this.getPosition = function() { + return this.$clipPositionToDocument(this.row, this.column); + }; + this.getDocument = function() { + return this.document; + }; + this.$insertRight = false; + this.onChange = function(e) { + var delta = e.data; + var range = delta.range; + + if (range.start.row == range.end.row && range.start.row != this.row) + return; + + if (range.start.row > this.row) + return; + + if (range.start.row == this.row && range.start.column > this.column) + return; + + var row = this.row; + var column = this.column; + var start = range.start; + var end = range.end; + + if (delta.action === "insertText") { + if (start.row === row && start.column <= column) { + if (start.column === column && this.$insertRight) { + } else if (start.row === end.row) { + column += end.column - start.column; + } else { + column -= start.column; + row += end.row - start.row; + } + } else if (start.row !== end.row && start.row < row) { + row += end.row - start.row; + } + } else if (delta.action === "insertLines") { + if (start.row <= row) { + row += end.row - start.row; + } + } else if (delta.action === "removeText") { + if (start.row === row && start.column < column) { + if (end.column >= column) + column = start.column; + else + column = Math.max(0, column - (end.column - start.column)); + + } else if (start.row !== end.row && start.row < row) { + if (end.row === row) + column = Math.max(0, column - end.column) + start.column; + row -= (end.row - start.row); + } else if (end.row === row) { + row -= end.row - start.row; + column = Math.max(0, column - end.column) + start.column; + } + } else if (delta.action == "removeLines") { + if (start.row <= row) { + if (end.row <= row) + row -= end.row - start.row; + else { + row = start.row; + column = 0; + } + } + } + + this.setPosition(row, column, true); + }; + this.setPosition = function(row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._emit("change", { + old: old, + value: pos + }); + }; + this.detach = function() { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function(doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function(row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + +}).call(Anchor.prototype); + +}); + +ace.define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) { + + +exports.stringReverse = function(string) { + return string.split("").reverse().join(""); +}; + +exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; +}; + +var trimBeginRegexp = /^\s\s*/; +var trimEndRegexp = /\s\s*$/; + +exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); +}; + +exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); +}; + +exports.copyObject = function(obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; +}; + +exports.copyArray = function(array){ + var copy = []; + for (var i=0, l=array.length; i= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (isNaN(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + + var hex, + i, + string = '', + uffff; + + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + + value = function () { + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } + }; + + return function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + + return typeof reviver === 'function' ? function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '') : result; + }; +}); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/acequire.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/acequire.js new file mode 100644 index 0000000..6875dee --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/acequire.js @@ -0,0 +1 @@ +module.exports = require('ace').require; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ui-bootstrap-custom/ui-bootstrap-custom.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ui-bootstrap-custom/ui-bootstrap-custom.js new file mode 100644 index 0000000..a45eb7c --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/ui-bootstrap-custom/ui-bootstrap-custom.js @@ -0,0 +1,702 @@ +/* + * angular-ui-bootstrap + * http://angular-ui.github.io/bootstrap/ + + * Version: 0.14.2 - 2015-10-17 + * License: MIT + */ +angular.module("sense.ui.bootstrap", ["sense.ui.bootstrap.tpls","sense.ui.bootstrap.typeahead","sense.ui.bootstrap.position"]); +angular.module("sense.ui.bootstrap.tpls", ["sense/template/typeahead/typeahead-match.html","sense/template/typeahead/typeahead-popup.html"]); +angular.module('sense.ui.bootstrap.typeahead', ['sense.ui.bootstrap.position']) + +/** + * A helper service that can parse typeahead's syntax (string provided by users) + * Extracted to a separate service for ease of unit testing + */ + .factory('senseUibTypeaheadParser', ['$parse', function($parse) { + // 00000111000000000000022200000000000000003333333333333330000000000044000 + var TYPEAHEAD_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/; + return { + parse: function(input) { + var match = input.match(TYPEAHEAD_REGEXP); + if (!match) { + throw new Error( + 'Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_"' + + ' but got "' + input + '".'); + } + + return { + itemName: match[3], + source: $parse(match[4]), + viewMapper: $parse(match[2] || match[1]), + modelMapper: $parse(match[1]) + }; + } + }; + }]) + + .controller('SenseUibTypeaheadController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$q', '$timeout', '$document', '$window', '$rootScope', '$senseUibPosition', 'senseUibTypeaheadParser', + function(originalScope, element, attrs, $compile, $parse, $q, $timeout, $document, $window, $rootScope, $position, typeaheadParser) { + var HOT_KEYS = [9, 13, 27, 38, 40]; + var eventDebounceTime = 200; + var modelCtrl, ngModelOptions; + //SUPPORTED ATTRIBUTES (OPTIONS) + + //minimal no of characters that needs to be entered before typeahead kicks-in + var minLength = originalScope.$eval(attrs.typeaheadMinLength); + if (!minLength && minLength !== 0) { + minLength = 1; + } + + //minimal wait time after last character typed before typeahead kicks-in + var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0; + + //should it restrict model values to the ones selected from the popup only? + var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false; + + //binding to a variable that indicates if matches are being retrieved asynchronously + var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop; + + //a callback executed when a match is selected + var onSelectCallback = $parse(attrs.typeaheadOnSelect); + + //should it select highlighted popup value when losing focus? + var isSelectOnBlur = angular.isDefined(attrs.typeaheadSelectOnBlur) ? originalScope.$eval(attrs.typeaheadSelectOnBlur) : false; + + //binding to a variable that indicates if there were no results after the query is completed + var isNoResultsSetter = $parse(attrs.typeaheadNoResults).assign || angular.noop; + + var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined; + + var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false; + + var appendToElementId = attrs.typeaheadAppendToElementId || false; + + var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false; + + //If input matches an item of the list exactly, select it automatically + var selectOnExact = attrs.typeaheadSelectOnExact ? originalScope.$eval(attrs.typeaheadSelectOnExact) : false; + + //INTERNAL VARIABLES + + //model setter executed upon match selection + var parsedModel = $parse(attrs.ngModel); + var invokeModelSetter = $parse(attrs.ngModel + '($$$p)'); + var $setModelValue = function(scope, newValue) { + if (angular.isFunction(parsedModel(originalScope)) && + ngModelOptions && ngModelOptions.$options && ngModelOptions.$options.getterSetter) { + return invokeModelSetter(scope, {$$$p: newValue}); + } else { + return parsedModel.assign(scope, newValue); + } + }; + + //expressions used by typeahead + var parserResult = typeaheadParser.parse(attrs.senseUibTypeahead); + + var hasFocus; + + //Used to avoid bug in iOS webview where iOS keyboard does not fire + //mousedown & mouseup events + //Issue #3699 + var selected; + + //create a child scope for the typeahead directive so we are not polluting original scope + //with typeahead-specific data (matches, query etc.) + var scope = originalScope.$new(); + var offDestroy = originalScope.$on('$destroy', function() { + scope.$destroy(); + }); + scope.$on('$destroy', offDestroy); + + // WAI-ARIA + var popupId = 'typeahead-' + scope.$id + '-' + Math.floor(Math.random() * 10000); + element.attr({ + 'aria-autocomplete': 'list', + 'aria-expanded': false, + 'aria-owns': popupId + }); + + //pop-up element used to display matches + var popUpEl = angular.element('
    '); + popUpEl.attr({ + id: popupId, + matches: 'matches', + active: 'activeIdx', + select: 'select(activeIdx)', + 'move-in-progress': 'moveInProgress', + query: 'query', + position: 'position' + }); + //custom item template + if (angular.isDefined(attrs.typeaheadTemplateUrl)) { + popUpEl.attr('template-url', attrs.typeaheadTemplateUrl); + } + + if (angular.isDefined(attrs.typeaheadPopupTemplateUrl)) { + popUpEl.attr('popup-template-url', attrs.typeaheadPopupTemplateUrl); + } + + var resetMatches = function() { + scope.matches = []; + scope.activeIdx = -1; + element.attr('aria-expanded', false); + }; + + var getMatchId = function(index) { + return popupId + '-option-' + index; + }; + + // Indicate that the specified match is the active (pre-selected) item in the list owned by this typeahead. + // This attribute is added or removed automatically when the `activeIdx` changes. + scope.$watch('activeIdx', function(index) { + if (index < 0) { + element.removeAttr('aria-activedescendant'); + } else { + element.attr('aria-activedescendant', getMatchId(index)); + } + }); + + var inputIsExactMatch = function(inputValue, index) { + if (scope.matches.length > index && inputValue) { + return inputValue.toUpperCase() === scope.matches[index].label.toUpperCase(); + } + + return false; + }; + + var getMatchesAsync = function(inputValue) { + var locals = {$viewValue: inputValue}; + isLoadingSetter(originalScope, true); + isNoResultsSetter(originalScope, false); + $q.when(parserResult.source(originalScope, locals)).then(function(matches) { + //it might happen that several async queries were in progress if a user were typing fast + //but we are interested only in responses that correspond to the current view value + var onCurrentRequest = (inputValue === modelCtrl.$viewValue); + if (onCurrentRequest && hasFocus) { + if (matches && matches.length > 0) { + scope.activeIdx = focusFirst ? 0 : -1; + isNoResultsSetter(originalScope, false); + scope.matches.length = 0; + + //transform labels + for (var i = 0; i < matches.length; i++) { + locals[parserResult.itemName] = matches[i]; + scope.matches.push({ + id: getMatchId(i), + label: parserResult.viewMapper(scope, locals), + model: matches[i] + }); + } + + scope.query = inputValue; + //position pop-up with matches - we need to re-calculate its position each time we are opening a window + //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page + //due to other elements being rendered + recalculatePosition(); + + element.attr('aria-expanded', true); + + //Select the single remaining option if user input matches + if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) { + scope.select(0); + } + } else { + resetMatches(); + isNoResultsSetter(originalScope, true); + } + } + if (onCurrentRequest) { + isLoadingSetter(originalScope, false); + } + }, function() { + resetMatches(); + isLoadingSetter(originalScope, false); + isNoResultsSetter(originalScope, true); + }); + }; + + // bind events only if appendToBody params exist - performance feature + if (appendToBody) { + angular.element($window).bind('resize', fireRecalculating); + $document.find('body').bind('scroll', fireRecalculating); + } + + // Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later + var timeoutEventPromise; + + // Default progress type + scope.moveInProgress = false; + + function fireRecalculating() { + if (!scope.moveInProgress) { + scope.moveInProgress = true; + scope.$digest(); + } + + // Cancel previous timeout + if (timeoutEventPromise) { + $timeout.cancel(timeoutEventPromise); + } + + // Debounced executing recalculate after events fired + timeoutEventPromise = $timeout(function() { + // if popup is visible + if (scope.matches.length) { + recalculatePosition(); + } + + scope.moveInProgress = false; + }, eventDebounceTime); + } + + // recalculate actual position and set new values to scope + // after digest loop is popup in right position + function recalculatePosition() { + scope.position = appendToBody ? $position.offset(element) : $position.position(element); + scope.position.top += element.prop('offsetHeight'); + } + + //we need to propagate user's query so we can higlight matches + scope.query = undefined; + + //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later + var timeoutPromise; + + var scheduleSearchWithTimeout = function(inputValue) { + timeoutPromise = $timeout(function() { + getMatchesAsync(inputValue); + }, waitTime); + }; + + var cancelPreviousTimeout = function() { + if (timeoutPromise) { + $timeout.cancel(timeoutPromise); + } + }; + + resetMatches(); + + scope.select = function(activeIdx) { + //called from within the $digest() cycle + var locals = {}; + var model, item; + + selected = true; + locals[parserResult.itemName] = item = scope.matches[activeIdx].model; + model = parserResult.modelMapper(originalScope, locals); + $setModelValue(originalScope, model); + modelCtrl.$setValidity('editable', true); + modelCtrl.$setValidity('parse', true); + + onSelectCallback(originalScope, { + $item: item, + $model: model, + $label: parserResult.viewMapper(originalScope, locals) + }); + + resetMatches(); + + //return focus to the input element if a match was selected via a mouse click event + // use timeout to avoid $rootScope:inprog error + if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) { + $timeout(function() { element[0].focus(); }, 0, false); + } + }; + + //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27) + element.bind('keydown', function(evt) { + //typeahead is open and an "interesting" key was pressed + if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) { + return; + } + + // if there's nothing selected (i.e. focusFirst) and enter or tab is hit, clear the results + if (scope.activeIdx === -1 && (evt.which === 9 || evt.which === 13)) { + resetMatches(); + scope.$digest(); + return; + } + + evt.preventDefault(); + + if (evt.which === 40) { + scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length; + scope.$digest(); + } else if (evt.which === 38) { + scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1; + scope.$digest(); + } else if (evt.which === 13 || evt.which === 9) { + scope.$apply(function () { + scope.select(scope.activeIdx); + }); + } else if (evt.which === 27) { + evt.stopPropagation(); + + resetMatches(); + scope.$digest(); + } + }); + + element.bind('blur', function() { + if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) { + selected = true; + scope.$apply(function() { + scope.select(scope.activeIdx); + }); + } + hasFocus = false; + selected = false; + }); + + // Keep reference to click handler to unbind it. + var dismissClickHandler = function(evt) { + // Issue #3973 + // Firefox treats right click as a click on document + if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) { + resetMatches(); + if (!$rootScope.$$phase) { + scope.$digest(); + } + } + }; + + $document.bind('click', dismissClickHandler); + + originalScope.$on('$destroy', function() { + $document.unbind('click', dismissClickHandler); + if (appendToBody || appendToElementId) { + $popup.remove(); + } + // Prevent jQuery cache memory leak + popUpEl.remove(); + }); + + var $popup = $compile(popUpEl)(scope); + + if (appendToBody) { + $document.find('body').append($popup); + } else if (appendToElementId !== false) { + angular.element($document[0].getElementById(appendToElementId)).append($popup); + } else { + element.after($popup); + } + + this.init = function(_modelCtrl, _ngModelOptions) { + modelCtrl = _modelCtrl; + ngModelOptions = _ngModelOptions; + + //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM + //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue + modelCtrl.$parsers.unshift(function(inputValue) { + hasFocus = true; + + if (minLength === 0 || inputValue && inputValue.length >= minLength) { + if (waitTime > 0) { + cancelPreviousTimeout(); + scheduleSearchWithTimeout(inputValue); + } else { + getMatchesAsync(inputValue); + } + } else { + isLoadingSetter(originalScope, false); + cancelPreviousTimeout(); + resetMatches(); + } + + if (isEditable) { + return inputValue; + } else { + if (!inputValue) { + // Reset in case user had typed something previously. + modelCtrl.$setValidity('editable', true); + return null; + } else { + modelCtrl.$setValidity('editable', false); + return undefined; + } + } + }); + + modelCtrl.$formatters.push(function(modelValue) { + var candidateViewValue, emptyViewValue; + var locals = {}; + + // The validity may be set to false via $parsers (see above) if + // the model is restricted to selected values. If the model + // is set manually it is considered to be valid. + if (!isEditable) { + modelCtrl.$setValidity('editable', true); + } + + if (inputFormatter) { + locals.$model = modelValue; + return inputFormatter(originalScope, locals); + } else { + //it might happen that we don't have enough info to properly render input value + //we need to check for this situation and simply return model value if we can't apply custom formatting + locals[parserResult.itemName] = modelValue; + candidateViewValue = parserResult.viewMapper(originalScope, locals); + locals[parserResult.itemName] = undefined; + emptyViewValue = parserResult.viewMapper(originalScope, locals); + + return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue; + } + }); + }; + }]) + + .directive('senseUibTypeahead', function() { + return { + controller: 'SenseUibTypeaheadController', + require: ['ngModel', '^?ngModelOptions', 'senseUibTypeahead'], + link: function(originalScope, element, attrs, ctrls) { + ctrls[2].init(ctrls[0], ctrls[1]); + } + }; + }) + + .directive('senseUibTypeaheadPopup', function() { + return { + scope: { + matches: '=', + query: '=', + active: '=', + position: '&', + moveInProgress: '=', + select: '&' + }, + replace: true, + templateUrl: function(element, attrs) { + return attrs.popupTemplateUrl || 'sense/template/typeahead/typeahead-popup.html'; + }, + link: function(scope, element, attrs) { + scope.templateUrl = attrs.templateUrl; + + scope.isOpen = function() { + return scope.matches.length > 0; + }; + + scope.isActive = function(matchIdx) { + return scope.active == matchIdx; + }; + + scope.selectActive = function(matchIdx) { + scope.active = matchIdx; + }; + + scope.selectMatch = function(activeIdx) { + scope.select({activeIdx:activeIdx}); + }; + } + }; + }) + + .directive('senseUibTypeaheadMatch', ['$templateCache', '$compile', '$parse', function($templateCache, $compile, $parse) { + return { + scope: { + index: '=', + match: '=', + query: '=' + }, + link:function(scope, element, attrs) { + var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'sense/template/typeahead/typeahead-match.html'; + $compile($templateCache.get(tplUrl).trim())(scope, function(clonedElement) { + element.replaceWith(clonedElement); + }); + } + }; + }]) + + .filter('senseUibTypeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) { + var isSanitizePresent; + isSanitizePresent = $injector.has('$sanitize'); + + function escapeRegexp(queryToEscape) { + // Regex: capture the whole query string and replace it with the string that will be used to match + // the results, for example if the capture is "a" the result will be \a + return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'); + } + + function containsHtml(matchItem) { + return /<.*>/g.test(matchItem); + } + + return function(matchItem, query) { + if (!isSanitizePresent && containsHtml(matchItem)) { + $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger + } + matchItem = query? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '$&') : matchItem; // Replaces the capture string with a the same string inside of a "strong" tag + if (!isSanitizePresent) { + matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive + } + return matchItem; + }; + }]); + +angular.module('sense.ui.bootstrap.position', []) + +/** + * A set of utility methods that can be use to retrieve position of DOM elements. + * It is meant to be used where we need to absolute-position DOM elements in + * relation to other, existing elements (this is the case for tooltips, popovers, + * typeahead suggestions etc.). + */ + .factory('$senseUibPosition', ['$document', '$window', function($document, $window) { + function getStyle(el, cssprop) { + if (el.currentStyle) { //IE + return el.currentStyle[cssprop]; + } else if ($window.getComputedStyle) { + return $window.getComputedStyle(el)[cssprop]; + } + // finally try and get inline style + return el.style[cssprop]; + } + + /** + * Checks if a given element is statically positioned + * @param element - raw DOM element + */ + function isStaticPositioned(element) { + return (getStyle(element, 'position') || 'static' ) === 'static'; + } + + /** + * returns the closest, non-statically positioned parentOffset of a given element + * @param element + */ + var parentOffsetEl = function(element) { + var docDomEl = $document[0]; + var offsetParent = element.offsetParent || docDomEl; + while (offsetParent && offsetParent !== docDomEl && isStaticPositioned(offsetParent) ) { + offsetParent = offsetParent.offsetParent; + } + return offsetParent || docDomEl; + }; + + return { + /** + * Provides read-only equivalent of jQuery's position function: + * http://api.jquery.com/position/ + */ + position: function(element) { + var elBCR = this.offset(element); + var offsetParentBCR = { top: 0, left: 0 }; + var offsetParentEl = parentOffsetEl(element[0]); + if (offsetParentEl != $document[0]) { + offsetParentBCR = this.offset(angular.element(offsetParentEl)); + offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop; + offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft; + } + + var boundingClientRect = element[0].getBoundingClientRect(); + return { + width: boundingClientRect.width || element.prop('offsetWidth'), + height: boundingClientRect.height || element.prop('offsetHeight'), + top: elBCR.top - offsetParentBCR.top, + left: elBCR.left - offsetParentBCR.left + }; + }, + + /** + * Provides read-only equivalent of jQuery's offset function: + * http://api.jquery.com/offset/ + */ + offset: function(element) { + var boundingClientRect = element[0].getBoundingClientRect(); + return { + width: boundingClientRect.width || element.prop('offsetWidth'), + height: boundingClientRect.height || element.prop('offsetHeight'), + top: boundingClientRect.top + ($window.pageYOffset || $document[0].documentElement.scrollTop), + left: boundingClientRect.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft) + }; + }, + + /** + * Provides coordinates for the targetEl in relation to hostEl + */ + positionElements: function(hostEl, targetEl, positionStr, appendToBody) { + var positionStrParts = positionStr.split('-'); + var pos0 = positionStrParts[0], pos1 = positionStrParts[1] || 'center'; + + var hostElPos, + targetElWidth, + targetElHeight, + targetElPos; + + hostElPos = appendToBody ? this.offset(hostEl) : this.position(hostEl); + + targetElWidth = targetEl.prop('offsetWidth'); + targetElHeight = targetEl.prop('offsetHeight'); + + var shiftWidth = { + center: function() { + return hostElPos.left + hostElPos.width / 2 - targetElWidth / 2; + }, + left: function() { + return hostElPos.left; + }, + right: function() { + return hostElPos.left + hostElPos.width; + } + }; + + var shiftHeight = { + center: function() { + return hostElPos.top + hostElPos.height / 2 - targetElHeight / 2; + }, + top: function() { + return hostElPos.top; + }, + bottom: function() { + return hostElPos.top + hostElPos.height; + } + }; + + switch (pos0) { + case 'right': + targetElPos = { + top: shiftHeight[pos1](), + left: shiftWidth[pos0]() + }; + break; + case 'left': + targetElPos = { + top: shiftHeight[pos1](), + left: hostElPos.left - targetElWidth + }; + break; + case 'bottom': + targetElPos = { + top: shiftHeight[pos0](), + left: shiftWidth[pos1]() + }; + break; + default: + targetElPos = { + top: hostElPos.top - targetElHeight, + left: shiftWidth[pos1]() + }; + break; + } + + return targetElPos; + } + }; + }]); + +angular.module("sense/template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("sense/template/typeahead/typeahead-match.html", + "\n" + + ""); +}]); + +angular.module("sense/template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("sense/template/typeahead/typeahead-popup.html", + "
      \n" + + "
    • \n" + + "
      \n" + + "
    • \n" + + "
    \n" + + ""); +}]); diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zero_clipboard.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zero_clipboard.js new file mode 100644 index 0000000..f51303e --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zero_clipboard.js @@ -0,0 +1,2586 @@ +/*! + * ZeroClipboard + * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. + * Copyright (c) 2009-2014 Jon Rohan, James M. Greene + * Licensed MIT + * http://zeroclipboard.org/ + * v2.2.0 + */ +(function (window, undefined) { + "use strict"; + /** + * Store references to critically important global functions that may be + * overridden on certain web pages. + */ + var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _clearTimeout = _window.clearTimeout, _setInterval = _window.setInterval, _clearInterval = _window.clearInterval, _getComputedStyle = _window.getComputedStyle, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _now = _window.Date.now, _keys = _window.Object.keys, _defineProperty = _window.Object.defineProperty, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice, _unwrap = function () { + var unwrapper = function (el) { + return el; + }; + if (typeof _window.wrap === "function" && typeof _window.unwrap === "function") { + try { + var div = _document.createElement("div"); + var unwrappedDiv = _window.unwrap(div); + if (div.nodeType === 1 && unwrappedDiv && unwrappedDiv.nodeType === 1) { + unwrapper = _window.unwrap; + } + } catch (e) { + } + } + return unwrapper; + }(); + /** + * Convert an `arguments` object into an Array. + * + * @returns The arguments as an Array + * @private + */ + var _args = function (argumentsObj) { + return _slice.call(argumentsObj, 0); + }; + /** + * Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`. + * + * @returns The target object, augmented + * @private + */ + var _extend = function () { + var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {}; + for (i = 1, len = args.length; i < len; i++) { + if ((arg = args[i]) != null) { + for (prop in arg) { + if (_hasOwn.call(arg, prop)) { + src = target[prop]; + copy = arg[prop]; + if (target !== copy && copy !== undefined) { + target[prop] = copy; + } + } + } + } + } + return target; + }; + /** + * Return a deep copy of the source object or array. + * + * @returns Object or Array + * @private + */ + var _deepCopy = function (source) { + var copy, i, len, prop; + if (typeof source !== "object" || source == null || typeof source.nodeType === "number") { + copy = source; + } else if (typeof source.length === "number") { + copy = []; + for (i = 0, len = source.length; i < len; i++) { + if (_hasOwn.call(source, i)) { + copy[i] = _deepCopy(source[i]); + } + } + } else { + copy = {}; + for (prop in source) { + if (_hasOwn.call(source, prop)) { + copy[prop] = _deepCopy(source[prop]); + } + } + } + return copy; + }; + /** + * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep. + * The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to + * be kept. + * + * @returns A new filtered object. + * @private + */ + var _pick = function (obj, keys) { + var newObj = {}; + for (var i = 0, len = keys.length; i < len; i++) { + if (keys[i] in obj) { + newObj[keys[i]] = obj[keys[i]]; + } + } + return newObj; + }; + /** + * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit. + * The inverse of `_pick`. + * + * @returns A new filtered object. + * @private + */ + var _omit = function (obj, keys) { + var newObj = {}; + for (var prop in obj) { + if (keys.indexOf(prop) === -1) { + newObj[prop] = obj[prop]; + } + } + return newObj; + }; + /** + * Remove all owned, enumerable properties from an object. + * + * @returns The original object without its owned, enumerable properties. + * @private + */ + var _deleteOwnProperties = function (obj) { + if (obj) { + for (var prop in obj) { + if (_hasOwn.call(obj, prop)) { + delete obj[prop]; + } + } + } + return obj; + }; + /** + * Determine if an element is contained within another element. + * + * @returns Boolean + * @private + */ + var _containedBy = function (el, ancestorEl) { + if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) { + do { + if (el === ancestorEl) { + return true; + } + el = el.parentNode; + } while (el); + } + return false; + }; + /** + * Get the URL path's parent directory. + * + * @returns String or `undefined` + * @private + */ + var _getDirPathOfUrl = function (url) { + var dir; + if (typeof url === "string" && url) { + dir = url.split("#")[0].split("?")[0]; + dir = url.slice(0, url.lastIndexOf("/") + 1); + } + return dir; + }; + /** + * Get the current script's URL by throwing an `Error` and analyzing it. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrlFromErrorStack = function (stack) { + var url, matches; + if (typeof stack === "string" && stack) { + matches = stack.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/); + if (matches && matches[1]) { + url = matches[1]; + } else { + matches = stack.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/); + if (matches && matches[1]) { + url = matches[1]; + } + } + } + return url; + }; + /** + * Get the current script's URL by throwing an `Error` and analyzing it. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrlFromError = function () { + var url, err; + try { + throw new _Error(); + } catch (e) { + err = e; + } + if (err) { + url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack); + } + return url; + }; + /** + * Get the current script's URL. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrl = function () { + var jsPath, scripts, i; + if (_document.currentScript && (jsPath = _document.currentScript.src)) { + return jsPath; + } + scripts = _document.getElementsByTagName("script"); + if (scripts.length === 1) { + return scripts[0].src || undefined; + } + if ("readyState" in scripts[0]) { + for (i = scripts.length; i--;) { + if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) { + return jsPath; + } + } + } + if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) { + return jsPath; + } + if (jsPath = _getCurrentScriptUrlFromError()) { + return jsPath; + } + return undefined; + }; + /** + * Get the unanimous parent directory of ALL script tags. + * If any script tags are either (a) inline or (b) from differing parent + * directories, this method must return `undefined`. + * + * @returns String or `undefined` + * @private + */ + var _getUnanimousScriptParentDir = function () { + var i, jsDir, jsPath, scripts = _document.getElementsByTagName("script"); + for (i = scripts.length; i--;) { + if (!(jsPath = scripts[i].src)) { + jsDir = null; + break; + } + jsPath = _getDirPathOfUrl(jsPath); + if (jsDir == null) { + jsDir = jsPath; + } else if (jsDir !== jsPath) { + jsDir = null; + break; + } + } + return jsDir || undefined; + }; + /** + * Get the presumed location of the "ZeroClipboard.swf" file, based on the location + * of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.). + * + * @returns String + * @private + */ + var _getDefaultSwfPath = function () { + var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || ""; + return jsDir + "ZeroClipboard.swf"; + }; + /** + * Keep track of if the page is framed (in an `iframe`). This can never change. + * @private + */ + var _pageIsFramed = function () { + return window.opener == null && (!!window.top && window != window.top || !!window.parent && window != window.parent); + }(); + /** + * Keep track of the state of the Flash object. + * @private + */ + var _flashState = { + bridge: null, + version: "0.0.0", + pluginType: "unknown", + disabled: null, + outdated: null, + sandboxed: null, + unavailable: null, + degraded: null, + deactivated: null, + overdue: null, + ready: null + }; + /** + * The minimum Flash Player version required to use ZeroClipboard completely. + * @readonly + * @private + */ + var _minimumFlashVersion = "11.0.0"; + /** + * The ZeroClipboard library version number, as reported by Flash, at the time the SWF was compiled. + */ + var _zcSwfVersion; + /** + * Keep track of all event listener registrations. + * @private + */ + var _handlers = {}; + /** + * Keep track of the currently activated element. + * @private + */ + var _currentElement; + /** + * Keep track of the element that was activated when a `copy` process started. + * @private + */ + var _copyTarget; + /** + * Keep track of data for the pending clipboard transaction. + * @private + */ + var _clipData = {}; + /** + * Keep track of data formats for the pending clipboard transaction. + * @private + */ + var _clipDataFormatMap = null; + /** + * Keep track of the Flash availability check timeout. + * @private + */ + var _flashCheckTimeout = 0; + /** + * Keep track of SWF network errors interval polling. + * @private + */ + var _swfFallbackCheckInterval = 0; + /** + * The `message` store for events + * @private + */ + var _eventMessages = { + ready: "Flash communication is established", + error: { + "flash-disabled": "Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.", + "flash-outdated": "Flash is too outdated to support ZeroClipboard", + "flash-sandboxed": "Attempting to run Flash in a sandboxed iframe, which is impossible", + "flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript", + "flash-degraded": "Flash is unable to preserve data fidelity when communicating with JavaScript", + "flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.", + "flash-overdue": "Flash communication was established but NOT within the acceptable time limit", + "version-mismatch": "ZeroClipboard JS version number does not match ZeroClipboard SWF version number", + "clipboard-error": "At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard", + "config-mismatch": "ZeroClipboard configuration does not match Flash's reality", + "swf-not-found": "The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity" + } + }; + /** + * The `name`s of `error` events that can only occur is Flash has at least + * been able to load the SWF successfully. + * @private + */ + var _errorsThatOnlyOccurAfterFlashLoads = ["flash-unavailable", "flash-degraded", "flash-overdue", "version-mismatch", "config-mismatch", "clipboard-error"]; + /** + * The `name`s of `error` events that should likely result in the `_flashState` + * variable's property values being updated. + * @private + */ + var _flashStateErrorNames = ["flash-disabled", "flash-outdated", "flash-sandboxed", "flash-unavailable", "flash-degraded", "flash-deactivated", "flash-overdue"]; + /** + * A RegExp to match the `name` property of `error` events related to Flash. + * @private + */ + var _flashStateErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.map(function (errorName) { + return errorName.replace(/^flash-/, ""); + }).join("|") + ")$"); + /** + * A RegExp to match the `name` property of `error` events related to Flash, + * which is enabled. + * @private + */ + var _flashStateEnabledErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.slice(1).map(function (errorName) { + return errorName.replace(/^flash-/, ""); + }).join("|") + ")$"); + /** + * ZeroClipboard configuration defaults for the Core module. + * @private + */ + var _globalConfig = { + swfPath: _getDefaultSwfPath(), + trustedDomains: window.location.host ? [window.location.host] : [], + cacheBust: true, + forceEnhancedClipboard: false, + flashLoadTimeout: 3e4, + autoActivate: true, + bubbleEvents: true, + containerId: "global-zeroclipboard-html-bridge", + containerClass: "global-zeroclipboard-container", + swfObjectId: "global-zeroclipboard-flash-bridge", + hoverClass: "zeroclipboard-is-hover", + activeClass: "zeroclipboard-is-active", + forceHandCursor: false, + title: null, + zIndex: 999999999 + }; + /** + * The underlying implementation of `ZeroClipboard.config`. + * @private + */ + var _config = function (options) { + if (typeof options === "object" && options !== null) { + for (var prop in options) { + if (_hasOwn.call(options, prop)) { + if (/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(prop)) { + _globalConfig[prop] = options[prop]; + } else if (_flashState.bridge == null) { + if (prop === "containerId" || prop === "swfObjectId") { + if (_isValidHtml4Id(options[prop])) { + _globalConfig[prop] = options[prop]; + } else { + throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID"); + } + } else { + _globalConfig[prop] = options[prop]; + } + } + } + } + } + if (typeof options === "string" && options) { + if (_hasOwn.call(_globalConfig, options)) { + return _globalConfig[options]; + } + return; + } + return _deepCopy(_globalConfig); + }; + /** + * The underlying implementation of `ZeroClipboard.state`. + * @private + */ + var _state = function () { + _detectSandbox(); + return { + browser: _pick(_navigator, ["userAgent", "platform", "appName"]), + flash: _omit(_flashState, ["bridge"]), + zeroclipboard: { + version: ZeroClipboard.version, + config: ZeroClipboard.config() + } + }; + }; + /** + * The underlying implementation of `ZeroClipboard.isFlashUnusable`. + * @private + */ + var _isFlashUnusable = function () { + return !!(_flashState.disabled || _flashState.outdated || _flashState.sandboxed || _flashState.unavailable || _flashState.degraded || _flashState.deactivated); + }; + /** + * The underlying implementation of `ZeroClipboard.on`. + * @private + */ + var _on = function (eventType, listener) { + var i, len, events, added = {}; + if (typeof eventType === "string" && eventType) { + events = eventType.toLowerCase().split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + ZeroClipboard.on(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].replace(/^on/, ""); + added[eventType] = true; + if (!_handlers[eventType]) { + _handlers[eventType] = []; + } + _handlers[eventType].push(listener); + } + if (added.ready && _flashState.ready) { + ZeroClipboard.emit({ + type: "ready" + }); + } + if (added.error) { + for (i = 0, len = _flashStateErrorNames.length; i < len; i++) { + if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")] === true) { + ZeroClipboard.emit({ + type: "error", + name: _flashStateErrorNames[i] + }); + break; + } + } + if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) { + ZeroClipboard.emit({ + type: "error", + name: "version-mismatch", + jsVersion: ZeroClipboard.version, + swfVersion: _zcSwfVersion + }); + } + } + } + return ZeroClipboard; + }; + /** + * The underlying implementation of `ZeroClipboard.off`. + * @private + */ + var _off = function (eventType, listener) { + var i, len, foundIndex, events, perEventHandlers; + if (arguments.length === 0) { + events = _keys(_handlers); + } else if (typeof eventType === "string" && eventType) { + events = eventType.split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + ZeroClipboard.off(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].toLowerCase().replace(/^on/, ""); + perEventHandlers = _handlers[eventType]; + if (perEventHandlers && perEventHandlers.length) { + if (listener) { + foundIndex = perEventHandlers.indexOf(listener); + while (foundIndex !== -1) { + perEventHandlers.splice(foundIndex, 1); + foundIndex = perEventHandlers.indexOf(listener, foundIndex); + } + } else { + perEventHandlers.length = 0; + } + } + } + } + return ZeroClipboard; + }; + /** + * The underlying implementation of `ZeroClipboard.handlers`. + * @private + */ + var _listeners = function (eventType) { + var copy; + if (typeof eventType === "string" && eventType) { + copy = _deepCopy(_handlers[eventType]) || null; + } else { + copy = _deepCopy(_handlers); + } + return copy; + }; + /** + * The underlying implementation of `ZeroClipboard.emit`. + * @private + */ + var _emit = function (event) { + var eventCopy, returnVal, tmp; + event = _createEvent(event); + if (!event) { + return; + } + if (_preprocessEvent(event)) { + return; + } + if (event.type === "ready" && _flashState.overdue === true) { + return ZeroClipboard.emit({ + type: "error", + name: "flash-overdue" + }); + } + eventCopy = _extend({}, event); + _dispatchCallbacks.call(this, eventCopy); + if (event.type === "copy") { + tmp = _mapClipDataToFlash(_clipData); + returnVal = tmp.data; + _clipDataFormatMap = tmp.formatMap; + } + return returnVal; + }; + /** + * The underlying implementation of `ZeroClipboard.create`. + * @private + */ + var _create = function () { + var previousState = _flashState.sandboxed; + _detectSandbox(); + if (typeof _flashState.ready !== "boolean") { + _flashState.ready = false; + } + if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) { + _flashState.ready = false; + ZeroClipboard.emit({ + type: "error", + name: "flash-sandboxed" + }); + } else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) { + var maxWait = _globalConfig.flashLoadTimeout; + if (typeof maxWait === "number" && maxWait >= 0) { + _flashCheckTimeout = _setTimeout(function () { + if (typeof _flashState.deactivated !== "boolean") { + _flashState.deactivated = true; + } + if (_flashState.deactivated === true) { + ZeroClipboard.emit({ + type: "error", + name: "flash-deactivated" + }); + } + }, maxWait); + } + _flashState.overdue = false; + _embedSwf(); + } + }; + /** + * The underlying implementation of `ZeroClipboard.destroy`. + * @private + */ + var _destroy = function () { + ZeroClipboard.clearData(); + ZeroClipboard.blur(); + ZeroClipboard.emit("destroy"); + _unembedSwf(); + ZeroClipboard.off(); + }; + /** + * The underlying implementation of `ZeroClipboard.setData`. + * @private + */ + var _setData = function (format, data) { + var dataObj; + if (typeof format === "object" && format && typeof data === "undefined") { + dataObj = format; + ZeroClipboard.clearData(); + } else if (typeof format === "string" && format) { + dataObj = {}; + dataObj[format] = data; + } else { + return; + } + for (var dataFormat in dataObj) { + if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) { + _clipData[dataFormat] = dataObj[dataFormat]; + } + } + }; + /** + * The underlying implementation of `ZeroClipboard.clearData`. + * @private + */ + var _clearData = function (format) { + if (typeof format === "undefined") { + _deleteOwnProperties(_clipData); + _clipDataFormatMap = null; + } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) { + delete _clipData[format]; + } + }; + /** + * The underlying implementation of `ZeroClipboard.getData`. + * @private + */ + var _getData = function (format) { + if (typeof format === "undefined") { + return _deepCopy(_clipData); + } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) { + return _clipData[format]; + } + }; + /** + * The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`. + * @private + */ + var _focus = function (element) { + if (!(element && element.nodeType === 1)) { + return; + } + if (_currentElement) { + _removeClass(_currentElement, _globalConfig.activeClass); + if (_currentElement !== element) { + _removeClass(_currentElement, _globalConfig.hoverClass); + } + } + _currentElement = element; + _addClass(element, _globalConfig.hoverClass); + var newTitle = element.getAttribute("title") || _globalConfig.title; + if (typeof newTitle === "string" && newTitle) { + var htmlBridge = _getHtmlBridge(_flashState.bridge); + if (htmlBridge) { + htmlBridge.setAttribute("title", newTitle); + } + } + var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer"; + _setHandCursor(useHandCursor); + _reposition(); + }; + /** + * The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`. + * @private + */ + var _blur = function () { + var htmlBridge = _getHtmlBridge(_flashState.bridge); + if (htmlBridge) { + htmlBridge.removeAttribute("title"); + htmlBridge.style.left = "0px"; + htmlBridge.style.top = "-9999px"; + htmlBridge.style.width = "1px"; + htmlBridge.style.height = "1px"; + } + if (_currentElement) { + _removeClass(_currentElement, _globalConfig.hoverClass); + _removeClass(_currentElement, _globalConfig.activeClass); + _currentElement = null; + } + }; + /** + * The underlying implementation of `ZeroClipboard.activeElement`. + * @private + */ + var _activeElement = function () { + return _currentElement || null; + }; + /** + * Check if a value is a valid HTML4 `ID` or `Name` token. + * @private + */ + var _isValidHtml4Id = function (id) { + return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id); + }; + /** + * Create or update an `event` object, based on the `eventType`. + * @private + */ + var _createEvent = function (event) { + var eventType; + if (typeof event === "string" && event) { + eventType = event; + event = {}; + } else if (typeof event === "object" && event && typeof event.type === "string" && event.type) { + eventType = event.type; + } + if (!eventType) { + return; + } + eventType = eventType.toLowerCase(); + if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === "error" && event.name === "clipboard-error")) { + event.target = _copyTarget; + } + _extend(event, { + type: eventType, + target: event.target || _currentElement || null, + relatedTarget: event.relatedTarget || null, + currentTarget: _flashState && _flashState.bridge || null, + timeStamp: event.timeStamp || _now() || null + }); + var msg = _eventMessages[event.type]; + if (event.type === "error" && event.name && msg) { + msg = msg[event.name]; + } + if (msg) { + event.message = msg; + } + if (event.type === "ready") { + _extend(event, { + target: null, + version: _flashState.version + }); + } + if (event.type === "error") { + if (_flashStateErrorNameMatchingRegex.test(event.name)) { + _extend(event, { + target: null, + minimumVersion: _minimumFlashVersion + }); + } + if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) { + _extend(event, { + version: _flashState.version + }); + } + } + if (event.type === "copy") { + event.clipboardData = { + setData: ZeroClipboard.setData, + clearData: ZeroClipboard.clearData + }; + } + if (event.type === "aftercopy") { + event = _mapClipResultsFromFlash(event, _clipDataFormatMap); + } + if (event.target && !event.relatedTarget) { + event.relatedTarget = _getRelatedTarget(event.target); + } + return _addMouseData(event); + }; + /** + * Get a relatedTarget from the target's `data-clipboard-target` attribute + * @private + */ + var _getRelatedTarget = function (targetEl) { + var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target"); + return relatedTargetId ? _document.getElementById(relatedTargetId) : null; + }; + /** + * Add element and position data to `MouseEvent` instances + * @private + */ + var _addMouseData = function (event) { + if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) { + var srcElement = event.target; + var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined; + var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined; + var pos = _getElementPosition(srcElement); + var screenLeft = _window.screenLeft || _window.screenX || 0; + var screenTop = _window.screenTop || _window.screenY || 0; + var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft; + var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop; + var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0); + var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0); + var clientX = pageX - scrollLeft; + var clientY = pageY - scrollTop; + var screenX = screenLeft + clientX; + var screenY = screenTop + clientY; + var moveX = typeof event.movementX === "number" ? event.movementX : 0; + var moveY = typeof event.movementY === "number" ? event.movementY : 0; + delete event._stageX; + delete event._stageY; + _extend(event, { + srcElement: srcElement, + fromElement: fromElement, + toElement: toElement, + screenX: screenX, + screenY: screenY, + pageX: pageX, + pageY: pageY, + clientX: clientX, + clientY: clientY, + x: clientX, + y: clientY, + movementX: moveX, + movementY: moveY, + offsetX: 0, + offsetY: 0, + layerX: 0, + layerY: 0 + }); + } + return event; + }; + /** + * Determine if an event's registered handlers should be execute synchronously or asynchronously. + * + * @returns {boolean} + * @private + */ + var _shouldPerformAsync = function (event) { + var eventType = event && typeof event.type === "string" && event.type || ""; + return !/^(?:(?:before)?copy|destroy)$/.test(eventType); + }; + /** + * Control if a callback should be executed asynchronously or not. + * + * @returns `undefined` + * @private + */ + var _dispatchCallback = function (func, context, args, async) { + if (async) { + _setTimeout(function () { + func.apply(context, args); + }, 0); + } else { + func.apply(context, args); + } + }; + /** + * Handle the actual dispatching of events to client instances. + * + * @returns `undefined` + * @private + */ + var _dispatchCallbacks = function (event) { + if (!(typeof event === "object" && event && event.type)) { + return; + } + var async = _shouldPerformAsync(event); + var wildcardTypeHandlers = _handlers["*"] || []; + var specificTypeHandlers = _handlers[event.type] || []; + var handlers = wildcardTypeHandlers.concat(specificTypeHandlers); + if (handlers && handlers.length) { + var i, len, func, context, eventCopy, originalContext = this; + for (i = 0, len = handlers.length; i < len; i++) { + func = handlers[i]; + context = originalContext; + if (typeof func === "string" && typeof _window[func] === "function") { + func = _window[func]; + } + if (typeof func === "object" && func && typeof func.handleEvent === "function") { + context = func; + func = func.handleEvent; + } + if (typeof func === "function") { + eventCopy = _extend({}, event); + _dispatchCallback(func, context, [eventCopy], async); + } + } + } + return this; + }; + /** + * Check an `error` event's `name` property to see if Flash has + * already loaded, which rules out possible `iframe` sandboxing. + * @private + */ + var _getSandboxStatusFromErrorEvent = function (event) { + var isSandboxed = null; + if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) { + isSandboxed = false; + } + return isSandboxed; + }; + /** + * Preprocess any special behaviors, reactions, or state changes after receiving this event. + * Executes only once per event emitted, NOT once per client. + * @private + */ + var _preprocessEvent = function (event) { + var element = event.target || _currentElement || null; + var sourceIsSwf = event._source === "swf"; + delete event._source; + switch (event.type) { + case "error": + var isSandboxed = event.name === "flash-sandboxed" || _getSandboxStatusFromErrorEvent(event); + if (typeof isSandboxed === "boolean") { + _flashState.sandboxed = isSandboxed; + } + if (_flashStateErrorNames.indexOf(event.name) !== -1) { + _extend(_flashState, { + disabled: event.name === "flash-disabled", + outdated: event.name === "flash-outdated", + unavailable: event.name === "flash-unavailable", + degraded: event.name === "flash-degraded", + deactivated: event.name === "flash-deactivated", + overdue: event.name === "flash-overdue", + ready: false + }); + } else if (event.name === "version-mismatch") { + _zcSwfVersion = event.swfVersion; + _extend(_flashState, { + disabled: false, + outdated: false, + unavailable: false, + degraded: false, + deactivated: false, + overdue: false, + ready: false + }); + } + _clearTimeoutsAndPolling(); + break; + + case "ready": + _zcSwfVersion = event.swfVersion; + var wasDeactivated = _flashState.deactivated === true; + _extend(_flashState, { + disabled: false, + outdated: false, + sandboxed: false, + unavailable: false, + degraded: false, + deactivated: false, + overdue: wasDeactivated, + ready: !wasDeactivated + }); + _clearTimeoutsAndPolling(); + break; + + case "beforecopy": + _copyTarget = element; + break; + + case "copy": + var textContent, htmlContent, targetEl = event.relatedTarget; + if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) { + event.clipboardData.clearData(); + event.clipboardData.setData("text/plain", textContent); + if (htmlContent !== textContent) { + event.clipboardData.setData("text/html", htmlContent); + } + } else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) { + event.clipboardData.clearData(); + event.clipboardData.setData("text/plain", textContent); + } + break; + + case "aftercopy": + _queueEmitClipboardErrors(event); + ZeroClipboard.clearData(); + if (element && element !== _safeActiveElement() && element.focus) { + element.focus(); + } + break; + + case "_mouseover": + ZeroClipboard.focus(element); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) { + _fireMouseEvent(_extend({}, event, { + type: "mouseenter", + bubbles: false, + cancelable: false + })); + } + _fireMouseEvent(_extend({}, event, { + type: "mouseover" + })); + } + break; + + case "_mouseout": + ZeroClipboard.blur(); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) { + _fireMouseEvent(_extend({}, event, { + type: "mouseleave", + bubbles: false, + cancelable: false + })); + } + _fireMouseEvent(_extend({}, event, { + type: "mouseout" + })); + } + break; + + case "_mousedown": + _addClass(element, _globalConfig.activeClass); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_mouseup": + _removeClass(element, _globalConfig.activeClass); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_click": + _copyTarget = null; + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_mousemove": + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + } + if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) { + return true; + } + }; + /** + * Check an "aftercopy" event for clipboard errors and emit a corresponding "error" event. + * @private + */ + var _queueEmitClipboardErrors = function (aftercopyEvent) { + if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) { + var errorEvent = _deepCopy(aftercopyEvent); + _extend(errorEvent, { + type: "error", + name: "clipboard-error" + }); + delete errorEvent.success; + _setTimeout(function () { + ZeroClipboard.emit(errorEvent); + }, 0); + } + }; + /** + * Dispatch a synthetic MouseEvent. + * + * @returns `undefined` + * @private + */ + var _fireMouseEvent = function (event) { + if (!(event && typeof event.type === "string" && event)) { + return; + } + var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = { + view: doc.defaultView || _window, + canBubble: true, + cancelable: true, + detail: event.type === "click" ? 1 : 0, + button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1 + }, args = _extend(defaults, event); + if (!target) { + return; + } + if (doc.createEvent && target.dispatchEvent) { + args = [args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget]; + e = doc.createEvent("MouseEvents"); + if (e.initMouseEvent) { + e.initMouseEvent.apply(e, args); + e._source = "js"; + target.dispatchEvent(e); + } + } + }; + /** + * Continuously poll the DOM until either: + * (a) the fallback content becomes visible, or + * (b) we receive an event from SWF (handled elsewhere) + * + * IMPORTANT: + * This is NOT a necessary check but it can result in significantly faster + * detection of bad `swfPath` configuration and/or network/server issues [in + * supported browsers] than waiting for the entire `flashLoadTimeout` duration + * to elapse before detecting that the SWF cannot be loaded. The detection + * duration can be anywhere from 10-30 times faster [in supported browsers] by + * using this approach. + * + * @returns `undefined` + * @private + */ + var _watchForSwfFallbackContent = function () { + var maxWait = _globalConfig.flashLoadTimeout; + if (typeof maxWait === "number" && maxWait >= 0) { + var pollWait = Math.min(1e3, maxWait / 10); + var fallbackContentId = _globalConfig.swfObjectId + "_fallbackContent"; + _swfFallbackCheckInterval = _setInterval(function () { + var el = _document.getElementById(fallbackContentId); + if (_isElementVisible(el)) { + _clearTimeoutsAndPolling(); + _flashState.deactivated = null; + ZeroClipboard.emit({ + type: "error", + name: "swf-not-found" + }); + } + }, pollWait); + } + }; + /** + * Create the HTML bridge element to embed the Flash object into. + * @private + */ + var _createHtmlBridge = function () { + var container = _document.createElement("div"); + container.id = _globalConfig.containerId; + container.className = _globalConfig.containerClass; + container.style.position = "absolute"; + container.style.left = "0px"; + container.style.top = "-9999px"; + container.style.width = "1px"; + container.style.height = "1px"; + container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex); + return container; + }; + /** + * Get the HTML element container that wraps the Flash bridge object/element. + * @private + */ + var _getHtmlBridge = function (flashBridge) { + var htmlBridge = flashBridge && flashBridge.parentNode; + while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) { + htmlBridge = htmlBridge.parentNode; + } + return htmlBridge || null; + }; + /** + * Create the SWF object. + * + * @returns The SWF object reference. + * @private + */ + var _embedSwf = function () { + var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge); + if (!flashBridge) { + var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig); + var allowNetworking = allowScriptAccess === "never" ? "none" : "all"; + var flashvars = _vars(_extend({ + jsVersion: ZeroClipboard.version + }, _globalConfig)); + var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig); + container = _createHtmlBridge(); + var divToBeReplaced = _document.createElement("div"); + container.appendChild(divToBeReplaced); + _document.body.appendChild(container); + var tmpDiv = _document.createElement("div"); + var usingActiveX = _flashState.pluginType === "activex"; + tmpDiv.innerHTML = '" + (usingActiveX ? '' : "") + '' + '' + '' + '' + '' + '
     
    ' + "
    "; + flashBridge = tmpDiv.firstChild; + tmpDiv = null; + _unwrap(flashBridge).ZeroClipboard = ZeroClipboard; + container.replaceChild(flashBridge, divToBeReplaced); + _watchForSwfFallbackContent(); + } + if (!flashBridge) { + flashBridge = _document[_globalConfig.swfObjectId]; + if (flashBridge && (len = flashBridge.length)) { + flashBridge = flashBridge[len - 1]; + } + if (!flashBridge && container) { + flashBridge = container.firstChild; + } + } + _flashState.bridge = flashBridge || null; + return flashBridge; + }; + /** + * Destroy the SWF object. + * @private + */ + var _unembedSwf = function () { + var flashBridge = _flashState.bridge; + if (flashBridge) { + var htmlBridge = _getHtmlBridge(flashBridge); + if (htmlBridge) { + if (_flashState.pluginType === "activex" && "readyState" in flashBridge) { + flashBridge.style.display = "none"; + (function removeSwfFromIE() { + if (flashBridge.readyState === 4) { + for (var prop in flashBridge) { + if (typeof flashBridge[prop] === "function") { + flashBridge[prop] = null; + } + } + if (flashBridge.parentNode) { + flashBridge.parentNode.removeChild(flashBridge); + } + if (htmlBridge.parentNode) { + htmlBridge.parentNode.removeChild(htmlBridge); + } + } else { + _setTimeout(removeSwfFromIE, 10); + } + })(); + } else { + if (flashBridge.parentNode) { + flashBridge.parentNode.removeChild(flashBridge); + } + if (htmlBridge.parentNode) { + htmlBridge.parentNode.removeChild(htmlBridge); + } + } + } + _clearTimeoutsAndPolling(); + _flashState.ready = null; + _flashState.bridge = null; + _flashState.deactivated = null; + _zcSwfVersion = undefined; + } + }; + /** + * Map the data format names of the "clipData" to Flash-friendly names. + * + * @returns A new transformed object. + * @private + */ + var _mapClipDataToFlash = function (clipData) { + var newClipData = {}, formatMap = {}; + if (!(typeof clipData === "object" && clipData)) { + return; + } + for (var dataFormat in clipData) { + if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) { + switch (dataFormat.toLowerCase()) { + case "text/plain": + case "text": + case "air:text": + case "flash:text": + newClipData.text = clipData[dataFormat]; + formatMap.text = dataFormat; + break; + + case "text/html": + case "html": + case "air:html": + case "flash:html": + newClipData.html = clipData[dataFormat]; + formatMap.html = dataFormat; + break; + + case "application/rtf": + case "text/rtf": + case "rtf": + case "richtext": + case "air:rtf": + case "flash:rtf": + newClipData.rtf = clipData[dataFormat]; + formatMap.rtf = dataFormat; + break; + + default: + break; + } + } + } + return { + data: newClipData, + formatMap: formatMap + }; + }; + /** + * Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping). + * + * @returns A new transformed object. + * @private + */ + var _mapClipResultsFromFlash = function (clipResults, formatMap) { + if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) { + return clipResults; + } + var newResults = {}; + for (var prop in clipResults) { + if (_hasOwn.call(clipResults, prop)) { + if (prop === "errors") { + newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : []; + for (var i = 0, len = newResults[prop].length; i < len; i++) { + newResults[prop][i].format = formatMap[newResults[prop][i].format]; + } + } else if (prop !== "success" && prop !== "data") { + newResults[prop] = clipResults[prop]; + } else { + newResults[prop] = {}; + var tmpHash = clipResults[prop]; + for (var dataFormat in tmpHash) { + if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) { + newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat]; + } + } + } + } + } + return newResults; + }; + /** + * Will look at a path, and will create a "?noCache={time}" or "&noCache={time}" + * query param string to return. Does NOT append that string to the original path. + * This is useful because ExternalInterface often breaks when a Flash SWF is cached. + * + * @returns The `noCache` query param with necessary "?"/"&" prefix. + * @private + */ + var _cacheBust = function (path, options) { + var cacheBust = options == null || options && options.cacheBust === true; + if (cacheBust) { + return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now(); + } else { + return ""; + } + }; + /** + * Creates a query string for the FlashVars param. + * Does NOT include the cache-busting query param. + * + * @returns FlashVars query string + * @private + */ + var _vars = function (options) { + var i, len, domain, domains, str = "", trustedOriginsExpanded = []; + if (options.trustedDomains) { + if (typeof options.trustedDomains === "string") { + domains = [options.trustedDomains]; + } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) { + domains = options.trustedDomains; + } + } + if (domains && domains.length) { + for (i = 0, len = domains.length; i < len; i++) { + if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") { + domain = _extractDomain(domains[i]); + if (!domain) { + continue; + } + if (domain === "*") { + trustedOriginsExpanded.length = 0; + trustedOriginsExpanded.push(domain); + break; + } + trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [domain, "//" + domain, _window.location.protocol + "//" + domain]); + } + } + } + if (trustedOriginsExpanded.length) { + str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(",")); + } + if (options.forceEnhancedClipboard === true) { + str += (str ? "&" : "") + "forceEnhancedClipboard=true"; + } + if (typeof options.swfObjectId === "string" && options.swfObjectId) { + str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId); + } + if (typeof options.jsVersion === "string" && options.jsVersion) { + str += (str ? "&" : "") + "jsVersion=" + _encodeURIComponent(options.jsVersion); + } + return str; + }; + /** + * Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or + * URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/"). + * + * @returns the domain + * @private + */ + var _extractDomain = function(originOrUrl) { + if (originOrUrl == null || originOrUrl === "") { + return null; + } + originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, ""); + if (originOrUrl === "") { + return null; + } + var protocolIndex = originOrUrl.indexOf("//"); + originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2); + var pathIndex = originOrUrl.indexOf("/"); + originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex); + if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") { + return null; + } + return originOrUrl || null; + }; + /** + * Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`. + * + * @returns The appropriate script access level. + * @private + */ + var _determineScriptAccess = function() { + var _extractAllDomains = function (origins) { + var i, len, tmp, resultsArray = []; + if (typeof origins === "string") { + origins = [origins]; + } + if (!(typeof origins === "object" && origins && typeof origins.length === "number")) { + return resultsArray; + } + for (i = 0, len = origins.length; i < len; i++) { + if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) { + if (tmp === "*") { + resultsArray.length = 0; + resultsArray.push("*"); + break; + } + if (resultsArray.indexOf(tmp) === -1) { + resultsArray.push(tmp); + } + } + } + return resultsArray; + }; + return function(currentDomain, configOptions) { + var swfDomain = _extractDomain(configOptions.swfPath); + if (swfDomain === null) { + swfDomain = currentDomain; + } + var trustedDomains = _extractAllDomains(configOptions.trustedDomains); + var len = trustedDomains.length; + if (len > 0) { + if (len === 1 && trustedDomains[0] === "*") { + return "always"; + } + if (trustedDomains.indexOf(currentDomain) !== -1) { + if (len === 1 && currentDomain === swfDomain) { + return "sameDomain"; + } + return "always"; + } + } + return "never"; + }; + }(); + /** + * Get the currently active/focused DOM element. + * + * @returns the currently active/focused element, or `null` + * @private + */ + var _safeActiveElement = function () { + try { + return _document.activeElement; + } catch (err) { + return null; + } + }; + /** + * Add a class to an element, if it doesn't already have it. + * + * @returns The element, with its new class added. + * @private + */ + var _addClass = function (element, value) { + var c, cl, className, classNames = []; + if (typeof value === "string" && value) { + classNames = value.split(/\s+/); + } + if (element && element.nodeType === 1 && classNames.length > 0) { + if (element.classList) { + for (c = 0, cl = classNames.length; c < cl; c++) { + element.classList.add(classNames[c]); + } + } else if (element.hasOwnProperty("className")) { + className = " " + element.className + " "; + for (c = 0, cl = classNames.length; c < cl; c++) { + if (className.indexOf(" " + classNames[c] + " ") === -1) { + className += classNames[c] + " "; + } + } + element.className = className.replace(/^\s+|\s+$/g, ""); + } + } + return element; + }; + /** + * Remove a class from an element, if it has it. + * + * @returns The element, with its class removed. + * @private + */ + var _removeClass = function (element, value) { + var c, cl, className, classNames = []; + if (typeof value === "string" && value) { + classNames = value.split(/\s+/); + } + if (element && element.nodeType === 1 && classNames.length > 0) { + if (element.classList && element.classList.length > 0) { + for (c = 0, cl = classNames.length; c < cl; c++) { + element.classList.remove(classNames[c]); + } + } else if (element.className) { + className = (" " + element.className + " ").replace(/[\r\n\t]/g, " "); + for (c = 0, cl = classNames.length; c < cl; c++) { + className = className.replace(" " + classNames[c] + " ", " "); + } + element.className = className.replace(/^\s+|\s+$/g, ""); + } + } + return element; + }; + /** + * Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`, + * then we assume that it should be a hand ("pointer") cursor if the element + * is an anchor element ("a" tag). + * + * @returns The computed style property. + * @private + */ + var _getStyle = function (el, prop) { + var value = _getComputedStyle(el, null).getPropertyValue(prop); + if (prop === "cursor") { + if (!value || value === "auto") { + if (el.nodeName === "A") { + return "pointer"; + } + } + } + return value; + }; + /** + * Get the absolutely positioned coordinates of a DOM element. + * + * @returns Object containing the element's position, width, and height. + * @private + */ + var _getElementPosition = function (el) { + var pos = { + left: 0, + top: 0, + width: 0, + height: 0 + }; + if (el.getBoundingClientRect) { + var elRect = el.getBoundingClientRect(); + var pageXOffset = _window.pageXOffset; + var pageYOffset = _window.pageYOffset; + var leftBorderWidth = _document.documentElement.clientLeft || 0; + var topBorderWidth = _document.documentElement.clientTop || 0; + var leftBodyOffset = 0; + var topBodyOffset = 0; + if (_getStyle(_document.body, "position") === "relative") { + var bodyRect = _document.body.getBoundingClientRect(); + var htmlRect = _document.documentElement.getBoundingClientRect(); + leftBodyOffset = bodyRect.left - htmlRect.left || 0; + topBodyOffset = bodyRect.top - htmlRect.top || 0; + } + pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset; + pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset; + pos.width = "width" in elRect ? elRect.width : elRect.right - elRect.left; + pos.height = "height" in elRect ? elRect.height : elRect.bottom - elRect.top; + } + return pos; + }; + /** + * Determine is an element is visible somewhere within the document (page). + * + * @returns Boolean + * @private + */ + var _isElementVisible = function (el) { + if (!el) { + return false; + } + var styles = _getComputedStyle(el, null); + var hasCssHeight = _parseFloat(styles.height) > 0; + var hasCssWidth = _parseFloat(styles.width) > 0; + var hasCssTop = _parseFloat(styles.top) >= 0; + var hasCssLeft = _parseFloat(styles.left) >= 0; + var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft; + var rect = cssKnows ? null : _getElementPosition(el); + var isVisible = styles.display !== "none" && styles.visibility !== "collapse" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0)); + return isVisible; + }; + /** + * Clear all existing timeouts and interval polling delegates. + * + * @returns `undefined` + * @private + */ + var _clearTimeoutsAndPolling = function () { + _clearTimeout(_flashCheckTimeout); + _flashCheckTimeout = 0; + _clearInterval(_swfFallbackCheckInterval); + _swfFallbackCheckInterval = 0; + }; + /** + * Reposition the Flash object to cover the currently activated element. + * + * @returns `undefined` + * @private + */ + var _reposition = function () { + var htmlBridge; + if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) { + var pos = _getElementPosition(_currentElement); + _extend(htmlBridge.style, { + width: pos.width + "px", + height: pos.height + "px", + top: pos.top + "px", + left: pos.left + "px", + zIndex: "" + _getSafeZIndex(_globalConfig.zIndex) + }); + } + }; + /** + * Sends a signal to the Flash object to display the hand cursor if `true`. + * + * @returns `undefined` + * @private + */ + var _setHandCursor = function(enabled) { + if (_flashState.ready === true) { + if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") { + _flashState.bridge.setHandCursor(enabled); + } else { + _flashState.ready = false; + } + } + }; + /** + * Get a safe value for `zIndex` + * + * @returns an integer, or "auto" + * @private + */ + var _getSafeZIndex = function (val) { + if (/^(?:auto|inherit)$/.test(val)) { + return val; + } + var zIndex; + if (typeof val === "number" && !_isNaN(val)) { + zIndex = val; + } else if (typeof val === "string") { + zIndex = _getSafeZIndex(_parseInt(val, 10)); + } + return typeof zIndex === "number" ? zIndex : "auto"; + }; + /** + * Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe. + * If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water. + * + * @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html} + * @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511} + * @see {@link http://zeroclipboard.org/test-iframes.html} + * + * @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain) + * @private + */ + var _detectSandbox = function (doNotReassessFlashSupport) { + var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null; + doNotReassessFlashSupport = doNotReassessFlashSupport === true; + if (_pageIsFramed === false) { + isSandboxed = false; + } else { + try { + frame = window.frameElement || null; + } catch (e) { + frameError = { + name: e.name, + message: e.message + }; + } + if (frame && frame.nodeType === 1 && frame.nodeName === "IFRAME") { + try { + isSandboxed = frame.hasAttribute("sandbox"); + } catch (e) { + isSandboxed = null; + } + } else { + try { + effectiveScriptOrigin = document.domain || null; + } catch (e) { + effectiveScriptOrigin = null; + } + if (effectiveScriptOrigin === null || frameError && frameError.name === "SecurityError" && /(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(frameError.message.toLowerCase())) { + isSandboxed = true; + } + } + } + _flashState.sandboxed = isSandboxed; + if (previousState !== isSandboxed && !doNotReassessFlashSupport) { + _detectFlashSupport(_ActiveXObject); + } + return isSandboxed; + }; + /** + * Detect the Flash Player status, version, and plugin type. + * + * @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code} + * @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript} + * + * @returns `undefined` + * @private + */ + var _detectFlashSupport = function (ActiveXObject) { + var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = ""; + + /** + * Derived from Apple's suggested sniffer. + * @param {String} desc e.g. "Shockwave Flash 7.0 r61" + * @returns {String} "7.0.61" + * @private + */ + function parseFlashVersion(desc) { + var matches = desc.match(/[\d]+/g); + matches.length = 3; + return matches.join("."); + } + + function isPepperFlash(flashPlayerFileName) { + return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin"); + } + + function inspectPlugin(plugin) { + if (plugin) { + hasFlash = true; + if (plugin.version) { + flashVersion = parseFlashVersion(plugin.version); + } + if (!flashVersion && plugin.description) { + flashVersion = parseFlashVersion(plugin.description); + } + if (plugin.filename) { + isPPAPI = isPepperFlash(plugin.filename); + } + } + } + + if (_navigator.plugins && _navigator.plugins.length) { + plugin = _navigator.plugins["Shockwave Flash"]; + inspectPlugin(plugin); + if (_navigator.plugins["Shockwave Flash 2.0"]) { + hasFlash = true; + flashVersion = "2.0.0.11"; + } + } else if (_navigator.mimeTypes && _navigator.mimeTypes.length) { + mimeType = _navigator.mimeTypes["application/x-shockwave-flash"]; + plugin = mimeType && mimeType.enabledPlugin; + inspectPlugin(plugin); + } else if (typeof ActiveXObject !== "undefined") { + isActiveX = true; + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); + hasFlash = true; + flashVersion = parseFlashVersion(ax.GetVariable("$version")); + } catch (e1) { + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); + hasFlash = true; + flashVersion = "6.0.21"; + } catch (e2) { + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + hasFlash = true; + flashVersion = parseFlashVersion(ax.GetVariable("$version")); + } catch (e3) { + isActiveX = false; + } + } + } + } + _flashState.disabled = hasFlash !== true; + _flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion); + _flashState.version = flashVersion || "0.0.0"; + _flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown"; + }; + /** + * Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later. + */ + _detectFlashSupport(_ActiveXObject); + /** + * Always assess the `sandboxed` state of the page at important Flash-related moments. + */ + _detectSandbox(true); + /** + * A shell constructor for `ZeroClipboard` client instances. + * + * @constructor + */ + var ZeroClipboard = function () { + if (!(this instanceof ZeroClipboard)) { + return new ZeroClipboard(); + } + if (typeof ZeroClipboard._createClient === "function") { + ZeroClipboard._createClient.apply(this, _args(arguments)); + } + }; + /** + * The ZeroClipboard library's version number. + * + * @static + * @readonly + * @property {string} + */ + _defineProperty(ZeroClipboard, "version", { + value: "2.2.0", + writable: false, + configurable: true, + enumerable: true + }); + /** + * Update or get a copy of the ZeroClipboard global configuration. + * Returns a copy of the current/updated configuration. + * + * @returns Object + * @static + */ + ZeroClipboard.config = function () { + return _config.apply(this, _args(arguments)); + }; + /** + * Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard. + * + * @returns Object + * @static + */ + ZeroClipboard.state = function () { + return _state.apply(this, _args(arguments)); + }; + /** + * Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc. + * + * @returns Boolean + * @static + */ + ZeroClipboard.isFlashUnusable = function () { + return _isFlashUnusable.apply(this, _args(arguments)); + }; + /** + * Register an event listener. + * + * @returns `ZeroClipboard` + * @static + */ + ZeroClipboard.on = function () { + return _on.apply(this, _args(arguments)); + }; + /** + * Unregister an event listener. + * If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`. + * If no `eventType` is provided, it will unregister all listeners for every event type. + * + * @returns `ZeroClipboard` + * @static + */ + ZeroClipboard.off = function () { + return _off.apply(this, _args(arguments)); + }; + /** + * Retrieve event listeners for an `eventType`. + * If no `eventType` is provided, it will retrieve all listeners for every event type. + * + * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null` + */ + ZeroClipboard.handlers = function () { + return _listeners.apply(this, _args(arguments)); + }; + /** + * Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners. + * + * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`. + * @static + */ + ZeroClipboard.emit = function () { + return _emit.apply(this, _args(arguments)); + }; + /** + * Create and embed the Flash object. + * + * @returns The Flash object + * @static + */ + ZeroClipboard.create = function () { + return _create.apply(this, _args(arguments)); + }; + /** + * Self-destruct and clean up everything, including the embedded Flash object. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.destroy = function() { + return _destroy.apply(this, _args(arguments)); + }; + /** + * Set the pending data for clipboard injection. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.setData = function () { + return _setData.apply(this, _args(arguments)); + }; + /** + * Clear the pending data for clipboard injection. + * If no `format` is provided, all pending data formats will be cleared. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.clearData = function () { + return _clearData.apply(this, _args(arguments)); + }; + /** + * Get a copy of the pending data for clipboard injection. + * If no `format` is provided, a copy of ALL pending data formats will be returned. + * + * @returns `String` or `Object` + * @static + */ + ZeroClipboard.getData = function () { + return _getData.apply(this, _args(arguments)); + }; + /** + * Sets the current HTML object that the Flash object should overlay. This will put the global + * Flash object on top of the current element; depending on the setup, this may also set the + * pending clipboard text data as well as the Flash object's wrapping element's title attribute + * based on the underlying HTML element and ZeroClipboard configuration. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.focus = ZeroClipboard.activate = function () { + return _focus.apply(this, _args(arguments)); + }; + /** + * Un-overlays the Flash object. This will put the global Flash object off-screen; depending on + * the setup, this may also unset the Flash object's wrapping element's title attribute based on + * the underlying HTML element and ZeroClipboard configuration. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.blur = ZeroClipboard.deactivate = function () { + return _blur.apply(this, _args(arguments)); + }; + /** + * Returns the currently focused/"activated" HTML element that the Flash object is wrapping. + * + * @returns `HTMLElement` or `null` + * @static + */ + ZeroClipboard.activeElement = function () { + return _activeElement.apply(this, _args(arguments)); + }; + /** + * Keep track of the ZeroClipboard client instance counter. + */ + var _clientIdCounter = 0; + /** + * Keep track of the state of the client instances. + * + * Entry structure: + * _clientMeta[client.id] = { + * instance: client, + * elements: [], + * handlers: {} + * }; + */ + var _clientMeta = {}; + /** + * Keep track of the ZeroClipboard clipped elements counter. + */ + var _elementIdCounter = 0; + /** + * Keep track of the state of the clipped element relationships to clients. + * + * Entry structure: + * _elementMeta[element.zcClippingId] = [client1.id, client2.id]; + */ + var _elementMeta = {}; + /** + * Keep track of the state of the mouse event handlers for clipped elements. + * + * Entry structure: + * _mouseHandlers[element.zcClippingId] = { + * mouseover: function(event) {}, + * mouseout: function(event) {}, + * mouseenter: function(event) {}, + * mouseleave: function(event) {}, + * mousemove: function(event) {} + * }; + */ + var _mouseHandlers = {}; + /** + * Extending the ZeroClipboard configuration defaults for the Client module. + */ + _extend(_globalConfig, { + autoActivate: true + }); + /** + * The real constructor for `ZeroClipboard` client instances. + * @private + */ + var _clientConstructor = function (elements) { + var client = this; + client.id = "" + _clientIdCounter++; + _clientMeta[client.id] = { + instance: client, + elements: [], + handlers: {} + }; + if (elements) { + client.clip(elements); + } + ZeroClipboard.on("*", function (event) { + return client.emit(event); + }); + ZeroClipboard.on("destroy", function () { + client.destroy(); + }); + ZeroClipboard.create(); + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.on`. + * @private + */ + var _clientOn = function (eventType, listener) { + var i, len, events, added = {}, meta = _clientMeta[this.id], handlers = meta && meta.handlers; + if (!meta) { + throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance"); + } + if (typeof eventType === "string" && eventType) { + events = eventType.toLowerCase().split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + this.on(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].replace(/^on/, ""); + added[eventType] = true; + if (!handlers[eventType]) { + handlers[eventType] = []; + } + handlers[eventType].push(listener); + } + if (added.ready && _flashState.ready) { + this.emit({ + type: "ready", + client: this + }); + } + if (added.error) { + for (i = 0, len = _flashStateErrorNames.length; i < len; i++) { + if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")]) { + this.emit({ + type: "error", + name: _flashStateErrorNames[i], + client: this + }); + break; + } + } + if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) { + this.emit({ + type: "error", + name: "version-mismatch", + jsVersion: ZeroClipboard.version, + swfVersion: _zcSwfVersion + }); + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.off`. + * @private + */ + var _clientOff = function (eventType, listener) { + var i, len, foundIndex, events, perEventHandlers, meta = _clientMeta[this.id], handlers = meta && meta.handlers; + if (!handlers) { + return this; + } + if (arguments.length === 0) { + events = _keys(handlers); + } else if (typeof eventType === "string" && eventType) { + events = eventType.split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + this.off(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].toLowerCase().replace(/^on/, ""); + perEventHandlers = handlers[eventType]; + if (perEventHandlers && perEventHandlers.length) { + if (listener) { + foundIndex = perEventHandlers.indexOf(listener); + while (foundIndex !== -1) { + perEventHandlers.splice(foundIndex, 1); + foundIndex = perEventHandlers.indexOf(listener, foundIndex); + } + } else { + perEventHandlers.length = 0; + } + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.handlers`. + * @private + */ + var _clientListeners = function (eventType) { + var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers; + if (handlers) { + if (typeof eventType === "string" && eventType) { + copy = handlers[eventType] ? handlers[eventType].slice(0) : []; + } else { + copy = _deepCopy(handlers); + } + } + return copy; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.emit`. + * @private + */ + var _clientEmit = function (event) { + if (_clientShouldEmit.call(this, event)) { + if (typeof event === "object" && event && typeof event.type === "string" && event.type) { + event = _extend({}, event); + } + var eventCopy = _extend({}, _createEvent(event), { + client: this + }); + _clientDispatchCallbacks.call(this, eventCopy); + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.clip`. + * @private + */ + var _clientClip = function (elements) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance"); + } + elements = _prepClip(elements); + for (var i = 0; i < elements.length; i++) { + if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) { + if (!elements[i].zcClippingId) { + elements[i].zcClippingId = "zcClippingId_" + _elementIdCounter++; + _elementMeta[elements[i].zcClippingId] = [this.id]; + if (_globalConfig.autoActivate === true) { + _addMouseHandlers(elements[i]); + } + } else if (_elementMeta[elements[i].zcClippingId].indexOf(this.id) === -1) { + _elementMeta[elements[i].zcClippingId].push(this.id); + } + var clippedElements = _clientMeta[this.id] && _clientMeta[this.id].elements; + if (clippedElements.indexOf(elements[i]) === -1) { + clippedElements.push(elements[i]); + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.unclip`. + * @private + */ + var _clientUnclip = function (elements) { + var meta = _clientMeta[this.id]; + if (!meta) { + return this; + } + var clippedElements = meta.elements; + var arrayIndex; + if (typeof elements === "undefined") { + elements = clippedElements.slice(0); + } else { + elements = _prepClip(elements); + } + for (var i = elements.length; i--;) { + if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) { + arrayIndex = 0; + while ((arrayIndex = clippedElements.indexOf(elements[i], arrayIndex)) !== -1) { + clippedElements.splice(arrayIndex, 1); + } + var clientIds = _elementMeta[elements[i].zcClippingId]; + if (clientIds) { + arrayIndex = 0; + while ((arrayIndex = clientIds.indexOf(this.id, arrayIndex)) !== -1) { + clientIds.splice(arrayIndex, 1); + } + if (clientIds.length === 0) { + if (_globalConfig.autoActivate === true) { + _removeMouseHandlers(elements[i]); + } + delete elements[i].zcClippingId; + } + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.elements`. + * @private + */ + var _clientElements = function () { + var meta = _clientMeta[this.id]; + return meta && meta.elements ? meta.elements.slice(0) : []; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.destroy`. + * @private + */ + var _clientDestroy = function () { + if (!_clientMeta[this.id]) { + return; + } + this.unclip(); + this.off(); + delete _clientMeta[this.id]; + }; + /** + * Inspect an Event to see if the Client (`this`) should honor it for emission. + * @private + */ + var _clientShouldEmit = function (event) { + if (!(event && event.type)) { + return false; + } + if (event.client && event.client !== this) { + return false; + } + var meta = _clientMeta[this.id]; + var clippedEls = meta && meta.elements; + var hasClippedEls = !!clippedEls && clippedEls.length > 0; + var goodTarget = !event.target || hasClippedEls && clippedEls.indexOf(event.target) !== -1; + var goodRelTarget = event.relatedTarget && hasClippedEls && clippedEls.indexOf(event.relatedTarget) !== -1; + var goodClient = event.client && event.client === this; + if (!meta || !(goodTarget || goodRelTarget || goodClient)) { + return false; + } + return true; + }; + /** + * Handle the actual dispatching of events to a client instance. + * + * @returns `undefined` + * @private + */ + var _clientDispatchCallbacks = function (event) { + var meta = _clientMeta[this.id]; + if (!(typeof event === "object" && event && event.type && meta)) { + return; + } + var async = _shouldPerformAsync(event); + var wildcardTypeHandlers = meta && meta.handlers["*"] || []; + var specificTypeHandlers = meta && meta.handlers[event.type] || []; + var handlers = wildcardTypeHandlers.concat(specificTypeHandlers); + if (handlers && handlers.length) { + var i, len, func, context, eventCopy, originalContext = this; + for (i = 0, len = handlers.length; i < len; i++) { + func = handlers[i]; + context = originalContext; + if (typeof func === "string" && typeof _window[func] === "function") { + func = _window[func]; + } + if (typeof func === "object" && func && typeof func.handleEvent === "function") { + context = func; + func = func.handleEvent; + } + if (typeof func === "function") { + eventCopy = _extend({}, event); + _dispatchCallback(func, context, [eventCopy], async); + } + } + } + }; + /** + * Prepares the elements for clipping/unclipping. + * + * @returns An Array of elements. + * @private + */ + var _prepClip = function (elements) { + if (typeof elements === "string") { + elements = []; + } + return typeof elements.length !== "number" ? [elements] : elements; + }; + /** + * Add a `mouseover` handler function for a clipped element. + * + * @returns `undefined` + * @private + */ + var _addMouseHandlers = function (element) { + if (!(element && element.nodeType === 1)) { + return; + } + var _suppressMouseEvents = function (event) { + if (!(event || (event = _window.event))) { + return; + } + if (event._source !== "js") { + event.stopImmediatePropagation(); + event.preventDefault(); + } + delete event._source; + }; + var _elementMouseOver = function (event) { + if (!(event || (event = _window.event))) { + return; + } + _suppressMouseEvents(event); + ZeroClipboard.focus(element); + }; + element.addEventListener("mouseover", _elementMouseOver, false); + element.addEventListener("mouseout", _suppressMouseEvents, false); + element.addEventListener("mouseenter", _suppressMouseEvents, false); + element.addEventListener("mouseleave", _suppressMouseEvents, false); + element.addEventListener("mousemove", _suppressMouseEvents, false); + _mouseHandlers[element.zcClippingId] = { + mouseover: _elementMouseOver, + mouseout: _suppressMouseEvents, + mouseenter: _suppressMouseEvents, + mouseleave: _suppressMouseEvents, + mousemove: _suppressMouseEvents + }; + }; + /** + * Remove a `mouseover` handler function for a clipped element. + * + * @returns `undefined` + * @private + */ + var _removeMouseHandlers = function (element) { + if (!(element && element.nodeType === 1)) { + return; + } + var mouseHandlers = _mouseHandlers[element.zcClippingId]; + if (!(typeof mouseHandlers === "object" && mouseHandlers)) { + return; + } + var key, val, mouseEvents = ["move", "leave", "enter", "out", "over"]; + for (var i = 0, len = mouseEvents.length; i < len; i++) { + key = "mouse" + mouseEvents[i]; + val = mouseHandlers[key]; + if (typeof val === "function") { + element.removeEventListener(key, val, false); + } + } + delete _mouseHandlers[element.zcClippingId]; + }; + /** + * Creates a new ZeroClipboard client instance. + * Optionally, auto-`clip` an element or collection of elements. + * + * @constructor + */ + ZeroClipboard._createClient = function () { + _clientConstructor.apply(this, _args(arguments)); + }; + /** + * Register an event listener to the client. + * + * @returns `this` + */ + ZeroClipboard.prototype.on = function () { + return _clientOn.apply(this, _args(arguments)); + }; + /** + * Unregister an event handler from the client. + * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. + * If no `eventType` is provided, it will unregister all handlers for every event type. + * + * @returns `this` + */ + ZeroClipboard.prototype.off = function () { + return _clientOff.apply(this, _args(arguments)); + }; + /** + * Retrieve event listeners for an `eventType` from the client. + * If no `eventType` is provided, it will retrieve all listeners for every event type. + * + * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null` + */ + ZeroClipboard.prototype.handlers = function () { + return _clientListeners.apply(this, _args(arguments)); + }; + /** + * Event emission receiver from the Flash object for this client's registered JavaScript event listeners. + * + * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`. + */ + ZeroClipboard.prototype.emit = function () { + return _clientEmit.apply(this, _args(arguments)); + }; + /** + * Register clipboard actions for new element(s) to the client. + * + * @returns `this` + */ + ZeroClipboard.prototype.clip = function () { + return _clientClip.apply(this, _args(arguments)); + }; + /** + * Unregister the clipboard actions of previously registered element(s) on the page. + * If no elements are provided, ALL registered elements will be unregistered. + * + * @returns `this` + */ + ZeroClipboard.prototype.unclip = function () { + return _clientUnclip.apply(this, _args(arguments)); + }; + /** + * Get all of the elements to which this client is clipped. + * + * @returns array of clipped elements + */ + ZeroClipboard.prototype.elements = function () { + return _clientElements.apply(this, _args(arguments)); + }; + /** + * Self-destruct and clean up everything for a single client. + * This will NOT destroy the embedded Flash object. + * + * @returns `undefined` + */ + ZeroClipboard.prototype.destroy = function () { + return _clientDestroy.apply(this, _args(arguments)); + }; + /** + * Stores the pending plain text to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setText = function (text) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("text/plain", text); + return this; + }; + /** + * Stores the pending HTML text to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setHtml = function (html) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("text/html", html); + return this; + }; + /** + * Stores the pending rich text (RTF) to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setRichText = function (richText) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("application/rtf", richText); + return this; + }; + /** + * Stores the pending data to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setData = function () { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData.apply(this, _args(arguments)); + return this; + }; + /** + * Clears the pending data to inject into the clipboard. + * If no `format` is provided, all pending data formats will be cleared. + * + * @returns `this` + */ + ZeroClipboard.prototype.clearData = function () { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.clearData.apply(this, _args(arguments)); + return this; + }; + /** + * Gets a copy of the pending data to inject into the clipboard. + * If no `format` is provided, a copy of ALL pending data formats will be returned. + * + * @returns `String` or `Object` + */ + ZeroClipboard.prototype.getData = function () { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance"); + } + return ZeroClipboard.getData.apply(this, _args(arguments)); + }; + if (typeof define === "function" && define.amd) { + define(function () { + return ZeroClipboard; + }); + } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) { + module.exports = ZeroClipboard; + } else { + window.ZeroClipboard = ZeroClipboard; + } +})(function () { + return this || window; +}()); \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zero_clipboard.swf b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zero_clipboard.swf new file mode 100644 index 0000000..8bad6a3 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zero_clipboard.swf differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zeroclip.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zeroclip.js new file mode 100644 index 0000000..d11004d --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/installedPlugins/sense/public/webpackShims/zeroclip/zeroclip.js @@ -0,0 +1,8 @@ +var ZeroClipboard = require('./zero_clipboard.js'); + +ZeroClipboard.config({ + swfPath: require('file!./zero_clipboard.swf'), + debug: false +}); + +module.exports = ZeroClipboard; diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/.babelcache.json b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/.babelcache.json new file mode 100644 index 0000000..e6f0ba0 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/.babelcache.json @@ -0,0 +1,1884 @@ +{ + "{\"filename\":\"/Users/gillyb/dev/sense/installedPlugins/sense/index.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (kibana) {\n var _require = require('path');\n\n var resolve = _require.resolve;\n var join = _require.join;\n var sep = _require.sep;\n\n var Joi = require('joi');\n var Boom = require('boom');\n var modules = resolve(__dirname, 'public/webpackShims/');\n var src = resolve(__dirname, 'public/src/');\n\n var _require2 = require('fs');\n\n var existsSync = _require2.existsSync;\n\n var _require3 = require('lodash');\n\n var startsWith = _require3.startsWith;\n var endsWith = _require3.endsWith;\n\n var apps = [{\n title: 'Sense',\n description: 'JSON aware developer\\'s interface to ElasticSearch',\n icon: 'plugins/sense/bonsai.png',\n main: 'plugins/sense/sense',\n autoload: kibana.autoload.styles,\n injectVars: function injectVars(server, options) {\n return options;\n }\n }];\n\n if (existsSync(resolve(__dirname, 'public/tests'))) {\n apps.push({\n title: 'Sense Tests',\n id: 'sense-tests',\n main: 'plugins/sense/tests',\n hidden: true\n //listed: false // uncomment after https://github.com/elastic/kibana/pull/4755\n });\n }\n\n return new kibana.Plugin({\n id: 'sense',\n\n config: function config(Joi) {\n return Joi.object({\n enabled: Joi.boolean()['default'](true),\n defaultServerUrl: Joi.string()['default']('http://localhost:9200'),\n proxyFilter: Joi.array().items(Joi.string()).single()['default'](['.*'])\n })['default']();\n },\n\n init: function init(server, options) {\n var filters = options.proxyFilter.map(function (str) {\n return new RegExp(str);\n });\n\n // http://hapijs.com/api/8.8.1#route-configuration\n server.route({\n path: '/api/sense/proxy',\n method: ['*', 'GET'],\n config: {\n handler: {\n proxy: {\n mapUri: function mapUri(req, cb) {\n var uri = req.query.uri;\n\n if (!uri) {\n cb(Boom.badRequest('URI is a required param.'));\n return;\n }\n\n if (!filters.some(function (re) {\n return re.test(uri);\n })) {\n var err = Boom.forbidden();\n err.output.payload = \"Error connecting to '\" + uri + \"':\\n\\nUnable to send requests to that url.\";\n err.output.headers['content-type'] = 'text/plain';\n cb(err);\n return;\n }\n\n cb(null, uri);\n },\n passThrough: true,\n xforward: true,\n onResponse: function onResponse(err, res, request, reply, settings, ttl) {\n if (err != null) {\n reply(\"Error connecting to '\" + request.query.uri + \"':\\n\\n\" + err.message).type(\"text/plain\").statusCode = 502;\n } else {\n reply(null, res);\n }\n }\n }\n }\n }\n });\n\n server.route({\n path: '/api/sense/api_server',\n method: ['GET', 'POST'],\n handler: function handler(req, reply) {\n var server = require('./api_server/server');\n var _req$query = req.query;\n var sense_version = _req$query.sense_version;\n var apis = _req$query.apis;\n\n if (!apis) {\n reply(Boom.badRequest('\"apis\" is a required param.'));\n return;\n }\n\n return server.resolveApi(sense_version, apis.split(\",\"), reply);\n }\n });\n\n var testApp = kibana.uiExports.apps.hidden.byId['sense-tests'];\n if (testApp) {\n server.route({\n path: '/app/sense-tests',\n method: 'GET',\n handler: function handler(req, reply) {\n return reply.renderApp(testApp);\n }\n });\n }\n },\n\n uiExports: {\n apps: apps,\n\n noParse: [join(modules, 'ace' + sep), join(modules, 'moment_src/moment' + sep), join(src, 'sense_editor/mode/worker.js')]\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2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VybiBKb2kub2JqZWN0KHtcbiAgICAgICAgZW5hYmxlZDogSm9pLmJvb2xlYW4oKS5kZWZhdWx0KHRydWUpLFxuICAgICAgICBkZWZhdWx0U2VydmVyVXJsOiBKb2kuc3RyaW5nKCkuZGVmYXVsdCgnaHR0cDovL2xvY2FsaG9zdDo5MjAwJyksXG4gICAgICAgIHByb3h5RmlsdGVyOiBKb2kuYXJyYXkoKS5pdGVtcyhKb2kuc3RyaW5nKCkpLnNpbmdsZSgpLmRlZmF1bHQoWycuKiddKSxcbiAgICAgIH0pLmRlZmF1bHQoKTtcbiAgICB9LFxuXG4gICAgaW5pdDogZnVuY3Rpb24gKHNlcnZlciwgb3B0aW9ucykge1xuICAgICAgY29uc3QgZmlsdGVycyA9IG9wdGlvbnMucHJveHlGaWx0ZXIubWFwKHN0ciA9PiBuZXcgUmVnRXhwKHN0cikpO1xuXG4gICAgICAvLyBodHRwOi8vaGFwaWpzLmNvbS9hcGkvOC44LjEjcm91dGUtY29uZmlndXJhdGlvblxuICAgICAgc2VydmVyLnJvdXRlKHtcbiAgICAgICAgcGF0aDogJy9hcGkvc2Vuc2UvcHJveHknLFxuICAgICAgICBtZXRob2Q6IFsnKicsICdHRVQnXSxcbiAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgaGFuZGxlcjoge1xuICAgICAgICAgICAgcHJveHk6IHtcbiAgICAgICAgICAgICAgbWFwVXJpOiBmdW5jdGlvbiAocmVxLCBjYikge1xuICAgICAgICAgICAgICAgIGxldCB7IHVyaSB9ID0gcmVxLnF1ZXJ5O1xuICAgICAgICAgICAgICAgIGlmICghdXJpKSB7XG4gICAgICAgICAgICAgICAgICBjYihCb29tLmJhZFJlcXVlc3QoJ1VSSSBpcyBhIHJlcXVpcmVkIHBhcmFtLicpKTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoIWZpbHRlcnMuc29tZShyZSA9PiByZS50ZXN0KHVyaSkpKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdCBlcnIgPSBCb29tLmZvcmJpZGRlbigpO1xuICAgICAgICAgICAgICAgICAgZXJyLm91dHB1dC5wYXlsb2FkID0gXCJFcnJvciBjb25uZWN0aW5nIHRvICdcIiArIHVyaSArIFwiJzpcXG5cXG5VbmFibGUgdG8gc2VuZCByZXF1ZXN0cyB0byB0aGF0IHVybC5cIjtcbiAgICAgICAgICAgICAgICAgIGVyci5vdXRwdXQuaGVhZGVyc1snY29udGVudC10eXBlJ10gPSAndGV4dC9wbGFpbic7XG4gICAgICAgICAgICAgICAgICBjYihlcnIpO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNiKG51bGwsIHVyaSk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHBhc3NUaHJvdWdoOiB0cnVlLFxuICAgICAgICAgICAgICB4Zm9yd2FyZDogdHJ1ZSxcbiAgICAgICAgICAgICAgb25SZXNwb25zZTogZnVuY3Rpb24gKGVyciwgcmVzLCByZXF1ZXN0LCByZXBseSwgc2V0dGluZ3MsIHR0bCkge1xuICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgcmVwbHkoXCJFcnJvciBjb25uZWN0aW5nIHRvICdcIiArIHJlcXVlc3QucXVlcnkudXJpICsgXCInOlxcblxcblwiICsgZXJyLm1lc3NhZ2UpLnR5cGUoXCJ0ZXh0L3BsYWluXCIpLnN0YXR1c0NvZGUgPSA1MDI7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHJlcGx5KG51bGwsIHJlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgc2VydmVyLnJvdXRlKHtcbiA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am9pbihtb2R1bGVzLCAnYWNlJyArIHNlcCksXG4gICAgICAgIGpvaW4obW9kdWxlcywgJ21vbWVudF9zcmMvbW9tZW50JyArIHNlcCksXG4gICAgICAgIGpvaW4oc3JjLCAnc2Vuc2VfZWRpdG9yL21vZGUvd29ya2VyLmpzJylcbiAgICAgIF1cbiAgICB9XG4gIH0pXG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sense/installedPlugins/sense/index.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,MAAM,EAAE;iBACJ,OAAO,CAAC,MAAM,CAAC;;MAAtC,OAAO,YAAP,OAAO;MAAE,IAAI,YAAJ,IAAI;MAAE,GAAG,YAAH,GAAG;;AACxB,MAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AACzB,MAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,MAAI,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AACzD,MAAI,GAAG,GAAG,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;;kBACvB,OAAO,CAAC,IAAI,CAAC;;MAA5B,UAAU,aAAV,UAAU;;kBACiB,OAAO,CAAC,QAAQ,CAAC;;MAA1C,UAAU,aAAV,UAAU;MAAE,QAAQ,aAAR,QAAQ;;AAE5B,MAAM,IAAI,GAAG,CACX;AACE,SAAK,EAAE,OAAO;AACd,eAAW,EAAE,oDAAoD;AACjE,QAAI,EAAE,0BAA0B;AAChC,QAAI,EAAE,qBAAqB;AAC3B,YAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;AAChC,cAAU,EAAE,oBAAU,MAAM,EAAE,OAAO,EAAE;AACrC,aAAO,OAAO,CAAC;KAChB;GACF,CACF,CAAC;;AAEF,MAAI,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,EAAE;AAClD,QAAI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;WACR;;AAED,iBAAO,MAAM,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;SACjE;OACF,CAAC,CAAC;;AAEH,UAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACjE,UAAI,OAAO,EAAE;AACX,cAAM,CAAC,KAAK,CAAC;AACX,cAAI,EAAE,kBAAkB;AACxB,gBAAM,EAAE,KAAK;AACb,iBAAO,EAAE,iBAAU,GAAG,EAAE,KAAK,EAAE;AAC7B,mBAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;WACjC;SACF,CAAC,CAAC;OACJ;KACF;;AAED,aAAS,EAAE;AACT,UAAI,EAAE,IAAI;;AAEV,aAAO,EAAE,CACP,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,GAAG,CAAC,EAC1B,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EACxC,IAAI,CAAC,GAAG,EAAE,6BAA6B,CAAC,CACzC;KACF;GACF,CAAC,CAAA;CACH,CAAC", + "file": "/Users/gillyb/dev/sense/installedPlugins/sense/index.js", + "sourcesContent": [ + "module.exports = function (kibana) {\n let { resolve, join, sep } = require('path');\n let Joi = require('joi');\n let Boom = require('boom');\n let modules = resolve(__dirname, 'public/webpackShims/');\n let src = resolve(__dirname, 'public/src/');\n let { existsSync } = require('fs');\n const { startsWith, endsWith } = require('lodash');\n\n const apps = [\n {\n title: 'Sense',\n description: 'JSON aware developer\\'s interface to ElasticSearch',\n icon: 'plugins/sense/bonsai.png',\n main: 'plugins/sense/sense',\n autoload: kibana.autoload.styles,\n injectVars: function (server, options) {\n return options;\n }\n }\n ];\n\n if (existsSync(resolve(__dirname, 'public/tests'))) {\n apps.push({\n title: 'Sense Tests',\n id: 'sense-tests',\n main: 'plugins/sense/tests',\n hidden: true\n //listed: false // uncomment after https://github.com/elastic/kibana/pull/4755\n });\n }\n\n return new kibana.Plugin({\n id: 'sense',\n\n config: function (Joi) {\n return Joi.object({\n enabled: Joi.boolean().default(true),\n defaultServerUrl: Joi.string().default('http://localhost:9200'),\n proxyFilter: Joi.array().items(Joi.string()).single().default(['.*']),\n }).default();\n },\n\n init: function (server, options) {\n const filters = options.proxyFilter.map(str => new RegExp(str));\n\n // http://hapijs.com/api/8.8.1#route-configuration\n server.route({\n path: '/api/sense/proxy',\n method: ['*', 'GET'],\n config: {\n handler: {\n proxy: {\n mapUri: function (req, cb) {\n let { uri } = req.query;\n if (!uri) {\n cb(Boom.badRequest('URI is a required param.'));\n return;\n }\n\n if (!filters.some(re => re.test(uri))) {\n const err = Boom.forbidden();\n err.output.payload = \"Error connecting to '\" + uri + \"':\\n\\nUnable to send requests to that url.\";\n err.output.headers['content-type'] = 'text/plain';\n cb(err);\n return;\n }\n\n cb(null, uri);\n },\n passThrough: true,\n xforward: true,\n onResponse: function (err, res, request, reply, settings, ttl) {\n if (err != null) {\n reply(\"Error connecting to '\" + request.query.uri + \"':\\n\\n\" + err.message).type(\"text/plain\").statusCode = 502;\n } else {\n reply(null, res);\n }\n }\n }\n }\n }\n });\n\n server.route({\n path: '/api/sense/api_server',\n method: ['GET', 'POST'],\n handler: function (req, reply) {\n let server = require('./api_server/server');\n let {sense_version, apis} = req.query;\n if (!apis) {\n reply(Boom.badRequest('\"apis\" is a required param.'));\n return;\n }\n\n return server.resolveApi(sense_version, apis.split(\",\"), reply);\n }\n });\n\n const testApp = kibana.uiExports.apps.hidden.byId['sense-tests'];\n if (testApp) {\n server.route({\n path: '/app/sense-tests',\n method: 'GET',\n handler: function (req, reply) {\n return reply.renderApp(testApp);\n }\n });\n }\n },\n\n uiExports: {\n apps: apps,\n\n noParse: [\n join(modules, 'ace' + sep),\n join(modules, 'moment_src/moment' + sep),\n join(src, 'sense_editor/mode/worker.js')\n ]\n }\n })\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/index.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (kibana) {\n var _require = require('path');\n\n var resolve = _require.resolve;\n var join = _require.join;\n var sep = _require.sep;\n\n var Joi = require('joi');\n var Boom = require('boom');\n var modules = resolve(__dirname, 'public/webpackShims/');\n var src = resolve(__dirname, 'public/src/');\n\n var _require2 = require('fs');\n\n var existsSync = _require2.existsSync;\n\n var _require3 = require('lodash');\n\n var startsWith = _require3.startsWith;\n var endsWith = _require3.endsWith;\n\n var apps = [{\n title: 'Sense',\n description: 'JSON aware developer\\'s interface to ElasticSearch',\n icon: 'plugins/sense/bonsai.png',\n main: 'plugins/sense/sense',\n autoload: kibana.autoload.styles,\n injectVars: function injectVars(server, options) {\n return options;\n }\n }];\n\n if (existsSync(resolve(__dirname, 'public/tests'))) {\n apps.push({\n title: 'Sense Tests',\n id: 'sense-tests',\n main: 'plugins/sense/tests',\n hidden: true\n //listed: false // uncomment after https://github.com/elastic/kibana/pull/4755\n });\n }\n\n return new kibana.Plugin({\n id: 'sense',\n\n config: function config(Joi) {\n return Joi.object({\n enabled: Joi.boolean()['default'](true),\n defaultServerUrl: Joi.string()['default']('http://localhost:9200'),\n proxyFilter: Joi.array().items(Joi.string()).single()['default'](['.*'])\n })['default']();\n },\n\n init: function init(server, options) {\n var filters = options.proxyFilter.map(function (str) {\n return new RegExp(str);\n });\n\n // http://hapijs.com/api/8.8.1#route-configuration\n server.route({\n path: '/api/sense/proxy',\n method: ['*', 'GET'],\n config: {\n handler: {\n proxy: {\n mapUri: function mapUri(req, cb) {\n var uri = req.query.uri;\n\n if (!uri) {\n cb(Boom.badRequest('URI is a required param.'));\n return;\n }\n\n if (!filters.some(function (re) {\n return re.test(uri);\n })) {\n var err = Boom.forbidden();\n err.output.payload = \"Error connecting to '\" + uri + \"':\\n\\nUnable to send requests to that url.\";\n err.output.headers['content-type'] = 'text/plain';\n cb(err);\n return;\n }\n\n cb(null, uri);\n },\n passThrough: true,\n xforward: true,\n onResponse: function onResponse(err, res, request, reply, settings, ttl) {\n if (err != null) {\n reply(\"Error connecting to '\" + request.query.uri + \"':\\n\\n\" + err.message).type(\"text/plain\").statusCode = 502;\n } else {\n reply(null, res);\n }\n }\n }\n }\n }\n });\n\n server.route({\n path: '/api/sense/api_server',\n method: ['GET', 'POST'],\n handler: function handler(req, reply) {\n var server = require('./api_server/server');\n var _req$query = req.query;\n var sense_version = _req$query.sense_version;\n var apis = _req$query.apis;\n\n if (!apis) {\n reply(Boom.badRequest('\"apis\" is a required param.'));\n return;\n }\n\n return server.resolveApi(sense_version, apis.split(\",\"), reply);\n }\n });\n\n var testApp = kibana.uiExports.apps.hidden.byId['sense-tests'];\n if (testApp) {\n server.route({\n path: '/app/sense-tests',\n method: 'GET',\n handler: function handler(req, reply) {\n return reply.renderApp(testApp);\n }\n });\n }\n },\n\n uiExports: {\n apps: apps,\n\n noParse: [join(modules, 'ace' + sep), join(modules, 'moment_src/moment' + sep), join(src, 'sense_editor/mode/worker.js')]\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ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iAgICAgIHJldHVybiBKb2kub2JqZWN0KHtcbiAgICAgICAgZW5hYmxlZDogSm9pLmJvb2xlYW4oKS5kZWZhdWx0KHRydWUpLFxuICAgICAgICBkZWZhdWx0U2VydmVyVXJsOiBKb2kuc3RyaW5nKCkuZGVmYXVsdCgnaHR0cDovL2xvY2FsaG9zdDo5MjAwJyksXG4gICAgICAgIHByb3h5RmlsdGVyOiBKb2kuYXJyYXkoKS5pdGVtcyhKb2kuc3RyaW5nKCkpLnNpbmdsZSgpLmRlZmF1bHQoWycuKiddKSxcbiAgICAgIH0pLmRlZmF1bHQoKTtcbiAgICB9LFxuXG4gICAgaW5pdDogZnVuY3Rpb24gKHNlcnZlciwgb3B0aW9ucykge1xuICAgICAgY29uc3QgZmlsdGVycyA9IG9wdGlvbnMucHJveHlGaWx0ZXIubWFwKHN0ciA9PiBuZXcgUmVnRXhwKHN0cikpO1xuXG4gICAgICAvLyBodHRwOi8vaGFwaWpzLmNvbS9hcGkvOC44LjEjcm91dGUtY29uZmlndXJhdGlvblxuICAgICAgc2VydmVyLnJvdXRlKHtcbiAgICAgICAgcGF0aDogJy9hcGkvc2Vuc2UvcHJveHknLFxuICAgICAgICBtZXRob2Q6IFsnKicsICdHRVQnXSxcbiAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgaGFuZGxlcjoge1xuICAgICAgICAgICAgcHJveHk6IHtcbiAgICAgICAgICAgICAgbWFwVXJpOiBmdW5jdGlvbiAocmVxLCBjYikge1xuICAgICAgICAgICAgICAgIGxldCB7IHVyaSB9ID0gcmVxLnF1ZXJ5O1xuICAgICAgICAgICAgICAgIGlmICghdXJpKSB7XG4gICAgICAgICAgICAgICAgICBjYihCb29tLmJhZFJlcXVlc3QoJ1VSSSBpcyBhIHJlcXVpcmVkIHBhcmFtLicpKTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoIWZpbHRlcnMuc29tZShyZSA9PiByZS50ZXN0KHVyaSkpKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdCBlcnIgPSBCb29tLmZvcmJpZGRlbigpO1xuICAgICAgICAgICAgICAgICAgZXJyLm91dHB1dC5wYXlsb2FkID0gXCJFcnJvciBjb25uZWN0aW5nIHRvICdcIiArIHVyaSArIFwiJzpcXG5cXG5VbmFibGUgdG8gc2VuZCByZXF1ZXN0cyB0byB0aGF0IHVybC5cIjtcbiAgICAgICAgICAgICAgICAgIGVyci5vdXRwdXQuaGVhZGVyc1snY29udGVudC10eXBlJ10gPSAndGV4dC9wbGFpbic7XG4gICAgICAgICAgICAgICAgICBjYihlcnIpO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNiKG51bGwsIHVyaSk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHBhc3NUaHJvdWdoOiB0cnVlLFxuICAgICAgICAgICAgICB4Zm9yd2FyZDogdHJ1ZSxcbiAgICAgICAgICAgICAgb25SZXNwb25zZTogZnVuY3Rpb24gKGVyciwgcmVzLCByZXF1ZXN0LCByZXBseSwgc2V0dGluZ3MsIHR0bCkge1xuICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgcmVwbHkoXCJFcnJvciBjb25uZWN0aW5nIHRvICdcIiArIHJlcXVlc3QucXVlcnkudXJpICsgXCInOlxcblxcblwiICsgZXJyLm1lc3NhZ2UpLnR5cGUoXCJ0ZXh0L3BsYWluXCIpLnN0YXR1c0NvZGUgPSA1MDI7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHJlcGx5KG51bGwsIHJlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgc2VydmVyLnJv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cbiAgICAgICAgam9pbihtb2R1bGVzLCAnYWNlJyArIHNlcCksXG4gICAgICAgIGpvaW4obW9kdWxlcywgJ21vbWVudF9zcmMvbW9tZW50JyArIHNlcCksXG4gICAgICAgIGpvaW4oc3JjLCAnc2Vuc2VfZWRpdG9yL21vZGUvd29ya2VyLmpzJylcbiAgICAgIF1cbiAgICB9XG4gIH0pXG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/index.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,MAAM,EAAE;iBACJ,OAAO,CAAC,MAAM,CAAC;;MAAtC,OAAO,YAAP,OAAO;MAAE,IAAI,YAAJ,IAAI;MAAE,GAAG,YAAH,GAAG;;AACxB,MAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AACzB,MAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,MAAI,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AACzD,MAAI,GAAG,GAAG,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;;kBACvB,OAAO,CAAC,IAAI,CAAC;;MAA5B,UAAU,aAAV,UAAU;;kBACiB,OAAO,CAAC,QAAQ,CAAC;;MAA1C,UAAU,aAAV,UAAU;MAAE,QAAQ,aAAR,QAAQ;;AAE5B,MAAM,IAAI,GAAG,CACX;AACE,SAAK,EAAE,OAAO;AACd,eAAW,EAAE,oDAAoD;AACjE,QAAI,EAAE,0BAA0B;AAChC,QAAI,EAAE,qBAAqB;AAC3B,YAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;AAChC,cAAU,EAAE,oBAAU,MAAM,EAAE,OAAO,EAAE;AACrC,aAAO,OAAO,CAAC;KAChB;GACF,CACF,CAAC;;AAEF,MAAI,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,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AAC,CAAC;AACtD,mBAAO;WACR;;AAED,iBAAO,MAAM,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;SACjE;OACF,CAAC,CAAC;;AAEH,UAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACjE,UAAI,OAAO,EAAE;AACX,cAAM,CAAC,KAAK,CAAC;AACX,cAAI,EAAE,kBAAkB;AACxB,gBAAM,EAAE,KAAK;AACb,iBAAO,EAAE,iBAAU,GAAG,EAAE,KAAK,EAAE;AAC7B,mBAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;WACjC;SACF,CAAC,CAAC;OACJ;KACF;;AAED,aAAS,EAAE;AACT,UAAI,EAAE,IAAI;;AAEV,aAAO,EAAE,CACP,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,GAAG,CAAC,EAC1B,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EACxC,IAAI,CAAC,GAAG,EAAE,6BAA6B,CAAC,CACzC;KACF;GACF,CAAC,CAAA;CACH,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/index.js", + "sourcesContent": [ + "module.exports = function (kibana) {\n let { resolve, join, sep } = require('path');\n let Joi = require('joi');\n let Boom = require('boom');\n let modules = resolve(__dirname, 'public/webpackShims/');\n let src = resolve(__dirname, 'public/src/');\n let { existsSync } = require('fs');\n const { startsWith, endsWith } = require('lodash');\n\n const apps = [\n {\n title: 'Sense',\n description: 'JSON aware developer\\'s interface to ElasticSearch',\n icon: 'plugins/sense/bonsai.png',\n main: 'plugins/sense/sense',\n autoload: kibana.autoload.styles,\n injectVars: function (server, options) {\n return options;\n }\n }\n ];\n\n if (existsSync(resolve(__dirname, 'public/tests'))) {\n apps.push({\n title: 'Sense Tests',\n id: 'sense-tests',\n main: 'plugins/sense/tests',\n hidden: true\n //listed: false // uncomment after https://github.com/elastic/kibana/pull/4755\n });\n }\n\n return new kibana.Plugin({\n id: 'sense',\n\n config: function (Joi) {\n return Joi.object({\n enabled: Joi.boolean().default(true),\n defaultServerUrl: Joi.string().default('http://localhost:9200'),\n proxyFilter: Joi.array().items(Joi.string()).single().default(['.*']),\n }).default();\n },\n\n init: function (server, options) {\n const filters = options.proxyFilter.map(str => new RegExp(str));\n\n // http://hapijs.com/api/8.8.1#route-configuration\n server.route({\n path: '/api/sense/proxy',\n method: ['*', 'GET'],\n config: {\n handler: {\n proxy: {\n mapUri: function (req, cb) {\n let { uri } = req.query;\n if (!uri) {\n cb(Boom.badRequest('URI is a required param.'));\n return;\n }\n\n if (!filters.some(re => re.test(uri))) {\n const err = Boom.forbidden();\n err.output.payload = \"Error connecting to '\" + uri + \"':\\n\\nUnable to send requests to that url.\";\n err.output.headers['content-type'] = 'text/plain';\n cb(err);\n return;\n }\n\n cb(null, uri);\n },\n passThrough: true,\n xforward: true,\n onResponse: function (err, res, request, reply, settings, ttl) {\n if (err != null) {\n reply(\"Error connecting to '\" + request.query.uri + \"':\\n\\n\" + err.message).type(\"text/plain\").statusCode = 502;\n } else {\n reply(null, res);\n }\n }\n }\n }\n }\n });\n\n server.route({\n path: '/api/sense/api_server',\n method: ['GET', 'POST'],\n handler: function (req, reply) {\n let server = require('./api_server/server');\n let {sense_version, apis} = req.query;\n if (!apis) {\n reply(Boom.badRequest('\"apis\" is a required param.'));\n return;\n }\n\n return server.resolveApi(sense_version, apis.split(\",\"), reply);\n }\n });\n\n const testApp = kibana.uiExports.apps.hidden.byId['sense-tests'];\n if (testApp) {\n server.route({\n path: '/app/sense-tests',\n method: 'GET',\n handler: function (req, reply) {\n return reply.renderApp(testApp);\n }\n });\n }\n },\n\n uiExports: {\n apps: apps,\n\n noParse: [\n join(modules, 'ace' + sep),\n join(modules, 'moment_src/moment' + sep),\n join(src, 'sense_editor/mode/worker.js')\n ]\n }\n })\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/server.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\nmodule.exports.resolveApi = function (sense_version, apis, reply) {\n var result = {};\n _.each(apis, function (name) {\n {\n // for now we ignore sense_version. might add it in the api name later\n var api = require('./' + name);\n result[name] = api.asJson();\n }\n });\n\n return reply(result).type(\"application/json\");\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9zZXJ2ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxJQUFJLENBQUMsR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7O0FBRTFCLE1BQU0sQ0FBQyxPQUFPLENBQUMsVUFBVSxHQUFHLFVBQVUsYUFBYSxFQUFFLElBQUksRUFBRSxLQUFLLEVBQUU7QUFDaEUsTUFBSSxNQUFNLEdBQUcsRUFBRSxDQUFDO0FBQ2hCLEd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dev/electron-quick-start/sense/installedPlugins/sense/api_server/server.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE;AAChE,MAAI,MAAM,GAAG,EAAE,CAAC;AAChB,GAAC,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE;AAC3B;;AAEE,UAAI,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAC/B,YAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;KAC7B;GACF,CAAC,CAAC;;AAEH,SAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;CAC/C,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/server.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nmodule.exports.resolveApi = function (sense_version, apis, reply) {\n let result = {};\n _.each(apis, function (name) {\n {\n // for now we ignore sense_version. might add it in the api name later\n let api = require('./' + name);\n result[name] = api.asJson();\n }\n });\n\n return reply(result).type(\"application/json\");\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\nvar Api = require('./api');\nvar parts = [require('./es_2_0/aliases'), require('./es_2_0/aggregations'), require('./es_2_0/cat'), require('./es_2_0/cluster'), require('./es_2_0/count'), require('./es_2_0/document'), require('./es_2_0/field_stats'), require('./es_2_0/filter'), require('./es_2_0/nodes'), require('./es_2_0/globals'), require('./es_2_0/indices'), require('./es_2_0/mappings'), require('./es_2_0/percolator'), require('./es_2_0/query'), require('./es_2_0/snapshot_restore'), require('./es_2_0/search'), require('./es_2_0/settings'), require('./es_2_0/templates'), require('./es_2_0/warmers')];\n\nfunction ES_2_0() {\n Api.call(this, \"es_2_0\");\n _.each(parts, function (apiSection) {\n apiSection(this);\n }, this);\n}\n\nES_2_0.prototype = _.create(Api.prototype, { 'constructor': ES_2_0 });\n\n(function (cls) {\n cls.addEndpointDescription = function (endpoint, description) {\n if (description) {\n var url_params_def = {};\n _.each(description.patterns || [], function (p) {\n if (p.indexOf(\"{indices}\") >= 0) {\n url_params_def[\"ignore_unavailable\"] = \"__flag__\";\n url_params_def[\"allow_no_indices\"] = \"__flag__\";\n url_params_def[\"expand_wildcards\"] = [\"open\", \"closed\"];\n }\n });\n\n if (url_params_def) {\n description.url_params = description.url_params || {};\n _.defaults(description.url_params, url_params_def);\n }\n }\n Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);\n };\n})(ES_2_0.prototype);\n\nmodule.exports = new ES_2_0();\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAuanMiXSwibmFtZXMiOltdLCJtYXBwaW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wib3BlblwiLCBcImNsb3NlZFwiXTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIGlmICh1cmxfcGFyYW1zX2RlZikge1xuICAgICAgICBkZXNjcmlwdGlvbi51cmxfcGFyYW1zID0gZGVzY3JpcHRpb24udXJsX3BhcmFtcyB8fCB7fTtcbiAgICAgICAgXy5kZWZhdWx0cyhkZXNjcmlwdGlvbi51cmxfcGFyYW1zLCB1cmxfcGFyYW1zX2RlZik7XG4gICAgICB9XG4gICAgfVxuICAgIE9iamVjdC5nZXRQcm90b3R5cGVPZihjbHMpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24uY2FsbCh0aGlzLCBlbmRwb2ludCwgZGVzY3JpcHRpb24pO1xuICB9O1xufSkoRVNfMl8wLnByb3RvdHlwZSk7XG5cbm1vZHVsZS5leHBvcnRzID0gbmV3IEVTXzJfMCgpO1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC1B,IAAI,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3B,IAAI,KAAK,GAAG,CACV,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,uBAAuB,CAAC,EAChC,OAAO,CAAC,cAAc,CAAC,EACvB,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,gBAAgB,CAAC,EACzB,OAAO,CAAC,mBAAmB,CAAC,EAC5B,OAAO,CAAC,sBAAsB,CAAC,EAC/B,OAAO,CAAC,iBAAiB,CAAC,EAC1B,OAAO,CAAC,gBAAgB,CAAC,EACzB,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,mBAAmB,CAAC,EAC5B,OAAO,CAAC,qBAAqB,CAAC,EAC9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ACF;AACD,UAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;GACrF,CAAC;CACH,CAAA,CAAE,MAAM,CAAC,SAAS,CAAC,CAAC;;AAErB,MAAM,CAAC,OAAO,GAAG,IAAI,MAAM,EAAE,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\nlet Api = require('./api');\nlet parts = [\n require('./es_2_0/aliases'),\n require('./es_2_0/aggregations'),\n require('./es_2_0/cat'),\n require('./es_2_0/cluster'),\n require('./es_2_0/count'),\n require('./es_2_0/document'),\n require('./es_2_0/field_stats'),\n require('./es_2_0/filter'),\n require('./es_2_0/nodes'),\n require('./es_2_0/globals'),\n require('./es_2_0/indices'),\n require('./es_2_0/mappings'),\n require('./es_2_0/percolator'),\n require('./es_2_0/query'),\n require('./es_2_0/snapshot_restore'),\n require('./es_2_0/search'),\n require('./es_2_0/settings'),\n require('./es_2_0/templates'),\n require('./es_2_0/warmers')\n];\n\nfunction ES_2_0() {\n Api.call(this, \"es_2_0\");\n _.each(parts, function (apiSection) {\n apiSection(this);\n }, this);\n}\n\nES_2_0.prototype = _.create(Api.prototype, {'constructor': ES_2_0});\n\n(function (cls) {\n cls.addEndpointDescription = function (endpoint, description) {\n if (description) {\n var url_params_def = {};\n _.each(description.patterns || [], function (p) {\n if (p.indexOf(\"{indices}\") >= 0) {\n url_params_def[\"ignore_unavailable\"] = \"__flag__\";\n url_params_def[\"allow_no_indices\"] = \"__flag__\";\n url_params_def[\"expand_wildcards\"] = [\"open\", \"closed\"];\n }\n });\n\n if (url_params_def) {\n description.url_params = description.url_params || {};\n _.defaults(description.url_params, url_params_def);\n }\n }\n Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);\n };\n})(ES_2_0.prototype);\n\nmodule.exports = new ES_2_0();\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/api.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\n'use strict';\n\n/**\n *\n * @param name\n */\nfunction Api(name) {\n this.globalRules = {};\n this.endpoints = {};\n this.name = name;\n}\n\n(function (cls) {\n cls.addGlobalAutocompleteRules = function (parentNode, rules) {\n this.globalRules[parentNode] = rules;\n };\n\n cls.addEndpointDescription = function (endpoint, description) {\n if (this.endpoints[endpoint]) {\n throw new Error(\"endpoint [\" + endpoint + \"] is already registered\");\n }\n\n var copiedDescription = {};\n _.extend(copiedDescription, description || {});\n _.defaults(copiedDescription, {\n id: endpoint,\n patterns: [endpoint],\n methods: ['GET']\n });\n this.endpoints[endpoint] = copiedDescription;\n };\n\n cls.asJson = function () {\n return {\n \"name\": this.name,\n \"globals\": this.globalRules,\n \"endpoints\": this.endpoints\n };\n };\n})(Api.prototype);\n\nmodule.exports = Api;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2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5kcG9pbnQsIGRlc2NyaXB0aW9uKSB7XG4gICAgaWYgKHRoaXMuZW5kcG9pbnRzW2VuZHBvaW50XSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKFwiZW5kcG9pbnQgW1wiICsgZW5kcG9pbnQgKyBcIl0gaXMgYWxyZWFkeSByZWdpc3RlcmVkXCIpO1xuICAgIH1cblxuICAgIHZhciBjb3BpZWREZXNjcmlwdGlvbiA9IHt9O1xuICAgIF8uZXh0ZW5kKGNvcGllZERlc2NyaXB0aW9uLCBkZXNjcmlwdGlvbiB8fCB7fSk7XG4gICAgXy5kZWZhdWx0cyhjb3BpZWREZXNjcmlwdGlvbiwge1xuICAgICAgaWQ6IGVuZHBvaW50LFxuICAgICAgcGF0dGVybnM6IFtlbmRwb2ludF0sXG4gICAgICBtZXRob2RzOiBbJ0dFVCddXG4gICAgfSk7XG4gICAgdGhpcy5lbmRwb2ludHNbZW5kcG9pbnRdID0gY29waWVkRGVzY3JpcHRpb247XG4gIH07XG5cbiAgY2xzLmFzSnNvbiA9IGZ1bmN0aW9uICgpIHtcbiAgICByZXR1cm4ge1xuICAgICAgXCJuYW1lXCI6IHRoaXMubmFtZSxcbiAgICAgIFwiZ2xvYmFsc1wiOiB0aGlzLmdsb2JhbFJ1bGVzLFxuICAgICAgXCJlbmRwb2ludHNcIjogdGhpcy5lbmRwb2ludHNcbiAgICB9XG4gIH07XG5cbn0oQXBpLnByb3RvdHlwZSkpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IEFwaTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/api.js" + ], + "names": [], + "mappings": ";;AAAA,IAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE5B,YAAY,CAAC;;;;;;AAMb,SAAS,GAAG,CAAC,IAAI,EAAE;AACjB,MAAI,CAAC,WAAW,GAAG,EAAE,CAAC;AACtB,MAAI,CAAC,SAAS,GAAG,EAAE,CAAC;AACpB,MAAI,CAAC,IAAI,GAAG,IAAI,CAAC;CAClB;;AAED,AAAC,CAAA,UAAU,GAAG,EAAE;AACd,KAAG,CAAC,0BAA0B,GAAG,UAAU,UAAU,EAAE,KAAK,EAAE;AAC5D,QAAI,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;GACtC,CAAC;;AAEF,KAAG,CAAC,sBAAsB,GAAG,UAAU,QAAQ,EAAE,WAAW,EAAE;AAC5D,QAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,YAAM,IAAI,KAAK,CAAC,YAAY,GAAG,QAAQ,GAAG,yBAAyB,CAAC,CAAC;KACtE;;AAED,QAAI,iBAAiB,GAAG,EAAE,CAAC;AAC3B,KAAC,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,IAAI,EAAE,CAAC,CAAC;AAC/C,KAAC,CAAC,QAAQ,CAAC,iBAAiB,EAAE;AAC5B,QAAE,EAAE,QAAQ;AACZ,cAAQ,EAAE,CAAC,QAAQ,CAAC;AACpB,aAAO,EAAE,CAAC,KAAK,CAAC;KACjB,CAAC,CAAC;AACH,QAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC;GAC9C,CAAC;;AAEF,KAAG,CAAC,MAAM,GAAG,YAAY;AACvB,WAAO;AACL,YAAM,EAAE,IAAI,CAAC,IAAI;AACjB,eAAS,EAAE,IAAI,CAAC,WAAW;AAC3B,iBAAW,EAAE,IAAI,CAAC,SAAS;KAC5B,CAAA;GACF,CAAC;CAEH,CAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAE;;AAElB,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/api.js", + "sourcesContent": [ + "const _ = require(\"lodash\");\n\n'use strict';\n\n/**\n *\n * @param name\n */\nfunction Api(name) {\n this.globalRules = {};\n this.endpoints = {};\n this.name = name;\n}\n\n(function (cls) {\n cls.addGlobalAutocompleteRules = function (parentNode, rules) {\n this.globalRules[parentNode] = rules;\n };\n\n cls.addEndpointDescription = function (endpoint, description) {\n if (this.endpoints[endpoint]) {\n throw new Error(\"endpoint [\" + endpoint + \"] is already registered\");\n }\n\n var copiedDescription = {};\n _.extend(copiedDescription, description || {});\n _.defaults(copiedDescription, {\n id: endpoint,\n patterns: [endpoint],\n methods: ['GET']\n });\n this.endpoints[endpoint] = copiedDescription;\n };\n\n cls.asJson = function () {\n return {\n \"name\": this.name,\n \"globals\": this.globalRules,\n \"endpoints\": this.endpoints\n }\n };\n\n}(Api.prototype));\n\nmodule.exports = Api;\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/aliases.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_post_aliases', {\n methods: ['POST'],\n patterns: [\"_aliases\"],\n data_autocomplete_rules: {\n 'actions': {\n __template: [{ 'add': { 'index': 'test1', 'alias': 'alias1' } }],\n __any_of: [{\n add: {\n index: '{index}',\n alias: '',\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n },\n remove: {\n index: '',\n alias: ''\n }\n }]\n }\n }\n });\n api.addEndpointDescription('_get_aliases', {\n methods: ['GET'],\n patterns: [\"_aliases\"]\n });\n\n var aliasRules = {\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n };\n\n api.addEndpointDescription('_post_alias', {\n methods: [\"POST\", \"PUT\"],\n patterns: [\"{indices}/_alias/{name}\"],\n data_autocomplete_rules: aliasRules\n });\n api.addEndpointDescription('_delete_alias', {\n methods: [\"DELETE\"],\n patterns: [\"{indices}/_alias/{name}\"]\n });\n api.addEndpointDescription('_get_alias', {\n methods: [\"GET\"],\n patterns: [\"_alias\", \"{indices}/_alias\", \"{indices}/_alias/{name}\", \"_alias/{name}\"]\n });\n\n api.addGlobalAutocompleteRules('aliases', {\n '*': aliasRules\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvYWxpYXNlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGVBQWUsRUFBRTtBQUMxQyxXQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUM7QUFDakIsWUFBUSxFQUFFLENBQ1IsVUFBVSxDQUNYO0FBQ0QsMkJBQXVCLEVBQUU7QUFDdkIsZUFBUyxFQUFFO0FBQ1Qsa0JBQVUsRUFBRSxDQUNWLEVBQUMsS0FBSyxFQUFFLEVBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsUUFBUSxFQUFDLEVBQUMsQ0FDL0M7QUFDRCxnQkFBUSxFQUFFLENBQ1I7QUFDRSxhQUFH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0VUXCJdLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIl9hbGlhc1wiLFxuICAgICAgXCJ7aW5kaWNlc30vX2FsaWFzXCIsXG4gICAgICBcIntpbmRpY2VzfS9fYWxpYXMve25hbWV9XCIsXG4gICAgICBcIl9hbGlhcy97bmFtZX1cIlxuICAgIF1cbiAgfSk7XG5cbiAgYXBpLmFkZEdsb2JhbEF1dG9jb21wbGV0ZVJ1bGVzKCdhbGlhc2VzJywge1xuICAgICcqJzogYWxpYXNSdWxlc1xuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/aliases.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,UAAU,CACX;AACD,2BAAuB,EAAE;AACvB,eAAS,EAAE;AACT,kBAAU,EAAE,CACV,EAAC,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAC,EAAC,CAC/C;AACD,gBAAQ,EAAE,CACR;AACE,aAAG,EAAE;AACH,iBAAK,EAAE,SAAS;AAChB,iBAAK,EAAE,EAAE;AACT,kBAAM,EAAE,EAAE;AACV,mBAAO,EAAE,GAAG;AACZ,0BAAc,EAAE,KAAK;AACrB,yBAAa,EAAE,GAAG;WACnB;AACD,gBAAM,EAAE;AACN,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,EAAE;WACV;SACF,CACF;OACF;KACF;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,UAAU,CACX;GACF,CAAC,CAAC;;AAEH,MAAI,UAAU,GAAG;AACf,UAAM,EAAE,EAAE;AACV,WAAO,EAAE,GAAG;AACZ,kBAAc,EAAE,KAAK;AACrB,iBAAa,EAAE,GAAG;GACnB,CAAC;;AAEF,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,WAAO,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACxB,YAAQ,EAAE,CACR,yBAAyB,CAC1B;AACD,2BAAuB,EAAE,UAAU;GACpC,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,yBAAyB,CAC1B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,YAAY,EAAE;AACvC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,CAChB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,0BAA0B,CAAC,SAAS,EAAE;AACxC,OAAG,EAAE,UAAU;GAChB,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/aliases.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_post_aliases', {\n methods: ['POST'],\n patterns: [\n \"_aliases\",\n ],\n data_autocomplete_rules: {\n 'actions': {\n __template: [\n {'add': {'index': 'test1', 'alias': 'alias1'}}\n ],\n __any_of: [\n {\n add: {\n index: '{index}',\n alias: '',\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n },\n remove: {\n index: '',\n alias: ''\n }\n }\n ]\n }\n }\n });\n api.addEndpointDescription('_get_aliases', {\n methods: ['GET'],\n patterns: [\n \"_aliases\",\n ]\n });\n\n var aliasRules = {\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n };\n\n api.addEndpointDescription('_post_alias', {\n methods: [\"POST\", \"PUT\"],\n patterns: [\n \"{indices}/_alias/{name}\"\n ],\n data_autocomplete_rules: aliasRules\n });\n api.addEndpointDescription('_delete_alias', {\n methods: [\"DELETE\"],\n patterns: [\n \"{indices}/_alias/{name}\"\n ]\n });\n api.addEndpointDescription('_get_alias', {\n methods: [\"GET\"],\n patterns: [\n \"_alias\",\n \"{indices}/_alias\",\n \"{indices}/_alias/{name}\",\n \"_alias/{name}\"\n ]\n });\n\n api.addGlobalAutocompleteRules('aliases', {\n '*': aliasRules\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar simple_metric = {\n __template: { field: \"\" },\n field: \"{field}\",\n missing: 0,\n script: {\n // populated by a global rule\n }\n},\n field_metric = {\n __template: { field: \"\" },\n field: \"{field}\"\n},\n gap_policy = {\n __one_of: [\"skip\", \"insert_zeros\"]\n},\n simple_pipeline = {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy\n};\nvar rules = {\n \"*\": {\n \"aggs\": {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n \"min\": simple_metric,\n \"max\": simple_metric,\n \"avg\": simple_metric,\n \"sum\": simple_metric,\n \"stats\": simple_metric,\n \"extended_stats\": simple_metric,\n \"value_count\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n }\n },\n \"global\": {},\n \"filter\": {},\n \"filters\": {\n __template: {\n \"filters\": {\n \"NAME\": {}\n }\n },\n \"filters\": {\n \"*\": { __scope_link: \"GLOBAL.filter\" }\n },\n \"other_bucket\": { __one_of: [true, false] },\n \"other_bucket_key\": \"\"\n },\n \"missing\": field_metric,\n \"nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"reverse_nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"terms\": {\n __template: {\n \"field\": \"\",\n \"size\": 10\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"order\": {\n __template: {\n \"_term\": \"asc\"\n },\n \"_term\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"min_doc_count\": 10,\n \"script\": {\n // populated by a global rule\n },\n \"include\": \".*\",\n \"exclude\": \".*\",\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\", \"global_ordinals_low_cardinality\"] },\n \"show_term_doc_count_error\": { __one_of: [true, false] },\n \"collect_mode\": { __one_of: [\"depth_first\", \"breadth_first\"] },\n \"missing\": \"\"\n },\n \"significant_terms\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"shard_min_doc_count\": 10,\n \"min_doc_count\": 10,\n \"include\": { __one_of: [\"*\", { pattern: \"\", flags: \"\" }] },\n \"exclude\": { __one_of: [\"*\", { pattern: \"\", flags: \"\" }] },\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\"] },\n \"background_filter\": {\n __scope_link: \"GLOBAL.filter\"\n },\n \"mutual_information\": {\n \"include_negatives\": { __one_of: [true, false] }\n },\n \"chi_square\": {\n \"include_negatives\": { __one_of: [true, false] },\n \"background_is_superset\": { __one_of: [true, false] }\n },\n \"percentage\": {},\n \"gnd\": {\n \"background_is_superset\": { __one_of: [true, false] }\n },\n \"script_heuristic\": {\n __template: {\n \"script\": \"_subset_freq/(_superset_freq - _subset_freq + 1)\"\n },\n \"script\": {\n // populated by a global rule\n }\n }\n },\n \"range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": 50, \"to\": 100 }]\n },\n \"field\": \"{field}\",\n \"ranges\": [{ \"to\": 50, \"from\": 100, \"key\": \"\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": {\n // populated by a global rule\n }\n },\n \"date_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": \"now-10d/d\", \"to\": \"now\" }]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [{ \"to\": \"\", \"from\": \"\", \"key\": \"\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": {\n // populated by a global rule\n }\n },\n \"ip_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": \"10.0.0.5\", \"to\": \"10.0.0.10\" }]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [{ \"to\": \"\", \"from\": \"\", \"key\": \"\", \"mask\": \"10.0.0.127/25\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": {\n // populated by a global rule\n }\n },\n \"histogram\": {\n __template: {\n \"field\": \"price\",\n \"interval\": 50\n },\n \"field\": \"{field}\",\n \"interval\": 50,\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"keyed\": { __one_of: [true, false] },\n \"missing\": 0\n },\n \"date_histogram\": {\n __template: {\n \"field\": \"date\",\n \"interval\": \"month\"\n },\n \"field\": \"{field}\",\n \"interval\": { __one_of: [\"year\", \"quarter\", \"week\", \"day\", \"hour\", \"minute\", \"second\"] },\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"keyed\": { __one_of: [true, false] },\n \"pre_zone\": \"-01:00\",\n \"post_zone\": \"-01:00\",\n \"pre_zone_adjust_large_interval\": { __one_of: [true, false] },\n \"factor\": 1000,\n \"pre_offset\": \"1d\",\n \"post_offset\": \"1d\",\n \"format\": \"yyyy-MM-dd\",\n \"time_zone\": \"00:00\",\n \"missing\": \"\"\n },\n \"geo_distance\": {\n __template: {\n \"field\": \"location\",\n \"origin\": { \"lat\": 52.3760, \"lon\": 4.894 },\n \"ranges\": [{ \"from\": 100, \"to\": 300 }]\n },\n \"field\": \"{field}\",\n \"origin\": { \"lat\": 0.0, \"lon\": 0.0 },\n \"unit\": { __one_of: [\"mi\", \"km\", \"in\", \"yd\", \"m\", \"cm\", \"mm\"] },\n \"ranges\": [{ \"from\": 50, \"to\": 100 }],\n \"distance_type\": { __one_of: [\"arc\", \"sloppy_arc\", \"plane\"] }\n\n },\n \"geohash_grid\": {\n __template: {\n \"field\": \"\",\n \"precision\": 3\n },\n \"field\": \"{field}\",\n \"precision\": { __one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },\n \"size\": 10,\n \"shard_size\": 10\n },\n \"percentiles\": {\n __template: {\n \"field\": \"\",\n \"percents\": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]\n },\n \"field\": \"{field}\",\n \"percents\": {\n __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],\n // mark type as list\n __any_of: []\n },\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": { __one_of: [\"hdr\", \"tdigest\"] },\n missing: 0\n },\n \"cardinality\": {\n __template: {\n \"field\": \"\"\n },\n \"precision_threshold\": 100,\n \"rehash\": true,\n \"script\": {\n // populated by a global rule\n },\n missing: \"\"\n },\n \"scripted_metric\": {\n __template: {\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\"\n },\n \"init_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"map_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"combine_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"reduce_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"lang\": \"groovy\",\n \"params\": {},\n \"reduce_params\": {}\n },\n \"geo_bounds\": {\n __template: {\n field: \"\"\n },\n field: \"{field}\",\n wrap_longitude: { __one_of: [true, false] }\n },\n \"top_hits\": {\n __template: {\n size: 10\n },\n from: 0,\n size: 10,\n sort: {\n __template: [],\n __scope_link: \"_search.sort\"\n },\n highlight: {},\n explain: { __one_of: [true, false] },\n _source: {\n __template: \"\",\n __scope_link: \"_search._source\"\n },\n script_fields: {\n __scope_link: \"_search.script_fields\"\n },\n fielddata_fields: [\"{field}\"],\n version: { __one_of: [true, false] }\n },\n \"percentile_ranks\": {\n __template: {\n field: \"\",\n values: [10, 15]\n },\n field: \"{field}\",\n values: [],\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": { __one_of: [\"hdr\", \"tdigest\"] },\n missing: 0\n },\n \"sampler\": {\n __template: {},\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n },\n \"shard_size\": 100,\n \"max_docs_per_value\": 3,\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"bytes_hash\"] }\n },\n \"children\": {\n __template: {\n \"type\": \"\"\n },\n \"type\": \"\"\n },\n \"derivative\": simple_pipeline,\n \"avg_bucket\": simple_pipeline,\n \"max_bucket\": simple_pipeline,\n \"min_bucket\": simple_pipeline,\n \"sum_bucket\": simple_pipeline,\n \"moving_avg\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n \"window\": 5,\n model: { __one_of: [\"simple\", \"linear\", \"ewma\", \"holt\", \"holt_winters\"] },\n settings: {\n type: { __one_of: [\"add\", \"mult\"] },\n alpha: 0.5,\n beta: 0.5,\n gamma: 0.5,\n period: 7\n }\n },\n \"cumulative_sum\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\"\n },\n \"serial_diff\": {\n __template: {\n buckets_path: \"\",\n lag: 7\n },\n lag: 7,\n gap_policy: gap_policy,\n buckets_path: \"\",\n format: \"\"\n },\n \"bucket_script\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n },\n \"bucket_selector\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n }\n }\n};\nmodule.exports = function (api) {\n\n api.addGlobalAutocompleteRules('aggregations', rules);\n api.addGlobalAutocompleteRules('aggs', rules);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvYWdncmVnYXRpb25zLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxhQUFhLEdBQUc7QUFDbEIsWUFBVSxFQUFFLEVBQUMsS0FBSyxFQUFFLEVBQUUsRUFBQztBQUN2QixPQUFLLEVBQUUsU0FBUztBQUNoQixTQUFPLEVBQUUsQ0FBQztBQUNWLFFBQU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"sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,aAAa,GAAG;AAClB,YAAU,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;AACvB,OAAK,EAAE,SAAS;AAChB,SAAO,EAAE,CAAC;AACV,QAAM,EAAE;;GAEP;CACF;IAAE,YAAY,GAAG;AAChB,YAAU,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;AACvB,OAAK,EAAE,SAAS;CACjB;IAAE,UAAU,GAAG;AACd,UAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;CACnC;IAAE,eAAe,GAAG;AACnB,YAAU,EAAE;AACV,gBAAY,EAAE,EAAE;GACjB;AACD,cAAY,EAAE,EAAE;AAChB,QAAM,EAAE,EAAE;AACV,YAAU,EAAE,UAAU;CACvB,CAAC;AACF,IAAI,KAAK,GAAG;AACV,KAAG,EAAE;AACH,UAAM,EAAE;AACN,gBAAU,EAAE;AACV,cAAM,EAAE;AACN,oBAAU,EAAE,EAAE;SACf;OACF;KACF;AACD,SAAK,EAAE,aAAa;AACpB,SAAK,EAAE,aAAa;AACpB,SAAK,EAAE,aAAa;AACpB,SAAK,EAAE,aAAa;AACpB,WAAO,EAAE,aAAa;AACtB,oBAAgB,EAAE,aAAa;AAC/B,iBAAa,EAAE;AACb,gBAAU,EAAE;AACV,eAAO,EAAE,EAAE;OACZ;AACD,aAAO,EAAE,SAAS;AAClB,cAAQ,EAAE;;OAET;KACF;AACD,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,EAAE;AACZ,aAAS,EAAE;AACT,gBAAU,EAAE;AACV,iBAAS,EAAE;AACT,gBAAM,EAAE,EAAE;SACX;OACF;AACD,eAAS,EAAE;AACT,WAAG,EAAE,EAAC,YAAY,EAAE,eAAe,EAAC;OACrC;AACD,oBAAc,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC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AC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAC;AACvE,cAAQ,EAAE;AACR,YAAI,EAAE,EAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAC;AACjC,aAAK,EAAE,GAAG;AACV,YAAI,EAAE,GAAG;AACT,aAAK,EAAE,GAAG;AACV,cAAM,EAAE,CAAC;OACV;KACF;AACD,oBAAgB,EAAE;AAChB,gBAAU,EAAE;AACV,oBAAY,EAAE,EAAE;OACjB;AACD,kBAAY,EAAE,EAAE;AAChB,YAAM,EAAE,EAAE;KACX;AACD,iBAAa,EAAE;AACb,gBAAU,EAAE;AACV,oBAAY,EAAE,EAAE;AAChB,WAAG,EAAE,CAAC;OACP;AACD,SAAG,EAAE,CAAC;AACN,gBAAU,EAAE,UAAU;AACtB,kBAAY,EAAE,EAAE;AAChB,YAAM,EAAE,EAAE;KACX;AACD,mBAAe,EAAE;AACf,gBAAU,EAAE;AACV,oBAAY,EAAE,EAAE;AAChB,cAAM,EAAE,EAAE;OACX;AACD,kBAAY,EAAE,EAAE;AAChB,YAAM,EAAE,EAAE;AACV,gBAAU,EAAE,UAAU;AACtB,YAAM,EAAE;;OAEP;KACF;AACD,qBAAiB,EAAE;AACjB,gBAAU,EAAE;AACV,oBAAY,EAAE,EAAE;AAChB,cAAM,EAAE,EAAE;OACX;AACD,kBAAY,EAAE,EAAE;AAChB,gBAAU,EAAE,UAAU;AACtB,YAAM,EAAE;;OAEP;KACF;GACF;CACF,CAAC;AACF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;;AAE9B,KAAG,CAAC,0BAA0B,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;AACtD,KAAG,CAAC,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC/C,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js", + "sourcesContent": [ + "var simple_metric = {\n __template: {field: \"\"},\n field: \"{field}\",\n missing: 0,\n script: {\n // populated by a global rule\n }\n}, field_metric = {\n __template: {field: \"\"},\n field: \"{field}\"\n}, gap_policy = {\n __one_of: [\"skip\", \"insert_zeros\"]\n}, simple_pipeline = {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy\n};\nvar rules = {\n \"*\": {\n \"aggs\": {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n \"min\": simple_metric,\n \"max\": simple_metric,\n \"avg\": simple_metric,\n \"sum\": simple_metric,\n \"stats\": simple_metric,\n \"extended_stats\": simple_metric,\n \"value_count\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n }\n },\n \"global\": {},\n \"filter\": {},\n \"filters\": {\n __template: {\n \"filters\": {\n \"NAME\": {}\n }\n },\n \"filters\": {\n \"*\": {__scope_link: \"GLOBAL.filter\"}\n },\n \"other_bucket\": {__one_of: [true, false]},\n \"other_bucket_key\": \"\"\n },\n \"missing\": field_metric,\n \"nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"reverse_nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"terms\": {\n __template: {\n \"field\": \"\",\n \"size\": 10\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"order\": {\n __template: {\n \"_term\": \"asc\"\n },\n \"_term\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"min_doc_count\": 10,\n \"script\": {\n // populated by a global rule\n },\n \"include\": \".*\",\n \"exclude\": \".*\",\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\", \"global_ordinals_low_cardinality\"]},\n \"show_term_doc_count_error\": {__one_of: [true, false]},\n \"collect_mode\": {__one_of: [\"depth_first\", \"breadth_first\"]},\n \"missing\": \"\"\n },\n \"significant_terms\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"shard_min_doc_count\": 10,\n \"min_doc_count\": 10,\n \"include\": {__one_of: [\"*\", {pattern: \"\", flags: \"\"}]},\n \"exclude\": {__one_of: [\"*\", {pattern: \"\", flags: \"\"}]},\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\"]},\n \"background_filter\": {\n __scope_link: \"GLOBAL.filter\"\n },\n \"mutual_information\": {\n \"include_negatives\": {__one_of: [true, false]}\n },\n \"chi_square\": {\n \"include_negatives\": {__one_of: [true, false]},\n \"background_is_superset\": {__one_of: [true, false]}\n },\n \"percentage\": {},\n \"gnd\": {\n \"background_is_superset\": {__one_of: [true, false]}\n },\n \"script_heuristic\": {\n __template: {\n \"script\": \"_subset_freq/(_superset_freq - _subset_freq + 1)\"\n },\n \"script\": {\n // populated by a global rule\n }\n }\n },\n \"range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": 50, \"to\": 100},\n ]\n },\n \"field\": \"{field}\",\n \"ranges\": [\n {\"to\": 50, \"from\": 100, \"key\": \"\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": {\n // populated by a global rule\n }\n },\n \"date_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": \"now-10d/d\", \"to\": \"now\"},\n ]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [\n {\"to\": \"\", \"from\": \"\", \"key\": \"\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": {\n // populated by a global rule\n }\n },\n \"ip_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": \"10.0.0.5\", \"to\": \"10.0.0.10\"},\n ]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [\n {\"to\": \"\", \"from\": \"\", \"key\": \"\", \"mask\": \"10.0.0.127/25\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": {\n // populated by a global rule\n }\n },\n \"histogram\": {\n __template: {\n \"field\": \"price\",\n \"interval\": 50\n },\n \"field\": \"{field}\",\n \"interval\": 50,\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"keyed\": {__one_of: [true, false]},\n \"missing\": 0\n },\n \"date_histogram\": {\n __template: {\n \"field\": \"date\",\n \"interval\": \"month\"\n },\n \"field\": \"{field}\",\n \"interval\": {__one_of: [\"year\", \"quarter\", \"week\", \"day\", \"hour\", \"minute\", \"second\"]},\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"keyed\": {__one_of: [true, false]},\n \"pre_zone\": \"-01:00\",\n \"post_zone\": \"-01:00\",\n \"pre_zone_adjust_large_interval\": {__one_of: [true, false]},\n \"factor\": 1000,\n \"pre_offset\": \"1d\",\n \"post_offset\": \"1d\",\n \"format\": \"yyyy-MM-dd\",\n \"time_zone\": \"00:00\",\n \"missing\": \"\"\n },\n \"geo_distance\": {\n __template: {\n \"field\": \"location\",\n \"origin\": {\"lat\": 52.3760, \"lon\": 4.894},\n \"ranges\": [\n {\"from\": 100, \"to\": 300},\n ]\n },\n \"field\": \"{field}\",\n \"origin\": {\"lat\": 0.0, \"lon\": 0.0},\n \"unit\": {__one_of: [\"mi\", \"km\", \"in\", \"yd\", \"m\", \"cm\", \"mm\"]},\n \"ranges\": [\n {\"from\": 50, \"to\": 100}\n ],\n \"distance_type\": {__one_of: [\"arc\", \"sloppy_arc\", \"plane\"]}\n\n },\n \"geohash_grid\": {\n __template: {\n \"field\": \"\",\n \"precision\": 3\n },\n \"field\": \"{field}\",\n \"precision\": {__one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},\n \"size\": 10,\n \"shard_size\": 10\n },\n \"percentiles\": {\n __template: {\n \"field\": \"\",\n \"percents\": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]\n },\n \"field\": \"{field}\",\n \"percents\": {\n __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],\n // mark type as list\n __any_of: []\n },\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": {__one_of: [\"hdr\", \"tdigest\"]},\n missing: 0\n },\n \"cardinality\": {\n __template: {\n \"field\": \"\"\n },\n \"precision_threshold\": 100,\n \"rehash\": true,\n \"script\": {\n // populated by a global rule\n },\n missing: \"\"\n },\n \"scripted_metric\": {\n __template: {\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\"\n },\n \"init_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"map_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"combine_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"reduce_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"lang\": \"groovy\",\n \"params\": {},\n \"reduce_params\": {}\n },\n \"geo_bounds\": {\n __template: {\n field: \"\"\n },\n field: \"{field}\",\n wrap_longitude: {__one_of: [true, false]}\n },\n \"top_hits\": {\n __template: {\n size: 10\n },\n from: 0,\n size: 10,\n sort: {\n __template: [],\n __scope_link: \"_search.sort\"\n },\n highlight: {},\n explain: {__one_of: [true, false]},\n _source: {\n __template: \"\",\n __scope_link: \"_search._source\"\n },\n script_fields: {\n __scope_link: \"_search.script_fields\"\n },\n fielddata_fields: [\"{field}\"],\n version: {__one_of: [true, false]}\n },\n \"percentile_ranks\": {\n __template: {\n field: \"\",\n values: [10, 15]\n },\n field: \"{field}\",\n values: [],\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": {__one_of: [\"hdr\", \"tdigest\"]},\n missing: 0\n },\n \"sampler\": {\n __template: {},\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n },\n \"shard_size\": 100,\n \"max_docs_per_value\": 3,\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"bytes_hash\"]}\n },\n \"children\": {\n __template: {\n \"type\": \"\",\n },\n \"type\": \"\"\n },\n \"derivative\": simple_pipeline,\n \"avg_bucket\": simple_pipeline,\n \"max_bucket\": simple_pipeline,\n \"min_bucket\": simple_pipeline,\n \"sum_bucket\": simple_pipeline,\n \"moving_avg\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n \"window\": 5,\n model: {__one_of: [\"simple\", \"linear\", \"ewma\", \"holt\", \"holt_winters\"]},\n settings: {\n type: {__one_of: [\"add\", \"mult\"]},\n alpha: 0.5,\n beta: 0.5,\n gamma: 0.5,\n period: 7\n }\n },\n \"cumulative_sum\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\"\n },\n \"serial_diff\": {\n __template: {\n buckets_path: \"\",\n lag: 7\n },\n lag: 7,\n gap_policy: gap_policy,\n buckets_path: \"\",\n format: \"\"\n },\n \"bucket_script\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n },\n \"bucket_selector\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n }\n }\n};\nmodule.exports = function (api) {\n\n api.addGlobalAutocompleteRules('aggregations', rules);\n api.addGlobalAutocompleteRules('aggs', rules);\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/cat.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\nfunction addSimpleCat(endpoint, api, params, patterns) {\n var url_params = { \"help\": \"__flag__\", \"v\": \"__flag__\", \"bytes\": [\"b\"] };\n _.each(params || [], function (p) {\n if (_.isString(p)) {\n url_params[p] = \"__flag__\";\n } else {\n var k = Object.keys(p)[0];\n url_params[k] = p[k];\n }\n });\n api.addEndpointDescription(endpoint, {\n match: endpoint,\n url_params: url_params,\n patterns: patterns || [endpoint]\n });\n}\n\nfunction addNodeattrsCat(api) {\n api.addEndpointDescription('_cat/nodeattrs', {\n methods: ['GET'],\n patterns: [\"_cat/nodeattrs\"],\n url_params: {\n help: \"__flag__\",\n v: \"__flag__\",\n h: [\"node\", \"name\", \"id\", \"nodeId\", \"pid\", \"p\", \"host\", \"h\", \"ip\", \"i\", \"port\", \"po\", \"attr\", \"attr.name\", \"value\", \"attr.value\"]\n }\n });\n}\n\nmodule.exports = function (api) {\n addSimpleCat('_cat/aliases', api);\n addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);\n addSimpleCat('_cat/count', api);\n addSimpleCat('_cat/health', api, [{ \"ts\": [\"false\", \"true\"] }]);\n addSimpleCat('_cat/indices', api, [{ h: [] }, \"pri\"], ['_cat/indices', '_cat/indices/{indices}']);\n addSimpleCat('_cat/master', api);\n addSimpleCat('_cat/nodes', api);\n addSimpleCat('_cat/pending_tasks', api);\n addSimpleCat('_cat/recovery', api);\n addSimpleCat('_cat/thread_pool', api);\n addSimpleCat('_cat/shards', api);\n addSimpleCat('_cat/plugins', api);\n addSimpleCat('_cat/segments', api);\n addNodeattrsCat(api);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvY2F0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxDQUFDLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDOztBQUUxQixTQUFTLFlBQVksQ0FBQyxRQUFRLEVBQUUsR0FBRyxFQUFFLE1BQU0sRUFBRSxRQUFRLEVBQUU7QUFDckQsTUFBSSxVQUFVLEdBQUcsRUFBQyxNQUFNLEVBQUUsVUFBVSxFQUFFLEdBQUcsRUFBRSxVQUFVLEVBQUUsT0FBTyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUMsQ0FBQztBQUN2RSxHQUFDLENBQUMsSUFBSSxDQUFDLE1BQU0sSUFBSSxFQUFFLEVBQUUsVUFBVSxDQUFDLEVBQUU7QUFDaEMsUUFBSSxDQUFDLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxFQUFFO0FBQ2pCLGdCQUFVLENBQUMsQ0FBQyxDQUFDLEdBQUcsVUFBVSxDQUFDO0tBQzVCLE1BQ0k7QUFDSCxVQUFJLENBQUMsR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzFCLGdCQUFVLENBQUM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ZGRTaW1wbGVDYXQoJ19jYXQvc2VnbWVudHMnLCBhcGkpO1xuICBhZGROb2RlYXR0cnNDYXQoYXBpKTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/cat.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,SAAS,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE;AACrD,MAAI,UAAU,GAAG,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAC,CAAC;AACvE,GAAC,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,UAAU,CAAC,EAAE;AAChC,QAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;AACjB,gBAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;KAC5B,MACI;AACH,UAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,gBAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACtB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACnC,SAAK,EAAE,QAAQ;AACf,cAAU,EAAE,UAAU;AACtB,YAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,CAAC;GACjC,CAAC,CAAC;CACJ;;AAED,SAAS,eAAe,CAAC,GAAG,EAAE;AAC5B,KAAG,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;AAC3C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,gBAAgB,CACjB;AACD,cAAU,EAAE;AACV,UAAI,EAAE,UAAU;AAChB,OAAC,EAAE,UAAU;AACb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installedPlugins/sense/api_server/es_2_0/cat.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nfunction addSimpleCat(endpoint, api, params, patterns) {\n var url_params = {\"help\": \"__flag__\", \"v\": \"__flag__\", \"bytes\": [\"b\"]};\n _.each(params || [], function (p) {\n if (_.isString(p)) {\n url_params[p] = \"__flag__\";\n }\n else {\n var k = Object.keys(p)[0];\n url_params[k] = p[k];\n }\n });\n api.addEndpointDescription(endpoint, {\n match: endpoint,\n url_params: url_params,\n patterns: patterns || [endpoint]\n });\n}\n\nfunction addNodeattrsCat(api) {\n api.addEndpointDescription('_cat/nodeattrs', {\n methods: ['GET'],\n patterns: [\n \"_cat/nodeattrs\"\n ],\n url_params: {\n help: \"__flag__\",\n v: \"__flag__\",\n h: [\"node\", \"name\", \"id\", \"nodeId\", \"pid\", \"p\", \"host\", \"h\", \"ip\", \"i\", \"port\", \"po\", \"attr\", \"attr.name\", \"value\", \"attr.value\"]\n }\n });\n}\n\nmodule.exports = function (api) {\n addSimpleCat('_cat/aliases', api);\n addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);\n addSimpleCat('_cat/count', api);\n addSimpleCat('_cat/health', api, [\n {\"ts\": [\"false\", \"true\"]}\n ]);\n addSimpleCat('_cat/indices', api, [\n {h: []},\n \"pri\",\n ],\n ['_cat/indices', '_cat/indices/{indices}']);\n addSimpleCat('_cat/master', api);\n addSimpleCat('_cat/nodes', api);\n addSimpleCat('_cat/pending_tasks', api);\n addSimpleCat('_cat/recovery', api);\n addSimpleCat('_cat/thread_pool', api);\n addSimpleCat('_cat/shards', api);\n addSimpleCat('_cat/plugins', api);\n addSimpleCat('_cat/segments', api);\n addNodeattrsCat(api);\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/cluster.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_cluster/nodes/stats');\n api.addEndpointDescription('_cluster/state', {\n patterns: [\"_cluster/state\", \"_cluster/state/{metrics}\", \"_cluster/state/{metrics}/{indices}\"],\n url_components: {\n \"metrics\": [\"version\", \"master_node\", \"nodes\", \"routing_table\", \"routing_node\", \"metadata\", \"blocks\"]\n }\n });\n api.addEndpointDescription('_cluster/health', {\n url_params: {\n \"local\": \"__flag__\",\n \"level\": [\"indices\", \"shards\"],\n \"master_timeout\": \"30s\",\n \"timeout\": \"30s\",\n \"wait_for_status\": [\"yellow\", \"green\"],\n \"wait_for_relocating_shards\": 0,\n \"wait_for_active_shards\": 0,\n \"wait_for_nodes\": 0\n }\n });\n api.addEndpointDescription('_cluster/pending_tasks');\n api.addEndpointDescription('get_cluster/settings', {\n patterns: ['_cluster/settings']\n });\n\n api.addEndpointDescription('put_cluster/settings', {\n methods: ['PUT'],\n patterns: ['_cluster/settings'],\n data_autocomplete_rules: {\n persistent: {\n cluster: {\n routing: {\n 'allocation.enable': { __one_of: [\"all\", \"primaries\", \"new_primaries\", \"none\"] },\n 'allocation.disk.threshold_enabled': { __one_of: [false, true] },\n 'allocation.disk.watermark.low': '85%',\n 'allocation.disk.watermark.high': '90%',\n 'allocation.disk.include_relocations': { __one_of: [true, false] },\n 'allocation.disk.reroute_interval': '60s',\n 'allocation.exclude': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.include': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.require': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.awareness.attributes': [],\n 'allocation.awareness.force': {\n '*': {\n 'values': []\n }\n },\n 'allocation.allow_rebalance': { __one_of: ['always', 'indices_primaries_active', 'indices_all_active'] },\n 'allocation.cluster_concurrent_rebalance': 2,\n 'allocation.node_initial_primaries_recoveries': 4,\n 'allocation.node_concurrent_recoveries': 2,\n 'allocation.same_shard.host': { __one_of: [false, true] }\n }\n },\n indices: {\n breaker: {\n \"total.limit\": \"70%\",\n \"fielddata.limit\": \"60%\",\n \"fielddata.overhead\": 1.03,\n \"request.limit\": \"40%\",\n \"request.overhead\": 1.0\n }\n }\n },\n transient: {\n __scope_link: '.persistent'\n }\n }\n });\n\n api.addEndpointDescription('_cluster/reroute', {\n methods: ['POST'],\n url_params: {\n explain: \"__flag__\",\n dry_run: \"__flag__\"\n },\n data_autocomplete_rules: {\n commands: [{\n move: {\n __template: {\n index: \"\",\n shard: 0,\n from_node: \"\",\n to_node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n from_node: \"{node}\",\n to_node: \"{node}\"\n },\n cancel: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: { __one_of: [true, false] }\n },\n allocate: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: { __one_of: [true, false] }\n }\n }],\n dry_run: { __one_of: [true, false] }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0Y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ZGVfcmVsb2NhdGlvbnMnOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uZGlzay5yZXJvdXRlX2ludGVydmFsJzogJzYwcycsXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5leGNsdWRlJzoge1xuICAgICAgICAgICAgICAnX2lwJzogXCJcIixcbiAgICAgICAgICAgICAgJ19uYW1lJzogXCJcIixcbiAgICAgICAgICAgICAgJ19ob3N0JzogXCJcIixcbiAgICAgICAgICAgICAgJ19pZCc6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5pbmNsdWRlJzoge1xuICAgICAgICAgICAgICAnX2lwJzogXCJcIixcbiAgICAgICAgICAgICAgJ19uYW1lJzogXCJcIixcbiAgICAgICAgICAgICAgJ19ob3N0JzogXCJcIixcbiAgICAgICAgICAgICAgJ19pZCc6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5yZXF1aXJlJzoge1xuICAgICAgICAgICAgICAnX2lwJzogXCJcIixcbiAgICAgICAgICAgICAgJ19uYW1lJzogXCJcIixcbiAgICAgICAgICAgICAgJ19ob3N0JzogXCJcIixcbiAgICAgICAgICAgICAgJ19pZCc6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5hd2FyZW5lc3MuYXR0cmlidXRlcyc6IFtdLFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uYXdhcmVuZXNzLmZvcmNlJzoge1xuICAgICAgICAgICAgICAnKic6IHtcbiAgICAgICAgICAgICAgICAndmFsdWVzJzogW11cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmFsbG93X3JlYmFsYW5jZSc6IHtfX29uZV9vZjogWydhbHdheXMnLCAnaW5kaWNlc19wcmltYXJpZXNfYWN0aXZlJywgJ2luZGljZXNfYWxsX2FjdGl2ZSddfSxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmNsdXN0ZXJfY29uY3VycmVudF9yZWJhbGFuY2UnOiAyLFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24ubm9kZV9pbml0aWFsX3ByaW1hcmllc19yZWNvdmVyaWVzJzogNCxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLm5vZGVfY29uY3VycmVudF9yZWNvdmVyaWVzJzogMixcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLnNhbWVfc2hhcmQuaG9zdCc6IHtfX29uZV9vZjogW2ZhbHNlLCB0cnVlXX1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGluZGljZXM6IHtcbiAgICAgICAgICBicmVha2VyOiB7XG4gICAgICAgICAgICBcInRvdGFsLmxpbWl0XCI6IFwiNzAlXCIsXG4gICAgICAgICAgICBcImZpZWxkZGF0YS5saW1pdFwiOiBcIjYwJVwiLFxuICAgICAgICAgICAgXCJmaWVsZGRhdGEub3ZlcmhlYWRcIjogMS4wMyxcbiAgICAgICAgICAgIFwicmVxdWVzdC5saW1pdFwiOiBcIjQwJVwiLFxuICAgICAgICAgICAgXCJyZXF1ZXN0Lm92ZXJoZWFkXCI6IDEuMFxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIHRyYW5zaWVudDoge1xuICAgICAgICBfX3Njb3BlX2xpbms6ICcucGVyc2lzdGVudCdcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuXG4gIGFwaS5hZGRFbmRwb2ludERlc2NyaXB0aW9uKCdfY2x1c3Rlci9yZXJvdXRlJywge1xuICAgIG1ldGhvZHM6IFsnUE9TVCddLFxuICAgIHVybF9wYXJhbXM6IHtcbiAgICAgIGV4cGxhaW46IFwiX19mbGFnX19cIixcbiAgICAgIGRyeV9ydW46IFwiX19mbGFnX19cIlxuICAgIH0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgIGNvbW1hbmRzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBtb3ZlOiB7XG4gICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgIGluZGV4OiBcIlwiLFxuICAgICAgICAgICAgICBzaGFyZDogMCxcbiAgICAgICAgICAgICAgZnJvbV9ub2RlOiBcIlwiLFxuICAgICAgICAgICAgICB0b19ub2RlOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW5kZXg6IFwie2luZGV4fVwiLFxuICAgICAgICAgICAgc2hhcmQ6IDAsXG4gICAgICAgICAgICBmcm9tX25vZGU6IFwie25vZGV9XCIsXG4gICAgICAgICAgICB0b19ub2RlOiBcIntub2RlfVwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICBjYW5jZWw6IHtcbiAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgaW5kZXg6IFwiXCIsXG4gICAgICAgICAgICAgIHNoYXJkOiAwLFxuICAgICAgICAgICAgICBub2RlOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW5kZXg6IFwie2luZGV4fVwiLFxuICAgICAgICAgICAgc2hhcmQ6IDAsXG4gICAgICAgICAgICBub2RlOiBcIntub2RlfVwiLFxuICAgICAgICAgICAgYWxsb3dfcHJpbWFyeToge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgYWxsb2NhdGU6IHtcbiAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgaW5kZXg6IFwiXCIsXG4gICAgICAgICAgICAgIHNoYXJkOiAwLFxuICAgICAgICAgICAgICBub2RlOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW5kZXg6IFwie2luZGV4fVwiLFxuICAgICAgICAgICAgc2hhcmQ6IDAsXG4gICAgICAgICAgICBub2RlOiBcIntub2RlfVwiLFxuICAgICAgICAgICAgYWxsb3dfcHJpbWFyeToge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgXSxcbiAgICAgIGRyeV9ydW46IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/cluster.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,CAAC;AACnD,KAAG,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;AAC3C,YAAQ,EAAE,CACR,gBAAgB,EAChB,0BAA0B,EAC1B,oCAAoC,CACrC;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,CAAC;KACtG;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,cAAU,EAAE;AACV,aAAO,EAAE,UAAU;AACnB,aAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;AAC9B,sBAAgB,EAAE,KAAK;AACvB,eAAS,EAAE,KAAK;AAChB,uBAAiB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;AACtC,kCAA4B,EAAE,CAAC;AAC/B,8BAAwB,EAAE,CAAC;AAC3B,sBAAgB,EAAE,CAAC;KACpB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,CAAC;AACrD,KAAG,CAAC,sBAAsB,CAAC,sBAAsB,EAAE;AACjD,YAAQ,EAAE,CACR,mBAAmB,CACpB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sB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AACD,aAAO,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;KACnC;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/cluster.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_cluster/nodes/stats');\n api.addEndpointDescription('_cluster/state', {\n patterns: [\n \"_cluster/state\",\n \"_cluster/state/{metrics}\",\n \"_cluster/state/{metrics}/{indices}\"\n ],\n url_components: {\n \"metrics\": [\"version\", \"master_node\", \"nodes\", \"routing_table\", \"routing_node\", \"metadata\", \"blocks\"]\n }\n });\n api.addEndpointDescription('_cluster/health', {\n url_params: {\n \"local\": \"__flag__\",\n \"level\": [\"indices\", \"shards\"],\n \"master_timeout\": \"30s\",\n \"timeout\": \"30s\",\n \"wait_for_status\": [\"yellow\", \"green\"],\n \"wait_for_relocating_shards\": 0,\n \"wait_for_active_shards\": 0,\n \"wait_for_nodes\": 0\n }\n });\n api.addEndpointDescription('_cluster/pending_tasks');\n api.addEndpointDescription('get_cluster/settings', {\n patterns: [\n '_cluster/settings'\n ]\n });\n\n api.addEndpointDescription('put_cluster/settings', {\n methods: ['PUT'],\n patterns: [\n '_cluster/settings'\n ],\n data_autocomplete_rules: {\n persistent: {\n cluster: {\n routing: {\n 'allocation.enable': {__one_of: [\"all\", \"primaries\", \"new_primaries\", \"none\"]},\n 'allocation.disk.threshold_enabled': {__one_of: [false, true]},\n 'allocation.disk.watermark.low': '85%',\n 'allocation.disk.watermark.high': '90%',\n 'allocation.disk.include_relocations': {__one_of: [true, false]},\n 'allocation.disk.reroute_interval': '60s',\n 'allocation.exclude': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.include': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.require': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.awareness.attributes': [],\n 'allocation.awareness.force': {\n '*': {\n 'values': []\n }\n },\n 'allocation.allow_rebalance': {__one_of: ['always', 'indices_primaries_active', 'indices_all_active']},\n 'allocation.cluster_concurrent_rebalance': 2,\n 'allocation.node_initial_primaries_recoveries': 4,\n 'allocation.node_concurrent_recoveries': 2,\n 'allocation.same_shard.host': {__one_of: [false, true]}\n }\n },\n indices: {\n breaker: {\n \"total.limit\": \"70%\",\n \"fielddata.limit\": \"60%\",\n \"fielddata.overhead\": 1.03,\n \"request.limit\": \"40%\",\n \"request.overhead\": 1.0\n }\n }\n },\n transient: {\n __scope_link: '.persistent'\n }\n }\n });\n\n api.addEndpointDescription('_cluster/reroute', {\n methods: ['POST'],\n url_params: {\n explain: \"__flag__\",\n dry_run: \"__flag__\"\n },\n data_autocomplete_rules: {\n commands: [\n {\n move: {\n __template: {\n index: \"\",\n shard: 0,\n from_node: \"\",\n to_node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n from_node: \"{node}\",\n to_node: \"{node}\"\n },\n cancel: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: {__one_of: [true, false]}\n },\n allocate: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: {__one_of: [true, false]}\n }\n }\n ],\n dry_run: {__one_of: [true, false]}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/count.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_count', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_count\", \"{indices}/_count\", \"_count\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n min_score: 1.0,\n terminate_after: 10\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvY291bnQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxRQUFRLEVBQUU7QUFDakMsV0FBTyxFQUFFLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQztBQUN4QixZQUFRLEVBQUUsRUFBRTtBQUNaLFlBQVEsRUFBRSxDQUNSLDBCQUEwQixFQUMxQixrQkFBa0IsRUFDbEIsUUFBUSxDQUNUO0FBQ0QsY0FBVSxFQUFFO0FBQ1YsZ0JBQVUsRUFBRSxDQUFDLFVBQVUsRUFBRSxnQkFBZ0IsRUFBRSxRQUFRLEVBQUUs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AgICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICAgIHF1ZXJ5OiB7XG4gICAgICAgICAgLy8gcG9wdWxhdGVkIGJ5IGEgZ2xvYmFsIHJ1bGVcbiAgICAgICAgfVxuICAgICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/count.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACjC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,0BAA0B,EAC1B,kBAAkB,EAClB,QAAQ,CACT;AACD,cAAU,EAAE;AACV,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,aAAO,EAAE,EAAE;AACX,eAAS,EAAE,GAAG;AACd,qBAAe,EAAE,EAAE;KACpB;AACD,2BAAuB,EAAE;AACvB,WAAK,EAAE;;OAEN;KACF;GACJ,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/count.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_count', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_count\",\n \"{indices}/_count\",\n \"_count\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n min_score: 1.0,\n terminate_after: 10,\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/document.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_doc', {\n methods: ['GET'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_get_doc_source', {\n methods: ['GET'],\n patterns: [\"{index}/{type}/{id}/_source\"],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_delete_doc', {\n methods: ['DELETE'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\"\n }\n });\n api.addEndpointDescription('index_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('create_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/{type}/{id}/_create\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('index_doc_no_id', {\n methods: ['POST'],\n patterns: [\"{index}/{type}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n\n api.addEndpointDescription('_update', {\n methods: ['POST'],\n patterns: [\"{index}/{type}/{id}/_update\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"force\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\",\n \"retry_on_conflict\": 3,\n \"fields\": \"\"\n },\n data_autocomplete_rules: {\n \"script\": {\n // populated by a global rule\n },\n \"doc\": {},\n \"upsert\": {},\n \"scripted_upsert\": { __one_of: [true, false] }\n }\n\n });\n\n api.addEndpointDescription('_put_script', {\n methods: ['POST', 'PUT'],\n patterns: [\"_scripts/{lang}/{id}\", \"_scripts/{lang}/{id}/_create\"],\n url_components: {\n \"lang\": [\"groovy\", \"expressions\"]\n },\n data_autocomplete_rules: {\n \"script\": \"\"\n }\n });\n\n api.addEndpointDescription('_termvectors', {\n methods: ['GET', 'POST'],\n patterns: [\"{index}/{type}/_termvectors\"],\n priority: 10, // collision with get doc\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n offsets: { __one_of: [false, true] },\n payloads: { __one_of: [false, true] },\n positions: { __one_of: [false, true] },\n term_statistics: { __one_of: [true, false] },\n field_statistics: { __one_of: [false, true] },\n dfs: { __one_of: [true, false] },\n per_field_analyzer: {\n __template: { \"FIELD\": \"\" },\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n doc: {},\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n api.addEndpointDescription('_termvectors_id', {\n methods: ['GET', 'POST'],\n patterns: [\"{index}/{type}/{id}/_termvectors\"],\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n offsets: { __one_of: [false, true] },\n payloads: { __one_of: [false, true] },\n positions: { __one_of: [false, true] },\n term_statistics: { __one_of: [true, false] },\n field_statistics: { __one_of: [false, true] },\n dfs: { __one_of: [true, false] },\n per_field_analyzer: {\n __template: { \"FIELD\": \"\" },\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvZG9jdW1lbnQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxVQUFVLEVBQUU7QUFDckMsV0FBTyxFQUFFLENBQUMsS0FBSyxDQUFDO0FBQ2hCLFlBQVEsRUFBRSxDQUNSLHFCQUFxQixDQUN0QjtBQUNELGNBQVUsRUFBRTtBQUNWLGVBQVMsRUFBRSxDQUFDO0FBQ1osZUFBUyxFQUFFLEVBQUU7QUFDYixjQUFRLEVBQUUsRUFBRTtBQUNaLGVBQVMsRUFBRSxFQUFFO0FBQ2IsdUJBQWlCLEVBQUUsRUFBRTtBQUNyQix1QkFBaUIsRUFBRSxFQUFFO0tBQ3RCO0dBQ0YsQ0FBQyxDQUFDO0FBQ0gsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGlCQUFpQixFQUFFO0FBQzVDLFdBQU8sRUFBRSxDQUFDLEtBQUssQ0FBQztBQUNoQixZQUFRLEVBQUUsQ0FDUiw2QkFBNkIsQ0FDOUI7QUFD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dLFxuICAgICAgZmlsdGVyOiB7IC8vIFRPRE86IEV4Y2x1ZGUgZnJvbSBnbG9iYWwgZmlsdGVyIHJ1bGVzXG4gICAgICAgIFwibWF4X251bV90ZXJtc1wiOiAxLFxuICAgICAgICBcIm1pbl90ZXJtX2ZyZXFcIjogMSxcbiAgICAgICAgXCJtYXhfdGVybV9mcmVxXCI6IDEsXG4gICAgICAgIFwibWluX2RvY19mcmVxXCI6IDEsXG4gICAgICAgIFwibWF4X2RvY19mcmVxXCI6IDEsXG4gICAgICAgIFwibWluX3dvcmRfbGVuZ3RoXCI6IDEsXG4gICAgICAgIFwibWF4X3dvcmRfbGVuZ3RoXCI6IDFcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/document.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,UAAU,EAAE;AACrC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,qBAAqB,CACtB;AACD,cAAU,EAAE;AACV,eAAS,EAAE,CAAC;AACZ,eAAS,EAAE,EAAE;AACb,cAAQ,EAAE,EAAE;AACZ,eAAS,EAAE,EAAE;AACb,uBAAiB,EAAE,EAAE;AACrB,uBAAiB,EAAE,EAAE;KACtB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,6BAA6B,CAC9B;AACD,cAAU,EAAE;AACV,eAAS,EAAE,CAAC;AACZ,eAAS,EAAE,EAAE;AACb,cAAQ,EAAE,EAAE;AACZ,uBAAiB,EAAE,EAAE;AACrB,uBAAiB,EAAE,EAAE;KACtB;GACF,CAAC,CAAC;AACH,KAAG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KAAK,CAAC,EAAC;AAC1C,sBAAgB,EAAE,EAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAC;AAC3C,SAAG,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;AAC9B,wBAAkB,EAAE;AAClB,kBAAU,EAAE,EAAC,OAAO,EAAE,EAAE,EAAC;AACzB,iBAAS,EAAE,EAAE;OACd;AACD,aAAO,EAAE,EAAE;AACX,aAAO,EAAE,CAAC;AACV,kBAAY,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,CAAC;AAC9E,YAAM,EAAE;AACN,uBAAe,EAAE,CAAC;AAClB,uBAAe,EAAE,CAAC;AAClB,uBAAe,EAAE,CAAC;AAClB,sBAAc,EAAE,CAAC;AACjB,sBAAc,EAAE,CAAC;AACjB,yBAAiB,EAAE,CAAC;AACpB,yBAAiB,EAAE,CAAC;OACrB;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/document.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_get_doc', {\n methods: ['GET'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_get_doc_source', {\n methods: ['GET'],\n patterns: [\n \"{index}/{type}/{id}/_source\"\n ],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_delete_doc', {\n methods: ['DELETE'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\"\n }\n });\n api.addEndpointDescription('index_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('create_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/{type}/{id}/_create\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('index_doc_no_id', {\n methods: ['POST'],\n patterns: [\n \"{index}/{type}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n\n api.addEndpointDescription('_update', {\n methods: ['POST'],\n patterns: [\n \"{index}/{type}/{id}/_update\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"force\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\",\n \"retry_on_conflict\": 3,\n \"fields\": \"\"\n },\n data_autocomplete_rules: {\n \"script\": {\n // populated by a global rule\n },\n \"doc\": {},\n \"upsert\": {},\n \"scripted_upsert\": {__one_of: [true, false]}\n }\n\n });\n\n api.addEndpointDescription('_put_script', {\n methods: ['POST', 'PUT'],\n patterns: [\n \"_scripts/{lang}/{id}\",\n \"_scripts/{lang}/{id}/_create\"\n ],\n url_components: {\n \"lang\": [\n \"groovy\",\n \"expressions\"\n ]\n },\n data_autocomplete_rules: {\n \"script\": \"\"\n }\n });\n\n api.addEndpointDescription('_termvectors', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{index}/{type}/_termvectors\"\n ],\n priority: 10, // collision with get doc\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\"\n ],\n offsets: {__one_of: [false, true]},\n payloads: {__one_of: [false, true]},\n positions: {__one_of: [false, true]},\n term_statistics: {__one_of: [true, false]},\n field_statistics: {__one_of: [false, true]},\n dfs: {__one_of: [true, false]},\n per_field_analyzer: {\n __template: {\"FIELD\": \"\"},\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n doc: {},\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n api.addEndpointDescription('_termvectors_id', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{index}/{type}/{id}/_termvectors\"\n ],\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\"\n ],\n offsets: {__one_of: [false, true]},\n payloads: {__one_of: [false, true]},\n positions: {__one_of: [false, true]},\n term_statistics: {__one_of: [true, false]},\n field_statistics: {__one_of: [false, true]},\n dfs: {__one_of: [true, false]},\n per_field_analyzer: {\n __template: {\"FIELD\": \"\"},\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_field_stats', {\n methods: ['GET', 'POST'],\n patterns: [\"_field_stats\", \"{indices}/_field_stats\"],\n url_params: {\n fields: [],\n level: [\"cluster\", \"indices\"],\n ignore_unavailable: [\"true\", \"false\"],\n allow_no_indices: [false, true],\n expand_wildcards: [\"open\", \"closed\", \"none\", \"all\"]\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n index_constraints: {\n \"{field}\": {\n min_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n },\n max_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n }\n },\n __template: {\n \"FIELD\": {\n min_value: {\n gt: \"MIN\"\n },\n max_value: {\n lt: \"MAX\"\n }\n }\n }\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvZmllbGRfc3RhdHMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxjQUFjLEVBQUU7QUFDekMsV0FBTyxFQUFFLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQztBQUN4QixZQUFRLEVBQUUsQ0FDUixjQUFjLEVBQ2Qsd0JBQXdCLENBQ3pCO0FBQ0QsY0FBVSxFQUFFO0FBQ1YsWUFBTSxFQUFFLEVBQUU7QUFDVixXQUFLLEVBQUUsQ0FBQyxTQUFTLEVBQUUsU0FBUyxDQUFDO0FBQzdCLHdCQUFrQixFQUFFLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQztBQUNyQyxzQkFBZ0IsRUFBRSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUM7QUFDL0Isc0JBQWdCLEVBQU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llbGRfc3RhdHNcIixcbiAgICAgIFwie2luZGljZXN9L19maWVsZF9zdGF0c1wiXG4gICAgXSxcbiAgICB1cmxfcGFyYW1zOiB7XG4gICAgICBmaWVsZHM6IFtdLFxuICAgICAgbGV2ZWw6IFtcImNsdXN0ZXJcIiwgXCJpbmRpY2VzXCJdLFxuICAgICAgaWdub3JlX3VuYXZhaWxhYmxlOiBbXCJ0cnVlXCIsIFwiZmFsc2VcIl0sXG4gICAgICBhbGxvd19ub19pbmRpY2VzOiBbZmFsc2UsIHRydWVdLFxuICAgICAgZXhwYW5kX3dpbGRjYXJkczogW1wib3BlblwiLCBcImNsb3NlZFwiLCBcIm5vbmVcIiwgXCJhbGxcIl1cbiAgICB9LFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBmaWVsZHM6IFtcbiAgICAgICAgXCJ7ZmllbGR9XCIsXG4gICAgICBdLFxuICAgICAgaW5kZXhfY29uc3RyYWludHM6IHtcbiAgICAgICAgXCJ7ZmllbGR9XCI6IHtcbiAgICAgICAgICBtaW5fdmFsdWU6IHtcbiAgICAgICAgICAgIGd0OiBcIk1JTlwiLFxuICAgICAgICAgICAgZ3RlOiBcIk1BWFwiLFxuICAgICAgICAgICAgbHQ6IFwiTUlOXCIsXG4gICAgICAgICAgICBsdGU6IFwiTUFYXCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIG1heF92YWx1ZToge1xuICAgICAgICAgICAgZ3Q6IFwiTUlOXCIsXG4gICAgICAgICAgICBndGU6IFwiTUFYXCIsXG4gICAgICAgICAgICBsdDogXCJNSU5cIixcbiAgICAgICAgICAgIGx0ZTogXCJNQVhcIlxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIFwiRklFTERcIjoge1xuICAgICAgICAgICAgbWluX3ZhbHVlOiB7XG4gICAgICAgICAgICAgIGd0OiBcIk1JTlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWF4X3ZhbHVlOiB7XG4gICAgICAgICAgICAgIGx0OiBcIk1BWFwiXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,CACR,cAAc,EACd,wBAAwB,CACzB;AACD,cAAU,EAAE;AACV,YAAM,EAAE,EAAE;AACV,WAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;AAC7B,wBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AACrC,sBAAgB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/B,sBAAgB,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC;KACpD;AACD,2BAAuB,EAAE;AACvB,YAAM,EAAE,CACN,SAAS,CACV;AACD,uBAAiB,EAAE;AACjB,iBAAS,EAAE;AACT,mBAAS,EAAE;AACT,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;AACV,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;WACX;AACD,mBAAS,EAAE;AACT,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;AACV,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;WACX;SACF;AACD,kBAAU,EAAE;AACV,iBAAO,EAAE;AACP,qBAAS,EAAE;AACT,gBAAE,EAAE,KAAK;aACV;AACD,qBAAS,EAAE;AACT,gBAAE,EAAE,KAAK;aACV;WACF;SACF;OACF;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_field_stats', {\n methods: ['GET', 'POST'],\n patterns: [\n \"_field_stats\",\n \"{indices}/_field_stats\"\n ],\n url_params: {\n fields: [],\n level: [\"cluster\", \"indices\"],\n ignore_unavailable: [\"true\", \"false\"],\n allow_no_indices: [false, true],\n expand_wildcards: [\"open\", \"closed\", \"none\", \"all\"]\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\",\n ],\n index_constraints: {\n \"{field}\": {\n min_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n },\n max_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n }\n },\n __template: {\n \"FIELD\": {\n min_value: {\n gt: \"MIN\"\n },\n max_value: {\n lt: \"MAX\"\n }\n }\n }\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/filter.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar filters = {};\n\nfilters.and = {\n __template: {\n filters: [{}]\n },\n filters: [{\n __scope_link: '.'\n }]\n};\n\nfilters.bool = {\n __scope_link: 'GLOBAL.query'\n};\n\nfilters.exists = {\n __template: {\n 'field': 'FIELD_NAME'\n },\n 'field': '{field}'\n};\n\nfilters.ids = {\n __template: {\n 'values': ['ID']\n },\n 'type': '{type}',\n 'values': ['']\n};\n\nfilters.limit = {\n __template: {\n value: 100\n },\n value: 100\n};\n\nfilters.type = {\n __template: {\n value: 'TYPE'\n },\n value: '{type}'\n};\n\nfilters.geo_bounding_box = {\n __template: {\n 'FIELD': {\n 'top_left': {\n 'lat': 40.73,\n 'lon': -74.1\n },\n 'bottom_right': {\n 'lat': 40.717,\n 'lon': -73.99\n }\n }\n },\n\n '{field}': {\n top_left: {\n lat: 40.73,\n lon: -74.1\n },\n bottom_right: {\n lat: 40.73,\n lon: -74.1\n }\n },\n type: {\n __one_of: ['memory', 'indexed']\n }\n};\n\nfilters.geo_distance = {\n __template: {\n distance: 100,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n distance: 100,\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n optimize_bbox: {\n __one_of: ['memory', 'indexed', 'none']\n },\n '{field}': {\n lat: 40.73,\n lon: -74.1\n }\n};\n\nfilters.geo_distance_range = {\n __template: {\n from: 100,\n to: 200,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n from: 100,\n to: 200,\n\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n include_lower: {\n __one_of: [true, false]\n },\n include_upper: {\n __one_of: [true, false]\n },\n\n '{field}': {\n lat: 40.73,\n lon: -74.1\n }\n};\n\nfilters.geo_polygon = {\n __template: {\n 'FIELD': {\n 'points': [{\n lat: 40.73,\n lon: -74.1\n }, {\n lat: 40.83,\n lon: -75.1\n }]\n }\n },\n '{field}': {\n points: [{\n lat: 40.73,\n lon: -74.1\n }]\n }\n};\n\nfilters.geo_shape = {\n __template: {\n 'FIELD': {\n shape: {\n type: 'envelope',\n coordinates: [[-45, 45], [45, -45]]\n },\n 'relation': 'within'\n }\n },\n '{field}': {\n shape: {\n type: '',\n coordinates: []\n },\n indexed_shape: {\n id: '',\n index: '{index}',\n type: '{type}',\n shape_field_name: 'shape'\n },\n relation: {\n __one_of: ['within', 'intersects', 'disjoint']\n }\n }\n};\n\nfilters.has_child = {\n __template: {\n type: 'TYPE',\n filter: {}\n },\n type: '{type}',\n query: {},\n filter: {},\n _scope: '',\n min_children: 1,\n max_children: 10\n};\n\nfilters.has_parent = {\n __template: {\n parent_type: 'TYPE',\n filter: {}\n },\n parent_type: '{type}',\n query: {},\n filter: {},\n _scope: ''\n};\n\nfilters.m = filters.missing = {\n __template: {\n field: 'FIELD'\n },\n existence: {\n __one_of: [true, false]\n },\n null_value: {\n __one_of: [true, false]\n },\n field: '{field}'\n};\n\nfilters.not = {\n __template: {\n filter: {}\n },\n filter: {}\n};\n\nfilters.range = {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n \"{field}\": {\n gte: 1,\n gt: 1,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n \"format\": \"dd/MM/yyyy||yyyy\",\n execution: { __one_of: [\"index\", \"fielddata\"] }\n }\n};\n\nfilters.or = {\n __template: {\n filters: [{}]\n },\n filters: [{\n __scope_link: '.'\n }]\n};\n\nfilters.prefix = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\nfilters.query = {\n // global query\n};\n\nfilters.script = {\n __template: {\n script: {}\n },\n script: {\n // populated by a global rule\n }\n};\n\nfilters.term = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\nfilters.terms = {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n field: ['{field}'],\n execution: {\n __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']\n }\n};\n\nfilters.nested = {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n query: {},\n path: '',\n _name: ''\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('filter', filters);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvZmlsdGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxPQUFPLEdBQUcsRUFBRSxDQUFDOztBQUVqQixPQUFPLENBQUMsR0FBRyxHQUFHO0FBQ1osWUFBVSxFQUFFO0FBQ1YsV0FBTyxFQUFFLENBQ1AsRUFBRSxDQUNIO0dBQ0Y7QUFDRCxTQUFPLEVBQUUsQ0FDUDtBQUNFLGdCQUFZLEVBQUUsR0FBRztHQUNsQixDQUNGO0NBQ0YsQ0FBQzs7QUFHRixPQUFPLENBQUMsSUFBSSxHQUFHO0FBQ2IsY0FBWSxFQUFFLGNBQWM7Q0FDN0IsQ0FBQzs7QUFHRixPQUFPLENBQUMsTUFBTSxHQUFHO0FBQ2YsWUFBVSxFQUFFO0FBQ1YsV0FBTyxFQUFFLFlBQVk7R0FDdEI7QUFDRCxTQUFPLEVBQUUsU0FBUztDQUNuQixDQUFDOztBQUdGLE9BQU8sQ0FBQyxHQUFHLEdBQUc7QUFDWixZQUFVLEVBQUU7QUFDVixZQUFRLEVBQUUsQ0FBQyxJQUFJLENBQUM7R0FDakI7QUFDRCxRQUFNLEVBQUUsUUFBUTtBQUNoQixVQUFRLEVBQUUsQ0FBQyxFQUFFLENBQUM7Q0FDZixDQUFDOztBQUdGLE9BQU8sQ0FBQyxLQUFLLEdBQUc7QUFDZCxZQUFVLEVBQUU7QUFDVixTQUFLLEVBQUUsR0FBR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G4gIGluY2x1ZGVfdXBwZXI6IHtcbiAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICB9LFxuXG4gICd7ZmllbGR9Jzoge1xuICAgIGxhdDogNDAuNzMsXG4gICAgbG9uOiAtNzQuMVxuICB9XG59O1xuXG5cbmZpbHRlcnMuZ2VvX3BvbHlnb24gPSB7XG4gIF9fdGVtcGxhdGU6IHtcbiAgICAnRklFTEQnOiB7XG4gICAgICAncG9pbnRzJzogW1xuICAgICAgICB7XG4gICAgICAgICAgbGF0OiA0MC43MyxcbiAgICAgICAgICBsb246IC03NC4xXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBsYXQ6IDQwLjgzLFxuICAgICAgICAgIGxvbjogLTc1LjFcbiAgICAgICAgfVxuICAgICAgXVxuICAgIH1cbiAgfSxcbiAgJ3tmaWVsZH0nOiB7XG4gICAgcG9pbnRzOiBbXG4gICAgICB7XG4gICAgICAgIGxhdDogNDAuNzMsXG4gICAgICAgIGxvbjogLTc0LjFcbiAgICAgIH1cbiAgICBdXG4gIH1cbn07XG5cblxuZmlsdGVycy5nZW9fc2hhcGUgPSB7XG4gIF9fdGVtcGxhdGU6IHtcbiAgICAnRklFTEQnOiB7XG4gICAgICBzaGFwZToge1xuICAgICAgICB0eXBlOiAnZW52ZWxvcGUnLFxuICAgICAgICBjb29yZGluYXRlczogW1xuICAgICAgICAgIFstNDUsIDQ1XSxcbiAgICAgICAgICBbNDUsIC00NV1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgICdyZWxhdGlvbic6ICd3aXRoaW4nXG4gICAgfVxuICB9LFxuICAne2ZpZWxkfSc6IHtcbiAgICBzaGFwZToge1xuICAgICAgdHlwZTogJycsXG4gICAgICBjb29yZGluYXRlczogW11cbiAgICB9LFxuICAgIGluZGV4ZWRfc2hhcGU6IHtcbiAgICAgIGlkOiAnJyxcbiAgICAgIGluZGV4OiAne2luZGV4fScsXG4gICAgICB0eXBlOiAne3R5cGV9Jyxcb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nVkFMVUUyJ11cbiAgfSxcbiAgZmllbGQ6IFsne2ZpZWxkfSddLFxuICBleGVjdXRpb246IHtcbiAgICBfX29uZV9vZjogWydwbGFpbicsICdib29sJywgJ2FuZCcsICdvcicsICdib29sX25vY2FjaGUnLCAnYW5kX25vY2FjaGUnLCAnb3Jfbm9jYWNoZSddXG4gIH1cbn07XG5cblxuZmlsdGVycy5uZXN0ZWQgPSB7XG4gIF9fdGVtcGxhdGU6IHtcbiAgICBwYXRoOiAncGF0aF90b19uZXN0ZWRfZG9jJyxcbiAgICBxdWVyeToge31cbiAgfSxcbiAgcXVlcnk6IHt9LFxuICBwYXRoOiAnJyxcbiAgX25hbWU6ICcnXG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChhcGkpIHtcbiAgYXBpLmFkZEdsb2JhbEF1dG9jb21wbGV0ZVJ1bGVzKCdmaWx0ZXInLCBmaWx0ZXJzKTtcbn07XG5cbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/filter.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,OAAO,GAAG,EAAE,CAAC;;AAEjB,OAAO,CAAC,GAAG,GAAG;AACZ,YAAU,EAAE;AACV,WAAO,EAAE,CACP,EAAE,CACH;GACF;AACD,SAAO,EAAE,CACP;AACE,gBAAY,EAAE,GAAG;GAClB,CACF;CACF,CAAC;;AAGF,OAAO,CAAC,IAAI,GAAG;AACb,cAAY,EAAE,cAAc;CAC7B,CAAC;;AAGF,OAAO,CAAC,MAAM,GAAG;AACf,YAAU,EAAE;AACV,WAAO,EAAE,YAAY;GACtB;AACD,SAAO,EAAE,SAAS;CACnB,CAAC;;AAGF,OAAO,CAAC,GAAG,GAAG;AACZ,YAAU,EAAE;AACV,YAAQ,EAAE,CAAC,IAAI,CAAC;GACjB;AACD,QAAM,EAAE,QAAQ;AAChB,UAAQ,EAAE,CAAC,EAAE,C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AAE,EAAE;AACR,OAAK,EAAE,EAAE;CACV,CAAC;;AAEF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,0BAA0B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;CACnD,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/filter.js", + "sourcesContent": [ + "var filters = {};\n\nfilters.and = {\n __template: {\n filters: [\n {}\n ]\n },\n filters: [\n {\n __scope_link: '.'\n }\n ],\n};\n\n\nfilters.bool = {\n __scope_link: 'GLOBAL.query'\n};\n\n\nfilters.exists = {\n __template: {\n 'field': 'FIELD_NAME'\n },\n 'field': '{field}'\n};\n\n\nfilters.ids = {\n __template: {\n 'values': ['ID']\n },\n 'type': '{type}',\n 'values': ['']\n};\n\n\nfilters.limit = {\n __template: {\n value: 100\n },\n value: 100\n};\n\n\nfilters.type = {\n __template: {\n value: 'TYPE'\n },\n value: '{type}'\n};\n\n\nfilters.geo_bounding_box = {\n __template: {\n 'FIELD': {\n 'top_left': {\n 'lat': 40.73,\n 'lon': -74.1\n },\n 'bottom_right': {\n 'lat': 40.717,\n 'lon': -73.99\n }\n }\n },\n\n '{field}': {\n top_left: {\n lat: 40.73,\n lon: -74.1\n },\n bottom_right: {\n lat: 40.73,\n lon: -74.1\n }\n },\n type: {\n __one_of: ['memory', 'indexed']\n },\n};\n\n\nfilters.geo_distance = {\n __template: {\n distance: 100,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n distance: 100,\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n optimize_bbox: {\n __one_of: ['memory', 'indexed', 'none']\n },\n '{field}': {\n lat: 40.73,\n lon: -74.1\n },\n};\n\n\nfilters.geo_distance_range = {\n __template: {\n from: 100,\n to: 200,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n from: 100,\n to: 200,\n\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n include_lower: {\n __one_of: [true, false]\n },\n include_upper: {\n __one_of: [true, false]\n },\n\n '{field}': {\n lat: 40.73,\n lon: -74.1\n }\n};\n\n\nfilters.geo_polygon = {\n __template: {\n 'FIELD': {\n 'points': [\n {\n lat: 40.73,\n lon: -74.1\n },\n {\n lat: 40.83,\n lon: -75.1\n }\n ]\n }\n },\n '{field}': {\n points: [\n {\n lat: 40.73,\n lon: -74.1\n }\n ]\n }\n};\n\n\nfilters.geo_shape = {\n __template: {\n 'FIELD': {\n shape: {\n type: 'envelope',\n coordinates: [\n [-45, 45],\n [45, -45]\n ]\n },\n 'relation': 'within'\n }\n },\n '{field}': {\n shape: {\n type: '',\n coordinates: []\n },\n indexed_shape: {\n id: '',\n index: '{index}',\n type: '{type}',\n shape_field_name: 'shape'\n },\n relation: {\n __one_of: ['within', 'intersects', 'disjoint']\n }\n }\n};\n\n\nfilters.has_child = {\n __template: {\n type: 'TYPE',\n filter: {}\n },\n type: '{type}',\n query: {},\n filter: {},\n _scope: '',\n min_children: 1,\n max_children: 10\n};\n\n\nfilters.has_parent = {\n __template: {\n parent_type: 'TYPE',\n filter: {}\n },\n parent_type: '{type}',\n query: {},\n filter: {},\n _scope: ''\n};\n\n\nfilters.m = filters.missing = {\n __template: {\n field: 'FIELD'\n },\n existence: {\n __one_of: [true, false]\n },\n null_value: {\n __one_of: [true, false]\n },\n field: '{field}'\n};\n\n\nfilters.not = {\n __template: {\n filter: {}\n },\n filter: {}\n};\n\n\nfilters.range = {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n \"{field}\": {\n gte: 1,\n gt: 1,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n \"format\": \"dd/MM/yyyy||yyyy\",\n execution: {__one_of: [\"index\", \"fielddata\"]}\n }\n};\n\n\nfilters.or = {\n __template: {\n filters: [\n {}\n ]\n },\n filters: [\n {\n __scope_link: '.'\n }\n ]\n};\n\n\nfilters.prefix = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\n\nfilters.query = {\n // global query\n};\n\nfilters.script = {\n __template: {\n script: {}\n },\n script: {\n // populated by a global rule\n }\n};\n\n\nfilters.term = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\n\nfilters.terms = {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n field: ['{field}'],\n execution: {\n __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']\n }\n};\n\n\nfilters.nested = {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n query: {},\n path: '',\n _name: ''\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('filter', filters);\n};\n\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/nodes.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_nodes/hot_threads', {\n methods: ['GET'],\n patterns: [\"_nodes/hot_threads\", \"_nodes/{nodes}/hot_threads\"]\n });\n api.addEndpointDescription('_nodes/info', {\n patterns: [\"_nodes\", \"_nodes/{metrics}\", \"_nodes/{nodes}\", \"_nodes/{nodes}/{metrics}\", \"_nodes/{nodes}/info/{metrics}\"],\n url_components: {\n \"metrics\": [\"settings\", \"os\", \"process\", \"jvm\", \"thread_pool\", \"network\", \"transport\", \"http\", \"plugins\", \"_all\"]\n }\n });\n api.addEndpointDescription('_nodes/stats', {\n patterns: [\"_nodes/stats\", \"_nodes/stats/{metrics}\", \"_nodes/stats/{metrics}/{index_metric}\", \"_nodes/{nodes}/stats\", \"_nodes/{nodes}/stats/{metrics}\", \"_nodes/{nodes}/stats/{metrics}/{index_metric}\"],\n url_components: {\n \"metrics\": [\"os\", \"jvm\", \"thread_pool\", \"network\", \"fs\", \"transport\", \"http\", \"indices\", \"process\", \"breaker\", \"_all\"],\n \"index_metric\": [\"store\", \"indexing\", \"get\", \"search\", \"merge\", \"flush\", \"refresh\", \"filter_cache\", \"fielddata\", \"docs\", \"warmer\", \"percolate\", \"completion\", \"segments\", \"translog\", \"query_cache\", \"_all\"]\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvbm9kZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxvQkFBb0IsRUFBRTtBQUMvQyxXQUFPLEVBQUUsQ0FBQyxLQUFLLENBQUM7QUFDaEIsWUFBUSxFQUFFLENBQ1Isb0JBQW9CLEVBQ3BCLDRCQUE0QixDQUM3QjtHQUNGLENBQUMsQ0FBQztBQUNILEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxhQUFhLE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uZHBvaW50RGVzY3JpcHRpb24oJ19ub2Rlcy9zdGF0cycsIHtcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJfbm9kZXMvc3RhdHNcIixcbiAgICAgIFwiX25vZGVzL3N0YXRzL3ttZXRyaWNzfVwiLFxuICAgICAgXCJfbm9kZXMvc3RhdHMve21ldHJpY3N9L3tpbmRleF9tZXRyaWN9XCIsXG4gICAgICBcIl9ub2Rlcy97bm9kZXN9L3N0YXRzXCIsXG4gICAgICBcIl9ub2Rlcy97bm9kZXN9L3N0YXRzL3ttZXRyaWNzfVwiLFxuICAgICAgXCJfbm9kZXMve25vZGVzfS9zdGF0cy97bWV0cmljc30ve2luZGV4X21ldHJpY31cIlxuICAgIF0sXG4gICAgdXJsX2NvbXBvbmVudHM6IHtcbiAgICAgIFwibWV0cmljc1wiOiBbXG4gICAgICAgIFwib3NcIixcbiAgICAgICAgXCJqdm1cIixcbiAgICAgICAgXCJ0aHJlYWRfcG9vbFwiLFxuICAgICAgICBcIm5ldHdvcmtcIixcbiAgICAgICAgXCJmc1wiLFxuICAgICAgICBcInRyYW5zcG9ydFwiLFxuICAgICAgICBcImh0dHBcIixcbiAgICAgICAgXCJpbmRpY2VzXCIsXG4gICAgICAgIFwicHJvY2Vzc1wiLFxuICAgICAgICBcImJyZWFrZXJcIixcbiAgICAgICAgXCJfYWxsXCJcbiAgICAgIF0sXG4gICAgICBcImluZGV4X21ldHJpY1wiOiBbXG4gICAgICAgIFwic3RvcmVcIixcbiAgICAgICAgXCJpbmRleGluZ1wiLFxuICAgICAgICBcImdldFwiLFxuICAgICAgICBcInNlYXJjaFwiLFxuICAgICAgICBcIm1lcmdlXCIsXG4gICAgICAgIFwiZmx1c2hcIixcbiAgICAgICAgXCJyZWZyZXNoXCIsXG4gICAgICAgIFwiZmlsdGVyX2NhY2hlXCIsXG4gICAgICAgIFwiZmllbGRkYXRhXCIsXG4gICAgICAgIFwiZG9jc1wiLFxuICAgICAgICBcIndhcm1lclwiLFxuICAgICAgICBcInBlcmNvbGF0ZVwiLFxuICAgICAgICBcImNvbXBsZXRpb25cIixcbiAgICAgICAgXCJzZWdtZW50c1wiLFxuICAgICAgICBcInRyYW5zbG9nXCIsXG4gICAgICAgIFwicXVlcnlfY2FjaGVcIixcbiAgICAgICAgXCJfYWxsXCJcbiAgICAgIF1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/nodes.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,oBAAoB,EAAE;AAC/C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,oBAAoB,EACpB,4BAA4B,CAC7B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,+BAA+B,CAChC;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,UAAU,EACV,IAAI,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,CACP;KACF;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,YAAQ,EAAE,CACR,cAAc,EACd,wBAAwB,EACxB,uCAAuC,EACvC,sBAAsB,EACtB,gCAAgC,EAChC,+CAA+C,CAChD;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,IAAI,EACJ,KAAK,EACL,aAAa,EACb,SAAS,EACT,IAAI,EACJ,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,CACP;AACD,oBAAc,EAAE,CACd,OAAO,EACP,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,MAAM,CACP;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/nodes.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_nodes/hot_threads', {\n methods: ['GET'],\n patterns: [\n \"_nodes/hot_threads\",\n \"_nodes/{nodes}/hot_threads\"\n ]\n });\n api.addEndpointDescription('_nodes/info', {\n patterns: [\n \"_nodes\",\n \"_nodes/{metrics}\",\n \"_nodes/{nodes}\",\n \"_nodes/{nodes}/{metrics}\",\n \"_nodes/{nodes}/info/{metrics}\"\n ],\n url_components: {\n \"metrics\": [\n \"settings\",\n \"os\",\n \"process\",\n \"jvm\",\n \"thread_pool\",\n \"network\",\n \"transport\",\n \"http\",\n \"plugins\",\n \"_all\"\n ]\n }\n });\n api.addEndpointDescription('_nodes/stats', {\n patterns: [\n \"_nodes/stats\",\n \"_nodes/stats/{metrics}\",\n \"_nodes/stats/{metrics}/{index_metric}\",\n \"_nodes/{nodes}/stats\",\n \"_nodes/{nodes}/stats/{metrics}\",\n \"_nodes/{nodes}/stats/{metrics}/{index_metric}\"\n ],\n url_components: {\n \"metrics\": [\n \"os\",\n \"jvm\",\n \"thread_pool\",\n \"network\",\n \"fs\",\n \"transport\",\n \"http\",\n \"indices\",\n \"process\",\n \"breaker\",\n \"_all\"\n ],\n \"index_metric\": [\n \"store\",\n \"indexing\",\n \"get\",\n \"search\",\n \"merge\",\n \"flush\",\n \"refresh\",\n \"filter_cache\",\n \"fielddata\",\n \"docs\",\n \"warmer\",\n \"percolate\",\n \"completion\",\n \"segments\",\n \"translog\",\n \"query_cache\",\n \"_all\"\n ]\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/globals.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('highlight', {\n pre_tags: {},\n post_tags: {},\n tags_schema: {},\n fields: {\n '{field}': {\n fragment_size: 20,\n number_of_fragments: 3\n }\n }\n });\n\n api.addGlobalAutocompleteRules('script', {\n __template: {\n inline: \"SCRIPT\"\n },\n inline: \"SCRIPT\",\n file: \"FILE_SCRIPT_NAME\",\n id: \"SCRIPT_ID\",\n lang: \"\",\n params: {}\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvZ2xvYmFscy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLDBCQUEwQixDQUFDLFdBQVcsRUFBRTtBQUMxQyxZQUFRLEVBQUUsRUFB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gICAgX190ZW1wbGF0ZToge1xuICAgICAgaW5saW5lOiBcIlNDUklQVFwiXG4gICAgfSxcbiAgICBpbmxpbmU6IFwiU0NSSVBUXCIsXG4gICAgZmlsZTogXCJGSUxFX1NDUklQVF9OQU1FXCIsXG4gICAgaWQ6IFwiU0NSSVBUX0lEXCIsXG4gICAgbGFuZzogXCJcIixcbiAgICBwYXJhbXM6IHt9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/globals.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,0BAA0B,CAAC,WAAW,EAAE;AAC1C,YAAQ,EAAE,EAAE;AACZ,aAAS,EAAE,EAAE;AACb,eAAW,EAAE,EAAE;AACf,UAAM,EAAE;AACN,eAAS,EAAE;AACT,qBAAa,EAAE,EAAE;AACjB,2BAAmB,EAAE,CAAC;OACvB;KACF;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,0BAA0B,CAAC,QAAQ,EAAE;AACvC,cAAU,EAAE;AACV,YAAM,EAAE,QAAQ;KACjB;AACD,UAAM,EAAE,QAAQ;AAChB,QAAI,EAAE,kBAAkB;AACxB,MAAE,EAAE,WAAW;AACf,QAAI,EAAE,EAAE;AACR,UAAM,EAAE,EAAE;GACX,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/globals.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addGlobalAutocompleteRules('highlight', {\n pre_tags: {},\n post_tags: {},\n tags_schema: {},\n fields: {\n '{field}': {\n fragment_size: 20,\n number_of_fragments: 3\n }\n }\n });\n\n api.addGlobalAutocompleteRules('script', {\n __template: {\n inline: \"SCRIPT\"\n },\n inline: \"SCRIPT\",\n file: \"FILE_SCRIPT_NAME\",\n id: \"SCRIPT_ID\",\n lang: \"\",\n params: {}\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/indices.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_refresh', {\n methods: ['POST'],\n patterns: [\"_refresh\", \"{indices}/_refresh\"]\n });\n\n api.addEndpointDescription('_flush', {\n methods: ['POST'],\n patterns: [\"_flush\", \"{indices}/_flush\"],\n url_params: {\n wait_if_ongoing: [true, false],\n force: [true, false]\n }\n });\n\n api.addEndpointDescription('_flush_synced', {\n methods: ['POST'],\n patterns: [\"_flush/synced\", \"{indices}/_flush/synced\"]\n });\n\n api.addEndpointDescription('_stats', {\n patterns: [\"_stats\", \"_stats/{metrics}\", \"{indices}/_stats\", \"{indices}/_stats/{metrics}\"],\n url_components: {\n \"metrics\": [\"docs\", \"store\", \"indexing\", \"search\", \"get\", \"merge\", \"refresh\", \"flush\", \"warmer\", \"filter_cache\", \"percolate\", \"segments\", \"fielddata\", \"completion\", \"translog\", \"query_cache\", \"commit\", \"_all\"]\n },\n url_params: {\n \"fields\": [],\n \"types\": [],\n \"completion_fields\": [],\n \"fielddata_fields\": [],\n \"level\": [\"cluster\", \"indices\", \"shards\"]\n }\n\n });\n\n api.addEndpointDescription('_segments', {\n patterns: [\"{indices}/_segments\", \"_segments\"]\n });\n\n api.addEndpointDescription('_recovery', {\n patterns: [\"{indices}/_recovery\", \"_recovery\"],\n url_params: {\n detailed: \"__flag__\",\n active_only: \"__flag__\",\n human: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_analyze', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/_analyze\", \"_analyze\"],\n url_params: {\n \"analyzer\": \"\",\n \"char_filters\": [],\n \"field\": \"\",\n \"filters\": [],\n \"text\": \"\",\n \"tokenizer\": \"\"\n }\n });\n\n api.addEndpointDescription('_validate_query', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/_validate/query\", \"_validate/query\"],\n url_params: {\n explain: \"__flag__\",\n rewrite: \"__flag__\"\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n\n api.addEndpointDescription('_shard_stores', {\n methods: ['GET'],\n patterns: [\"{indices}/_shard_stores\", \"_shard_stores\"],\n url_params: {\n status: [\"green\", \"yellow\", \"red\", \"all\"]\n }\n });\n\n api.addEndpointDescription('__create_index__', {\n methods: ['PUT'],\n patterns: [\"{index}\"],\n data_autocomplete_rules: {\n mappings: {\n __scope_link: '_put_mapping'\n },\n settings: {\n __scope_link: '_put_settings'\n },\n aliases: {\n __template: {\n \"NAME\": {}\n }\n }\n }\n });\n\n api.addEndpointDescription('__delete_indices__', {\n methods: ['DELETE'],\n patterns: [\"{indices}\"]\n });\n\n api.addEndpointDescription('_get_index_settings', {\n methods: ['GET'],\n patterns: [\"{indices}/_settings\"],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_get_index', {\n methods: ['GET'],\n patterns: [\"{indices}\", \"{indices}/{feature}\"],\n url_components: {\n \"feature\": [\"_mappings\", \"_warmers\", \"_aliases\"]\n }\n });\n\n api.addEndpointDescription('_cache/clear', {\n patterns: [\"_cache/clear\", \"{indices}/_cache/clear\"]\n });\n\n api.addEndpointDescription('_upgrade', {\n methods: [\"POST\"],\n patterns: [\"_upgrade\", \"{indices}/_upgrade\"],\n url_params: {\n wait_for_completion: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_upgrade_status', {\n methods: [\"GET\"],\n patterns: [\"_upgrade\", \"{indices}/_upgrade\"]\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvaW5kaWNlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLFVBQVUsRUFBRTtBQUNyQyxXQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUM7QUFDakIsWUFBUSxFQUFFLENBQ1IsVUFBVSxFQUNWLG9CQUFvQixDQUNyQjtHQUNGLENBQUMsQ0FBQzs7QUFFSCxLQUFHLENBQUMsc0JBQXNCLENBQUMsUUFBUSxFQUFFO0FBQ25DLFdBQU8sRUFBRSxDQUFDLE1BQU0sQ0FBQztBQUNqQixZQUFRLEVBQUUsQ0FDUixRQUFRLEVBQ1Isa0JBQWtCLENBQ25CO0FBQ0QsY0FBVSxFQUFFO0FBQ1YscUJBQWUsRUFBRSxDQUFDLElBQUksRUFBRSxLQUFLLENBQUM7QUFDOUIsV0FBSyxFQUFFLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQztLQUNyQjtHQUNGLENBQUMsQ0FBQzs7QUFFSCxLQUFHLENBQUMsc0JBQXNCLENBQUMsZUFBZSxFQUFFO0FBQzFDLFdBQU8sRUFBRSxDQUFDLE1BQU0sQ0FBQztBQUNqQixZQUFR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cbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJ7aW5kaWNlc31cIixcbiAgICAgIFwie2luZGljZXN9L3tmZWF0dXJlfVwiXG4gICAgXSxcbiAgICB1cmxfY29tcG9uZW50czoge1xuICAgICAgXCJmZWF0dXJlXCI6IFtcbiAgICAgICAgXCJfbWFwcGluZ3NcIixcbiAgICAgICAgXCJfd2FybWVyc1wiLFxuICAgICAgICBcIl9hbGlhc2VzXCJcbiAgICAgIF1cbiAgICB9XG4gIH0pO1xuXG4gIGFwaS5hZGRFbmRwb2ludERlc2NyaXB0aW9uKCdfY2FjaGUvY2xlYXInLCB7XG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwiX2NhY2hlL2NsZWFyXCIsXG4gICAgICBcIntpbmRpY2VzfS9fY2FjaGUvY2xlYXJcIlxuICAgIF1cbiAgfSk7XG5cbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ191cGdyYWRlJywge1xuICAgIG1ldGhvZHM6IFtcIlBPU1RcIl0sXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwiX3VwZ3JhZGVcIixcbiAgICAgIFwie2luZGljZXN9L191cGdyYWRlXCJcbiAgICBdLFxuICAgIHVybF9wYXJhbXM6IHtcbiAgICAgIHdhaXRfZm9yX2NvbXBsZXRpb246IFwiX19mbGFnX19cIlxuICAgIH1cbiAgfSk7XG5cbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ191cGdyYWRlX3N0YXR1cycsIHtcbiAgICBtZXRob2RzOiBbXCJHRVRcIl0sXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwiX3VwZ3JhZGVcIixcbiAgICAgIFwie2luZGljZXN9L191cGdyYWRlXCJcbiAgICBdXG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/indices.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,C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,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/indices.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_refresh', {\n methods: ['POST'],\n patterns: [\n \"_refresh\",\n \"{indices}/_refresh\"\n ],\n });\n\n api.addEndpointDescription('_flush', {\n methods: ['POST'],\n patterns: [\n \"_flush\",\n \"{indices}/_flush\"\n ],\n url_params: {\n wait_if_ongoing: [true, false],\n force: [true, false]\n }\n });\n\n api.addEndpointDescription('_flush_synced', {\n methods: ['POST'],\n patterns: [\n \"_flush/synced\",\n \"{indices}/_flush/synced\"\n ]\n });\n\n api.addEndpointDescription('_stats', {\n patterns: [\n \"_stats\",\n \"_stats/{metrics}\",\n \"{indices}/_stats\",\n \"{indices}/_stats/{metrics}\",\n ],\n url_components: {\n \"metrics\": [\n \"docs\",\n \"store\",\n \"indexing\",\n \"search\",\n \"get\",\n \"merge\",\n \"refresh\",\n \"flush\",\n \"warmer\",\n \"filter_cache\",\n \"percolate\",\n \"segments\",\n \"fielddata\",\n \"completion\",\n \"translog\",\n \"query_cache\",\n \"commit\",\n \"_all\"\n ]\n },\n url_params: {\n \"fields\": [],\n \"types\": [],\n \"completion_fields\": [],\n \"fielddata_fields\": [],\n \"level\": [\"cluster\", \"indices\", \"shards\"]\n }\n\n });\n\n api.addEndpointDescription('_segments', {\n patterns: [\n \"{indices}/_segments\",\n \"_segments\"\n ]\n });\n\n api.addEndpointDescription('_recovery', {\n patterns: [\n \"{indices}/_recovery\",\n \"_recovery\"\n ],\n url_params: {\n detailed: \"__flag__\",\n active_only: \"__flag__\",\n human: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_analyze', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/_analyze\",\n \"_analyze\"\n ],\n url_params: {\n \"analyzer\": \"\",\n \"char_filters\": [],\n \"field\": \"\",\n \"filters\": [],\n \"text\": \"\",\n \"tokenizer\": \"\"\n }\n });\n\n api.addEndpointDescription('_validate_query', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/_validate/query\",\n \"_validate/query\"\n ],\n url_params: {\n explain: \"__flag__\",\n rewrite: \"__flag__\"\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n\n api.addEndpointDescription('_shard_stores', {\n methods: ['GET'],\n patterns: [\n \"{indices}/_shard_stores\",\n \"_shard_stores\"\n ],\n url_params: {\n status: [\"green\", \"yellow\", \"red\", \"all\"]\n }\n });\n\n api.addEndpointDescription('__create_index__', {\n methods: ['PUT'],\n patterns: [\n \"{index}\"\n ],\n data_autocomplete_rules: {\n mappings: {\n __scope_link: '_put_mapping'\n },\n settings: {\n __scope_link: '_put_settings'\n },\n aliases: {\n __template: {\n \"NAME\": {}\n }\n }\n }\n });\n\n api.addEndpointDescription('__delete_indices__', {\n methods: ['DELETE'],\n patterns: [\n \"{indices}\"\n ]\n });\n\n api.addEndpointDescription('_get_index_settings', {\n methods: ['GET',],\n patterns: [\n \"{indices}/_settings\",\n ],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_get_index', {\n methods: ['GET',],\n patterns: [\n \"{indices}\",\n \"{indices}/{feature}\"\n ],\n url_components: {\n \"feature\": [\n \"_mappings\",\n \"_warmers\",\n \"_aliases\"\n ]\n }\n });\n\n api.addEndpointDescription('_cache/clear', {\n patterns: [\n \"_cache/clear\",\n \"{indices}/_cache/clear\"\n ]\n });\n\n api.addEndpointDescription('_upgrade', {\n methods: [\"POST\"],\n patterns: [\n \"_upgrade\",\n \"{indices}/_upgrade\"\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_upgrade_status', {\n methods: [\"GET\"],\n patterns: [\n \"_upgrade\",\n \"{indices}/_upgrade\"\n ]\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/mappings.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\n\nvar INDEX_SETTING = {\n __one_of: ['analyzed', 'not_analyzed', 'no']\n},\n BOOLEAN = {\n __one_of: [true, false]\n};\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping\", \"{indices}/_mapping/{types}\", \"{indices}/{types}/_mapping\", \"_mapping\"]\n });\n api.addEndpointDescription('_get_field_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping/field/{fields}\", \"{indices}/_mapping/{type}/field/{fields}\"],\n url_params: {\n \"include_defaults\": \"__flag__\"\n }\n });\n api.addEndpointDescription('_delete_mapping', {\n methods: ['DELETE'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping\", \"{indices}/_mapping/{types}\", \"{indices}/{types}/_mapping\", \"_mapping\"]\n });\n api.addEndpointDescription('_put_type_mapping', {\n methods: ['PUT', 'POST'],\n patterns: [\"{indices}/{type}/_mapping\", \"{indices}/_mapping/{type}\"],\n priority: 10, // collides with put doc by id\n data_autocomplete_rules: {\n __template: {\n properties: {\n 'FIELD': {}\n }\n },\n '_source': {\n 'enabled': BOOLEAN\n },\n '_all': {\n 'enabled': BOOLEAN\n },\n '_field_names': {\n 'index': INDEX_SETTING\n },\n '_routing': {\n 'required': BOOLEAN\n },\n '_index': {\n 'enabled': BOOLEAN\n },\n '_parent': {\n __template: {\n 'type': ''\n },\n 'type': '{type}'\n },\n '_timestamp': {\n 'enabled': BOOLEAN,\n 'format': 'YYYY-MM-dd',\n 'default': \"\"\n },\n 'dynamic_date_formats': ['yyyy-MM-dd'],\n 'date_detection': BOOLEAN,\n 'numeric_detection': BOOLEAN,\n 'transform': {\n __template: {\n script: {}\n },\n __one_of: [{\n __scope_link: \"GLOBAL.script\"\n }, [{\n __scope_link: \"GLOBAL.script\"\n }]]\n\n },\n 'properties': {\n '*': {\n type: {\n __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean', 'binary', 'object', 'nested', \"geo_point\", \"geo_shape\"]\n },\n\n // strings\n store: BOOLEAN,\n index: INDEX_SETTING,\n term_vector: {\n __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']\n },\n boost: 1.0,\n null_value: '',\n omit_norms: {\n __one_of: [true, false]\n },\n index_options: {\n __one_of: ['docs', 'freqs', 'positions']\n },\n analyzer: 'standard',\n search_analyzer: 'standard',\n include_in_all: {\n __one_of: [false, true]\n },\n ignore_above: 10,\n position_increment_gap: 0,\n\n // numeric\n precision_step: 4,\n ignore_malformed: BOOLEAN,\n\n // geo_point\n lat_lon: {\n __one_of: [true, false]\n },\n geohash: {\n __one_of: [true, false]\n },\n geohash_precision: '1m',\n geohash_prefix: {\n __one_of: [true, false]\n },\n validate: {\n __one_of: [true, false]\n },\n validate_lat: {\n __one_of: [true, false]\n },\n validate_lon: {\n __one_of: [true, false]\n },\n normalize: {\n __one_of: [true, false]\n },\n normalize_lat: {\n __one_of: [true, false]\n },\n normalize_lon: {\n __one_of: [true, false]\n },\n\n // geo_shape\n tree: {\n __one_of: ['geohash', 'quadtree']\n },\n precision: '5km',\n tree_levels: 12,\n distance_error_pct: 0.025,\n orientation: 'ccw',\n\n // dates\n format: {\n __one_of: _.flatten([_.map(['date', 'date_time', 'date_time_no_millis', 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis', 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'week_date_time_no_millis'], function (s) {\n return ['basic_' + s, 'strict_' + s];\n }), ['date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction', 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis', 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis', 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis', 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year', 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second']])\n },\n\n fielddata: {\n filter: {\n regex: '',\n frequency: {\n min: 0.001,\n max: 0.1,\n min_segment_size: 500\n }\n }\n },\n similarity: {\n __one_of: ['default', 'BM25']\n },\n\n // objects\n properties: {\n __scope_link: '_put_mapping.{type}.properties'\n },\n\n // multi_field\n fields: {\n '*': {\n __scope_link: '_put_mapping.type.properties.field'\n }\n },\n copy_to: { __one_of: ['{field}', ['{field}']] },\n\n // nested\n include_in_parent: BOOLEAN,\n include_in_root: BOOLEAN\n }\n }\n }\n\n });\n api.addEndpointDescription('_put_mapping', {\n methods: ['PUT'],\n patterns: [\"{indices}/_mapping\"],\n data_autocomplete_rules: {\n '{type}': {\n __scope_link: '_put_type_mapping'\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci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J19kZWxldGVfbWFwcGluZycsIHtcbiAgICBtZXRob2RzOiBbJ0RFTEVURSddLFxuICAgIHByaW9yaXR5OiAxMCwgLy8gY29sbGlkZXMgd2l0aCBnZXQgZG9jIGJ5IGlkXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L19tYXBwaW5nXCIsXG4gICAgICBcIntpbmRpY2VzfS9fbWFwcGluZy97dHlwZXN9XCIsXG4gICAgICBcIntpbmRpY2VzfS97dHlwZXN9L19tYXBwaW5nXCIsXG4gICAgICBcIl9tYXBwaW5nXCJcbiAgICBdXG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3B1dF90eXBlX21hcHBpbmcnLCB7XG4gICAgbWV0aG9kczogWydQVVQnLCAnUE9TVCddLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS97dHlwZX0vX21hcHBpbmdcIixcbiAgICAgIFwie2luZGljZXN9L19tYXBwaW5nL3t0eXBlfVwiXG4gICAgXSxcbiAgICBwcmlvcml0eTogMTAsIC8vIGNvbGxpZGVzIHdpdGggcHV0IGRvYyBieSBpZFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAnRklFTEQnOiB7fVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ19zb3VyY2UnOiB7XG4gICAgICAgICdlbmFibGVkJzogQk9PTEVBTlxuICAgICAgfSxcbiAgICAgICdfYWxsJzoge1xuICAgICAgICAnZW5hYmxlZCc6IEJPT0xFQU5cbiAgICAgIH0sXG4gICAgICAnX2ZpZWxkX25hbWVzJzoge1xuICAgICAgICAnaW5kZXgnOiBJTkRFWF9TRVRUSU5HXG4gICAgICB9LFxuICAgICAgJ19yb3V0aW5nJzoge1xuICAgICAgICAncmVxdWlyZWQnOiBCT09MRUFOLFxuICAgICAgfSxcbiAgICAgICdfaW5kZXgnOiB7XG4gICAgICAgICdlbmFibGVkJzogQk9PTEVBTlxuICAgICAgfSxcbiAgICAgICdfcGFyZW50Jzoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgJ3R5cGUnOiAnJ1xuICAgICAgICB9LFxuICAgICAgICAndHlwZSc6ICd7dHlwZX0nXG4gICAgICB9LFxuICAgICAgJ190aW1lc3RhbXAnOiB7XG4gICAgICAgICdlbmFibGVkJzogQk9PTEVBTixcbiAgICAgICAgJ2Zvcm1hdCc6ICdZWVlZLU1NLWRkJyxcbiAgICAgICAgJ2RlZmF1bHQnOiBcIlwiXG4gICAgICB9LFxuICAgICAgJ2R5bmFtaWNfZGF0ZV9mb3JtYXRzJzogWyd5eXl5LU1NLWRkJ10sXG4gICAgICAnZGF0ZV9kZXRlY3Rpb24nOiBCT09MRUFOLFxuICAgICAgJ251bWVyaWNfZGV0ZWN0aW9uJzogQk9PTEVBTixcbiAgICAgICd0cmFuc2Zvcm0nOiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICBzY3JpcHQ6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIF9fb25lX29mOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgX19zY29wZV9saW5rOiBcIkdMT0JBTC5zY3JpcHRcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBfX3Njb3BlX2xpbms6IFwiR0xPQkFMLnNjcmlwdFwiXG4gICAgICAgICAgICB9XG4gICAgICAgICAgXVxuICAgICAgICBdXG5cblxuICAgICAgfSxcbiAgICAgICdwcm9wZXJ0aWVzJzoge1xuICAgICAgICAnKic6IHtcbiAgICAgICAgICB0eXBlOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydzdHJpbmcnLCAnZmxvYXQnLCAnZG91YmxlJywgJ2J5dGUnLCAnc2hvcnQnLCAnaW50ZWdlcicsICdsb25nJywgJ2RhdGUnLCAnYm9vbGVhbicsXG4gICAgICAgICAgICAgICdiaW5hcnknLCAnb2JqZWN0JywgJ25lc3RlZCcsIFwiZ2VvX3BvaW50XCIsIFwiZ2VvX3NoYXBlXCJcbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgLy8gc3RyaW5nc1xuICAgICAgICAgIHN0b3JlOiBCT09MRUFOLFxuICAgICAgICAgIGluZGV4OiBJTkRFWF9TRVRUSU5HLFxuICAgICAgICAgIHRlcm1fdmVjdG9yOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydubycsICd5ZXMnLCAnd2l0aF9vZmZzZXRzJywgJ3dpdGhfcG9zaXRpb25zJywgJ3dpdGhfcG9zaXRpb25zX29mZnNldHMnXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgYm9vc3Q6IDEuMCxcbiAgICAgICAgICBudWxsX3ZhbHVlOiAnJyxcbiAgICAgICAgICBvbWl0X25vcm1zOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgaW5kZXhfb3B0aW9uczoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFsnZG9jcycsICdmcmVxcycsICdwb3NpdGlvbnMnXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgYW5hbHl6ZXI6ICdzdGFuZGFyZCcsXG4gICAgICAgICAgc2VhcmNoX2FuYWx5emVyOiAnc3RhbmRhcmQnLFxuICAgICAgICAgIGluY2x1ZGVfaW5fYWxsOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW2ZhbHNlLCB0cnVlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgaWdub3JlX2Fib3ZlOiAxMCxcbiAgICAgICAgICBwb3NpdGlvbl9pbmNyZW1lbnRfZ2FwOiAwLFxuXG4gICAgICAgICAgLy8gbnVtZXJpY1xuICAgICAgICAgIHByZWNpc2lvbl9zdGVwOiA0LFxuICAgICAgICAgIGlnbm9yZV9tYWxmb3JtZWQ6IEJPT0xFQU4sXG5cbiAgICAgICAgICAvLyBnZW9fcG9pbnRcbiAgICAgICAgICBsYXRfbG9uOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2VvaGFzaDoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGdlb2hhc2hfcHJlY2lzaW9uOiAnMW0nLFxuICAgICAgICAgIGdlb2hhc2hfcHJlZml4OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgdmFsaWRhdGU6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB2YWxpZGF0ZV9sYXQ6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB2YWxpZGF0ZV9sb246IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBub3JtYWxpemU6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBub3JtYWxpemVfbGF0OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgbm9ybWFsaXplX2xvbjoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgLy8gZ2VvX3NoYXBlXG4gICAgICAgICAgdHJlZToge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFsnZ2VvaGFzaCcsICdxdWFkdHJlZSddXG4gICAgICAgICAgfSxcbiAgICAgICAgICBwcmVjaXNpb246ICc1a20nLFxuICAgICAgICAgIHRyZWVfbGV2ZWxzOiAxMixcbiAgICAgICAgICBkaXN0YW5jZV9lcnJvcl9wY3Q6IDAuMDI1LFxuICAgICAgICAgIG9yaWVudGF0aW9uOiAnY2N3JyxcblxuICAgICAgICAgIC8vIGRhdGVzXG4gICAgICAgICAgZm9ybWF0OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogXy5mbGF0dGVuKFtfLm1hcChbJ2RhdGUnLCAnZGF0ZV90aW1lJywgJ2RhdGVfdGltZV9ub19taWxsaXMnLFxuICAgICAgICAgICAgICAnb3JkaW5hbF9kYXRlJywgJ29yZGluYWxfZGF0ZV90aW1lJywgJ29yZGluYWxfZGF0ZV90aW1lX25vX21pbGxpcycsXG4gICAgICAgICAgICAgICd0aW1lJywgJ3RpbWVfbm9fbWlsbGlzJywgJ3RfdGltZScsICd0X3RpbWVfbm9fbWlsbGlzJyxcbiAgICAgICAgICAgICAgJ3dlZWtfZGF0ZScsICd3ZWVrX2RhdGVfdGltZScsICd3ZWVrX2RhdGVfdGltZV9ub19taWxsaXMnXSwgZnVuY3Rpb24gKHMpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFsnYmFzaWNfJyArIHMsICdzdHJpY3RfJyArIHNdO1xuICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAnZGF0ZScsICdkYXRlX2hvdXInLCAnZGF0ZV9ob3VyX21pbnV0ZScsICdkYXRlX2hvdXJfbWludXRlX3NlY29uZCcsICdkYXRlX2hvdXJfbWludXRlX3NlY29uZF9mcmFjdGlvbicsXG4gICAgICAgICAgICAgICAgJ2RhdGVfaG91cl9taW51dGVfc2Vjb25kX21pbGxpcycsICdkYXRlX29wdGlvbmFsX3RpbWUnLCAnZGF0ZV90aW1lJywgJ2RhdGVfdGltZV9ub19taWxsaXMnLFxuICAgICAgICAgICAgICAgICdob3VyJywgJ2hvdXJfbWludXRlJywgJ2hvdXJfbWludXRlX3NlY29uZCcsICdob3VyX21pbnV0ZV9zZWNvbmRfZnJhY3Rpb24nLCAnaG91cl9taW51dGVfc2Vjb25kX21pbGxpcycsXG4gICAgICAgICAgICAgICAgJ29yZGluYWxfZGF0ZScsICdvcmRpbmFsX2RhdGVfdGltZScsICdvcmRpbmFsX2RhdGVfdGltZV9ub19taWxsaXMnLCAndGltZScsICd0aW1lX25vX21pbGxpcycsXG4gICAgICAgICAgICAgICAgJ3RfdGltZScsICd0X3RpbWVfbm9fbWlsbGlzJywgJ3dlZWtfZGF0ZScsICd3ZWVrX2RhdGVfdGltZScsICd3ZWVrRGF0ZVRpbWVOb01pbGxpcycsICd3ZWVrX3llYXInLFxuICAgICAgICAgICAgICAgICd3ZWVreWVhcldlZWsnLCAnd2Vla3llYXJXZWVrRGF5JywgJ3llYXInLCAneWVhcl9tb250aCcsICd5ZWFyX21vbnRoX2RheScsICdlcG9jaF9taWxsaXMnLCAnZXBvY2hfc2Vjb25kJ1xuICAgICAgICAgICAgICBdXSlcbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgZmllbGRkYXRhOiB7XG4gICAgICAgICAgICBmaWx0ZXI6IHtcbiAgICAgICAgICAgICAgcmVnZXg6ICcnLFxuICAgICAgICAgICAgICBmcmVxdWVuY3k6IHtcbiAgICAgICAgICAgICAgICBtaW46IDAuMDAxLFxuICAgICAgICAgICAgICAgIG1heDogMC4xLFxuICAgICAgICAgICAgICAgIG1pbl9zZWdtZW50X3NpemU6IDUwMFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBzaW1pbGFyaXR5OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydkZWZhdWx0JywgJ0JNMjUnXVxuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvLyBvYmplY3RzXG4gICAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgICAgX19zY29wZV9saW5rOiAnX3B1dF9tYXBwaW5nLnt0eXBlfS5wcm9wZXJ0aWVzJ1xuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvLyBtdWx0aV9maWVsZFxuICAgICAgICAgIGZpZWxkczoge1xuICAgICAgICAgICAgJyonOiB7XG4gICAgICAgICAgICAgIF9fc2NvcGVfbGluazogJ19wdXRfbWFwcGluZy50eXBlLnByb3BlcnRpZXMuZmllbGQnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjb3B5X3RvOiB7X19vbmVfb2Y6IFsne2ZpZWxkfScsIFsne2ZpZWxkfSddXX0sXG5cbiAgICAgICAgICAvLyBuZXN0ZWRcbiAgICAgICAgICBpbmNsdWRlX2luX3BhcmVudDogQk9PTEVBTixcbiAgICAgICAgICBpbmNsdWRlX2luX3Jvb3Q6IEJPT0xFQU5cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICB9KTtcbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19wdXRfbWFwcGluZycsIHtcbiAgICBtZXRob2RzOiBbJ1BVVCddLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS9fbWFwcGluZ1wiXG4gICAgXSxcbiAgICBkYXRhX2F1dG9jb21wbGV0ZV9ydWxlczoge1xuICAgICAgJ3t0eXBlfSc6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnX3B1dF90eXBlX21hcHBpbmcnXG4gICAgICB9XG4gICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/mappings.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,IAAI,aAAa,GAAG;AAClB,UAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,IAA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zC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,oBAAoB,CACrB;AACD,2BAAuB,EAAE;AACvB,cAAQ,EAAE;AACR,oBAAY,EAAE,mBAAmB;OAClC;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/mappings.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nvar INDEX_SETTING = {\n __one_of: ['analyzed', 'not_analyzed', 'no']\n}, BOOLEAN = {\n __one_of: [true, false]\n};\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping\",\n \"{indices}/_mapping/{types}\",\n \"{indices}/{types}/_mapping\",\n \"_mapping\"\n ]\n });\n api.addEndpointDescription('_get_field_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping/field/{fields}\",\n \"{indices}/_mapping/{type}/field/{fields}\"\n ],\n url_params: {\n \"include_defaults\": \"__flag__\"\n }\n });\n api.addEndpointDescription('_delete_mapping', {\n methods: ['DELETE'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping\",\n \"{indices}/_mapping/{types}\",\n \"{indices}/{types}/_mapping\",\n \"_mapping\"\n ]\n });\n api.addEndpointDescription('_put_type_mapping', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{indices}/{type}/_mapping\",\n \"{indices}/_mapping/{type}\"\n ],\n priority: 10, // collides with put doc by id\n data_autocomplete_rules: {\n __template: {\n properties: {\n 'FIELD': {}\n }\n },\n '_source': {\n 'enabled': BOOLEAN\n },\n '_all': {\n 'enabled': BOOLEAN\n },\n '_field_names': {\n 'index': INDEX_SETTING\n },\n '_routing': {\n 'required': BOOLEAN,\n },\n '_index': {\n 'enabled': BOOLEAN\n },\n '_parent': {\n __template: {\n 'type': ''\n },\n 'type': '{type}'\n },\n '_timestamp': {\n 'enabled': BOOLEAN,\n 'format': 'YYYY-MM-dd',\n 'default': \"\"\n },\n 'dynamic_date_formats': ['yyyy-MM-dd'],\n 'date_detection': BOOLEAN,\n 'numeric_detection': BOOLEAN,\n 'transform': {\n __template: {\n script: {}\n },\n __one_of: [\n {\n __scope_link: \"GLOBAL.script\"\n },\n [\n {\n __scope_link: \"GLOBAL.script\"\n }\n ]\n ]\n\n\n },\n 'properties': {\n '*': {\n type: {\n __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',\n 'binary', 'object', 'nested', \"geo_point\", \"geo_shape\"\n ]\n },\n\n // strings\n store: BOOLEAN,\n index: INDEX_SETTING,\n term_vector: {\n __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']\n },\n boost: 1.0,\n null_value: '',\n omit_norms: {\n __one_of: [true, false]\n },\n index_options: {\n __one_of: ['docs', 'freqs', 'positions']\n },\n analyzer: 'standard',\n search_analyzer: 'standard',\n include_in_all: {\n __one_of: [false, true]\n },\n ignore_above: 10,\n position_increment_gap: 0,\n\n // numeric\n precision_step: 4,\n ignore_malformed: BOOLEAN,\n\n // geo_point\n lat_lon: {\n __one_of: [true, false]\n },\n geohash: {\n __one_of: [true, false]\n },\n geohash_precision: '1m',\n geohash_prefix: {\n __one_of: [true, false]\n },\n validate: {\n __one_of: [true, false]\n },\n validate_lat: {\n __one_of: [true, false]\n },\n validate_lon: {\n __one_of: [true, false]\n },\n normalize: {\n __one_of: [true, false]\n },\n normalize_lat: {\n __one_of: [true, false]\n },\n normalize_lon: {\n __one_of: [true, false]\n },\n\n // geo_shape\n tree: {\n __one_of: ['geohash', 'quadtree']\n },\n precision: '5km',\n tree_levels: 12,\n distance_error_pct: 0.025,\n orientation: 'ccw',\n\n // dates\n format: {\n __one_of: _.flatten([_.map(['date', 'date_time', 'date_time_no_millis',\n 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis',\n 'time', 'time_no_millis', 't_time', 't_time_no_millis',\n 'week_date', 'week_date_time', 'week_date_time_no_millis'], function (s) {\n return ['basic_' + s, 'strict_' + s];\n }),\n [\n 'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction',\n 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis',\n 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis',\n 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis',\n 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year',\n 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second'\n ]])\n },\n\n fielddata: {\n filter: {\n regex: '',\n frequency: {\n min: 0.001,\n max: 0.1,\n min_segment_size: 500\n }\n }\n },\n similarity: {\n __one_of: ['default', 'BM25']\n },\n\n // objects\n properties: {\n __scope_link: '_put_mapping.{type}.properties'\n },\n\n // multi_field\n fields: {\n '*': {\n __scope_link: '_put_mapping.type.properties.field'\n }\n },\n copy_to: {__one_of: ['{field}', ['{field}']]},\n\n // nested\n include_in_parent: BOOLEAN,\n include_in_root: BOOLEAN\n }\n }\n }\n\n });\n api.addEndpointDescription('_put_mapping', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_mapping\"\n ],\n data_autocomplete_rules: {\n '{type}': {\n __scope_link: '_put_type_mapping'\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/percolator.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_put_percolator', {\n priority: 10, // to override doc\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/.percolator/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n },\n data_autocomplete_rules: {\n query: {}\n }\n });\n api.addEndpointDescription('_percolate', {\n methods: ['GET', 'POST'],\n priority: 10, // to override doc\n patterns: [\"{indices}/{type}/_percolate\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {},\n size: 10,\n track_scores: { __one_of: [true, false] },\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_id', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/{type}/{id}/_percolate\"],\n url_params: {\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"],\n percolate_index: \"{index}\",\n percolate_type: \"{type}\",\n percolate_routing: \"\",\n percolate_preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n version: 1,\n version_type: [\"external\", \"internal\"]\n },\n data_autocomplete_rules: {\n query: {},\n filter: {},\n size: 10,\n track_scores: { __one_of: [true, false] },\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_count', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/{type}/_percolate/count\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {}\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvcGVyY29sYXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGlCQUFpQixFQUFFO0FBQzVDLFlBQVEsRUFBRSxFQUFFO0FBQ1osV0FBTyxFQUFFLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQztBQUN4QixZQUFRLEVBQUUsQ0FDUiwwQkFBMEIsQ0FDM0I7QUFDRCxjQUFVLEVBQUU7QUFDVixlQUFTLEVBQUUsQ0FBQztBQUNaLG9CQUFjLEVBQUUsQ0FBQyxVQUFVLEVBQUUsVUFBVSxDQUFDO0FBQ3hDLGVBQVMsRUFBRSxDQUFDLFFBQVEsQ0FBQztBQUNyQixlQUFTLEVBQUUsRUFBRTtBQUNiLGNBQVEsRUFBRSxFQUFFO0FBQ1osaUJBQVcsRUFBRSxFQUFFO0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AgICAgdHJhY2tfc2NvcmVzOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgc29ydDogXCJfc2NvcmVcIixcbiAgICAgIGFnZ3M6IHt9LFxuICAgICAgaGlnaGxpZ2h0OiB7fVxuICAgIH1cbiAgfSk7XG4gIGFwaS5hZGRFbmRwb2ludERlc2NyaXB0aW9uKCdfcGVyY29sYXRlX2NvdW50Jywge1xuICAgIG1ldGhvZHM6IFsnR0VUJywgJ1BPU1QnXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJ7aW5kaWNlc30ve3R5cGV9L19wZXJjb2xhdGUvY291bnRcIlxuICAgIF0sXG4gICAgdXJsX3BhcmFtczoge1xuICAgICAgcHJlZmVyZW5jZTogW1wiX3ByaW1hcnlcIiwgXCJfcHJpbWFyeV9maXJzdFwiLCBcIl9sb2NhbFwiLCBcIl9vbmx5X25vZGU6eHl6XCIsIFwiX3ByZWZlcl9ub2RlOnh5elwiLCBcIl9zaGFyZHM6MiwzXCJdLFxuICAgICAgcm91dGluZzogXCJcIixcbiAgICAgIGlnbm9yZV91bmF2YWlsYWJsZTogW1widHJ1ZVwiLCBcImZhbHNlXCJdLFxuICAgICAgcGVyY29sYXRlX2Zvcm1hdDogW1wiaWRzXCJdXG4gICAgfSxcbiAgICBkYXRhX2F1dG9jb21wbGV0ZV9ydWxlczoge1xuICAgICAgZG9jOiB7fSxcbiAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgIGZpbHRlcjoge31cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/percolator.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,YAAQ,EAAE,EAAE;AACZ,WAAO,EAAE,CAAC,KAA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_2_0/percolator.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_put_percolator', {\n priority: 10, // to override doc\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/.percolator/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n },\n data_autocomplete_rules: {\n query: {}\n }\n });\n api.addEndpointDescription('_percolate', {\n methods: ['GET', 'POST'],\n priority: 10, // to override doc\n patterns: [\n \"{indices}/{type}/_percolate\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {},\n size: 10,\n track_scores: {__one_of: [true, false]},\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_id', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/{type}/{id}/_percolate\"\n ],\n url_params: {\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"],\n percolate_index: \"{index}\",\n percolate_type: \"{type}\",\n percolate_routing: \"\",\n percolate_preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n version: 1,\n version_type: [\"external\", \"internal\"]\n },\n data_autocomplete_rules: {\n query: {},\n filter: {},\n size: 10,\n track_scores: {__one_of: [true, false]},\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_count', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/{type}/_percolate/count\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/query.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\n\nvar SPAN_QUERIES = {\n // TODO add one_of for objects\n span_first: {\n __scope_link: '.span_first'\n },\n span_near: {\n __scope_link: '.span_near'\n },\n span_or: {\n __scope_link: '.span_or'\n },\n span_not: {\n __scope_link: '.span_not'\n },\n span_term: {\n __scope_link: '.span_term'\n },\n span_containing: {\n __scope_link: '.span_containing'\n },\n span_within: {\n __scope_link: '.span_within'\n }\n};\n\nvar DECAY_FUNC_DESC = {\n __template: {\n \"FIELD\": {\n \"origin\": \"\",\n \"scale\": \"\"\n }\n },\n \"{field}\": {\n \"origin\": \"\",\n \"scale\": \"\",\n \"offset\": \"\",\n \"decay\": 0.5\n }\n},\n SCORING_FUNCS = {\n \"script_score\": {\n __template: {\n \"script\": \"_score * doc['f'].value\"\n },\n \"script\": {\n //populated by a global rule\n }\n },\n \"boost_factor\": 2.0,\n \"random_score\": {\n \"seed\": 314159265359\n },\n \"linear\": DECAY_FUNC_DESC,\n \"exp\": DECAY_FUNC_DESC,\n \"gauss\": DECAY_FUNC_DESC,\n \"field_value_factor\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"factor\": 1.2,\n \"modifier\": {\n __one_of: [\"none\", \"log\", \"log1p\", \"log2p\", \"ln\", \"ln1p\", \"ln2p\", \"square\", \"sqrt\", \"reciprocal\"]\n }\n }\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('query', {\n match: {\n __template: {\n 'FIELD': 'TEXT'\n },\n '{field}': {\n 'query': '',\n 'operator': {\n __one_of: ['and', 'or']\n },\n 'type': {\n __one_of: ['phrase', 'phrase_prefix', 'boolean']\n },\n 'max_expansions': 10,\n 'analyzer': '',\n 'fuzziness': 1.0,\n 'prefix_length': 1\n }\n },\n match_phrase: {\n __template: {\n 'FIELD': 'PHRASE'\n },\n '{field}': {\n query: '',\n analyzer: ''\n }\n },\n match_phrase_prefix: {\n __template: {\n 'FIELD': 'PREFIX'\n },\n '{field}': {\n query: '',\n analyzer: '',\n max_expansions: 10,\n prefix_length: 1,\n fuzziness: 0.1\n }\n },\n multi_match: {\n __template: {\n 'query': '',\n 'fields': []\n },\n query: '',\n fields: ['{field}'],\n use_dis_max: {\n __template: true,\n __one_of: [true, false]\n },\n tie_breaker: 0.0,\n type: { __one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix'] }\n },\n bool: {\n must: [{\n __scope_link: '.'\n }],\n must_not: [{\n __scope_link: '.'\n }],\n should: [{\n __scope_link: '.'\n }],\n filter: {\n __scope_link: 'GLOBAL.filter'\n },\n minimum_number_should_match: 1,\n boost: 1.0\n },\n boosting: {\n positive: {\n __scope_link: '.'\n },\n negative: {\n __scope_link: '.'\n },\n negative_boost: 0.2\n },\n ids: {\n type: '',\n values: []\n },\n constant_score: {\n __template: {\n filter: {},\n boost: 1.2\n },\n query: {},\n filter: {},\n boost: 1.2\n },\n dis_max: {\n __template: {\n tie_breaker: 0.7,\n boost: 1.2,\n queries: []\n },\n tie_breaker: 0.7,\n boost: 1.2,\n queries: [{\n __scope_link: '.'\n }]\n },\n field: {\n '{field}': {\n query: '',\n boost: 2.0,\n enable_position_increments: {\n __template: false,\n __one_of: [true, false]\n }\n }\n },\n filtered: {\n __template: {\n query: {},\n filter: {}\n },\n query: {},\n filter: {}\n },\n fuzzy: {\n '{field}': {\n 'value': '',\n 'boost': 1.0,\n 'min_similarity': 0.5,\n 'prefix_length': 0\n }\n },\n has_child: {\n __template: {\n type: 'TYPE',\n query: {}\n },\n 'type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'max', 'sum', 'avg']\n },\n '_scope': '',\n 'query': {},\n 'min_children': 1,\n 'max_children': 10\n },\n has_parent: {\n __template: {\n parent_type: 'TYPE',\n query: {}\n },\n 'parent_type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'score']\n },\n '_scope': '',\n 'query': {}\n },\n match_all: {},\n more_like_this: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n fields: ['{field}'],\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: '',\n docs: [{\n _index: \"{index}\",\n _type: \"{type}\",\n _id: \"\"\n }],\n ids: [\"\"]\n },\n mlt: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n __scope_link: \".more_like_this\"\n },\n prefix: {\n __template: {\n 'FIELD': {\n 'value': ''\n }\n },\n '{field}': {\n value: '',\n boost: 1.0\n }\n },\n query_string: {\n __template: {\n 'default_field': 'FIELD',\n 'query': 'this AND that OR thus'\n },\n query: '',\n default_field: '{field}',\n fields: ['{field}'],\n default_operator: {\n __one_of: ['OR', 'AND']\n },\n analyzer: '',\n allow_leading_wildcard: {\n __one_of: [true, false]\n },\n lowercase_expanded_terms: {\n __one_of: [true, false]\n },\n enable_position_increments: {\n __one_of: [true, false]\n },\n fuzzy_max_expansions: 50,\n fuzzy_min_sim: 0.5,\n fuzzy_prefix_length: 0,\n phrase_slop: 0,\n boost: 1.0,\n analyze_wildcard: {\n __one_of: [false, true]\n },\n auto_generate_phrase_queries: {\n __one_of: [false, true]\n },\n minimum_should_match: '20%',\n lenient: {\n __one_of: [false, true]\n },\n use_dis_max: {\n __one_of: [true, false]\n },\n tie_breaker: 0,\n time_zone: \"+1:00\"\n },\n simple_query_string: {\n __template: {\n query: \"\",\n fields: []\n },\n query: \"\",\n fields: [\"{field}\"],\n default_operator: { __one_of: [\"OR\", \"AND\"] },\n analyzer: \"\",\n flags: \"OR|AND|PREFIX\",\n lowercase_expanded_terms: { __one_of: [true, false] },\n locale: \"ROOT\",\n lenient: { __one_of: [true, false] }\n },\n range: {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n '{field}': {\n __template: {\n gte: 10,\n lte: 20\n },\n gte: 10,\n gt: 10,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n boost: 1.0,\n \"format\": \"dd/MM/yyyy||yyyy\"\n\n }\n },\n span_first: {\n __template: {\n 'match': {\n 'span_term': {\n 'FIELD': 'VALUE'\n }\n },\n 'end': 3\n },\n match: SPAN_QUERIES\n },\n span_near: {\n __template: {\n 'clauses': [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }],\n slop: 12,\n in_order: false\n },\n clauses: [SPAN_QUERIES],\n slop: 12,\n in_order: {\n __one_of: [false, true]\n },\n collect_payloads: {\n __one_of: [false, true]\n }\n },\n span_term: {\n __template: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n span_not: {\n __template: {\n include: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n exclude: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n },\n include: SPAN_QUERIES,\n exclude: SPAN_QUERIES\n },\n span_or: {\n __template: {\n clauses: [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }]\n },\n clauses: [SPAN_QUERIES]\n },\n span_containing: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }, {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n span_within: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }, {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n term: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n terms: {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n '{field}': [''],\n minimum_match: 1\n },\n wildcard: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n nested: {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n path: '',\n query: {},\n filter: {},\n score_mode: {\n __one_of: ['avg', 'total', 'max', 'none']\n }\n },\n custom_filters_score: {\n __template: {\n query: {},\n filters: [{\n filter: {}\n }]\n },\n query: {},\n filters: [{\n filter: {},\n boost: 2.0,\n script: {\n //populated by a global rule\n }\n }],\n score_mode: {\n __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply']\n },\n max_boost: 2.0,\n params: {},\n lang: ''\n },\n indices: {\n __template: {\n indices: ['INDEX1', 'INDEX2'],\n query: {}\n },\n indices: ['{index}'],\n query: {},\n no_match_query: {\n __scope_link: '.'\n }\n },\n geo_shape: {\n __template: {\n location: {},\n relation: 'within'\n },\n __scope_link: '.filter.geo_shape'\n },\n // js hint gets confused here\n /* jshint -W015 */\n function_score: _.defaults({\n __template: {\n query: {},\n functions: [{}]\n },\n query: {},\n filter: {},\n functions: [_.defaults({\n filter: {},\n weight: 1.0\n }, SCORING_FUNCS)],\n boost: 1.0,\n boost_mode: { __one_of: [\"multiply\", \"replace\", \"sum\", \"avg\", \"max\", \"min\"] },\n score_mode: { __one_of: [\"multiply\", \"sum\", \"first\", \"avg\", \"max\", \"min\"] },\n max_boost: 10,\n min_score: 1.0\n }, SCORING_FUNCS)\n\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvcXVlcnkuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxJQUFJLENBQUMsR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7O0FBRTFCLElBQUksWUFBWSxHQUFHOztBQUVqQixZQUFVLEVBQUU7QUFDVixnQkFBWSxFQUFFLGFBQWE7R0FDNUI7QUFDRCxXQUFTLEVBQUU7QUFDVCxnQkFBWSxFQUFFLFlBQVk7R0FDM0I7QUFDRCxTQUFPLEVBQUU7QUFDUCxnQkFBWSxFQUFFLFVBQVU7R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AgICAgICAgX190ZW1wbGF0ZTogdHJ1ZSxcbiAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgIH0sXG4gICAgICB0aWVfYnJlYWtlcjogMC4wLFxuICAgICAgdHlwZToge19fb25lX29mOiBbJ2Jlc3RfZmllbGRzJywgJ21vc3RfZmllbGRzJywgJ2Nyb3NzX2ZpZWxkcycsICdwaHJhc2UnLCAncGhyYXNlX3ByZWZpeCddfVxuICAgIH0sXG4gICAgYm9vbDoge1xuICAgICAgbXVzdDogW1xuICAgICAgICB7XG4gICAgICAgICAgX19zY29wZV9saW5rOiAnLidcbiAgICAgICAgfVxuICAgICAgXSxcbiAgICAgIG11c3Rfbm90OiBbXG4gICAgICAgIHtcbiAgICAgICAgICBfX3Njb3BlX2xpbms6ICcuJ1xuICAgICAgICB9XG4gICAgICBdLFxuICAgICAgc2hvdWxkOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBfX3Njb3BlX2xpbms6ICcuJ1xuICAgICAgICB9XG4gICAgICBdLFxuICAgICAgZmlsdGVyOiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogJ0dMT0JBTC5maWx0ZXInXG4gICAgICB9LFxuICAgICAgbWluaW11bV9udW1iZXJfc2hvdWxkX21hdGNoOiAxLFxuICAgICAgYm9vc3Q6IDEuMFxuICAgIH0sXG4gICAgYm9vc3Rpbmc6IHtcbiAgICAgIHBvc2l0aXZlOiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogJy4nXG4gICAgICB9LFxuICAgICAgbmVnYXRpdmU6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnLidcbiAgICAgIH0sXG4gICAgICBuZWdhdGl2ZV9ib29zdDogMC4yXG4gICAgfSxcbiAgICBpZHM6IHtcbiAgICAgIHR5cGU6ICcnLFxuICAgICAgdmFsdWVzOiBbXVxuICAgIH0sXG4gICAgY29uc3RhbnRfc2NvcmU6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICA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RjaDogMC4zLFxuICAgICAgbWluX3Rlcm1fZnJlcTogMixcbiAgICAgIG1heF9xdWVyeV90ZXJtczogMjUsXG4gICAgICBzdG9wX3dvcmRzOiBbJyddLFxuICAgICAgbWluX2RvY19mcmVxOiA1LFxuICAgICAgbWF4X2RvY19mcmVxOiAxMDAsXG4gICAgICBtaW5fd29yZF9sZW46IDAsXG4gICAgICBtYXhfd29yZF9sZW46IDAsXG4gICAgICBib29zdF90ZXJtczogMSxcbiAgICAgIGJvb3N0OiAxLjAsXG4gICAgICBhbmFseXplcjogJycsXG4gICAgICBkb2NzOiBbe1xuICAgICAgICBfaW5kZXg6IFwie2luZGV4fVwiLFxuICAgICAgICBfdHlwZTogXCJ7dHlwZX1cIixcbiAgICAgICAgX2lkOiBcIlwiXG4gICAgICB9XSxcbiAgICAgIGlkczogW1wiXCJdXG4gICAgfSxcbiAgICBtbHQ6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ2ZpZWxkcyc6IFsnRklFTEQnXSxcbiAgICAgICAgJ2xpa2VfdGV4dCc6ICd0ZXh0IGxpa2UgdGhpcyBvbmUnLFxuICAgICAgICAnbWluX3Rlcm1fZnJlcSc6IDEsXG4gICAgICAgICdtYXhfcXVlcnlfdGVybXMnOiAxMlxuICAgICAgfSxcbiAgICAgIF9fc2NvcGVfbGluazogXCIubW9yZV9saWtlX3RoaXNcIlxuICAgIH0sXG4gICAgcHJlZml4OiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAndmFsdWUnOiAnJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ3tmaWVsZH0nOiB7XG4gICAgICAgIHZhbHVlOiAnJyxcbiAgICAgICAgYm9vc3Q6IDEuMFxuICAgICAgfVxuICAgIH0sXG4gICAgcXVlcnlfc3RyaW5nOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICdkZWZhdWx0X2ZpZW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ICdWQUxVRSdcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICB2YWx1ZTogJycsXG4gICAgICAgIGJvb3N0OiAyLjBcbiAgICAgIH1cbiAgICB9LFxuICAgIHNwYW5fbm90OiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIGluY2x1ZGU6IHtcbiAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZXhjbHVkZToge1xuICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgaW5jbHVkZTogU1BBTl9RVUVSSUVTLFxuICAgICAgZXhjbHVkZTogU1BBTl9RVUVSSUVTXG4gICAgfSxcbiAgICBzcGFuX29yOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIGNsYXVzZXM6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGNsYXVzZXM6IFtcbiAgICAgICAgU1BBTl9RVUVSSUVTXG4gICAgICBdXG4gICAgfSxcbiAgICBzcGFuX2NvbnRhaW5pbmc6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgbGl0dGxlOiB7XG4gICAgICAgICAgc3Bhbl90ZXJtOiB7XG4gICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGJpZzoge1xuICAgICAgICAgIHNwYW5fbmVhcjoge1xuICAgICAgICAgICAgJ2NsYXVzZXMnOiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgXCJzbG9wXCI6IDUsXG4gICAgICAgICAgICBcImluX29yZGVyXCI6IGZhbHNlXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgbGl0dGxlOiBTUEFOX1FVRVJJRVMsXG4gICAgICBiaWc6IFNQQU5fUVVFUklFU1xuICAgIH0sXG4gICAgc3Bhbl93aXRoaW46IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgbGl0dGxlOiB7XG4gICAgICAgICAgc3Bhbl90ZXJtOiB7XG4gICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGJpZzoge1xuICAgICAgICAgIHNwYW5fbmVhcjoge1xuICAgICAgICAgICAgJ2NsYXVzZXMnOiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgXCJzbG9wXCI6IDUsXG4gICAgICAgICAgICBcImluX29yZGVyXCI6IGZhbHNlXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgbGl0dGxlOiBTUEFOX1FVRVJJRVMsXG4gICAgICBiaWc6IFNQQU5fUVVFUklFU1xuICAgIH0sXG4gICAgdGVybToge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgdmFsdWU6ICdWQUxVRSdcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICB2YWx1ZTogJycsXG4gICAgICAgIGJvb3N0OiAyLjBcbiAgICAgIH1cbiAgICB9LFxuICAgIHRlcm1zOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICdGSUVMRCc6IFsnVkFMVUUxJywgJ1ZBTFVFMiddXG4gICAgICB9LFxuICAgICAgJ3tmaWVsZH0nOiBbJyddLFxuICAgICAgbWluaW11bV9tYXRjaDogMVxuICAgIH0sXG4gICAgd2lsZGNhcmQ6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgIHZhbHVlOiAnVkFMVUUnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgdmFsdWU6ICcnLFxuICAgICAgICBib29zdDogMi4wXG4gICAgICB9XG4gICAgfSxcbiAgICBuZXN0ZWQ6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgcGF0aDogJ3BhdGhfdG9fbmVzdGVkX2RvYycsXG4gICAgICAgIHF1ZXJ5OiB7fVxuICAgICAgfSxcbiAgICAgIHBhdGg6ICcnLFxuICAgICAgcXVlcnk6IHt9LFxuICAgICAgZmlsdGVyOiB7fSxcbiAgICAgIHNjb3JlX21vZGU6IHtcbiAgICAgICAgX19vbmVfb2Y6IFsnYXZnJywgJ3RvdGFsJywgJ21heCcsICdub25lJ11cbiAgICAgIH1cbiAgICB9LFxuICAgIGN1c3RvbV9maWx0ZXJzX3Njb3JlOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgICAgZmlsdGVyczogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZpbHRlcjoge31cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBxdWVyeToge30sXG4gICAgICBmaWx0ZXJzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBmaWx0ZXI6IHt9LFxuICAgICAgICAgIGJvb3N0OiAyLjAsXG4gICAgICAgICAgc2NyaXB0OiB7XG4gICAgICAgICAgICAvL3BvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICBdLFxuICAgICAgc2NvcmVfbW9kZToge1xuICAgICAgICBfX29uZV9vZjogWydmaXJzdCcsICdtaW4nLCAnbWF4JywgJ3RvdGFsJywgJ2F2ZycsICdtdWx0aXBseSddXG4gICAgICB9LFxuICAgICAgbWF4X2Jvb3N0OiAyLjAsXG4gICAgICBwYXJhbXM6IHt9LFxuICAgICAgbGFuZzogJydcbiAgICB9LFxuICAgIGluZGljZXM6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgaW5kaWNlczogWydJTkRFWDEnLCAnSU5ERVgyJ10sXG4gICAgICAgIHF1ZXJ5OiB7fVxuICAgICAgfSxcbiAgICAgIGluZGljZXM6IFsne2luZGV4fSddLFxuICAgICAgcXVlcnk6IHt9LFxuICAgICAgbm9fbWF0Y2hfcXVlcnk6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnLidcbiAgICAgIH1cbiAgICB9LFxuICAgIGdlb19zaGFwZToge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBsb2NhdGlvbjoge30sXG4gICAgICAgIHJlbGF0aW9uOiAnd2l0aGluJ1xuICAgICAgfSxcbiAgICAgIF9fc2NvcGVfbGluazogJy5maWx0ZXIuZ2VvX3NoYXBlJ1xuICAgIH0sXG4gICAgLy8ganMgaGludCBnZXRzIGNvbmZ1c2VkIGhlcmVcbiAgICAvKiBqc2hpbnQgLVcwMTUgKi9cbiAgICBmdW5jdGlvbl9zY29yZTogXy5kZWZhdWx0cyh7XG4gICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICBxdWVyeToge30sXG4gICAgICAgICAgZnVuY3Rpb25zOiBbXG4gICAgICAgICAgICB7fVxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgcXVlcnk6IHt9LFxuICAgICAgICBmaWx0ZXI6IHt9LFxuICAgICAgICBmdW5jdGlvbnM6IFtcbiAgICAgICAgICBfLmRlZmF1bHRzKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBmaWx0ZXI6IHt9LFxuICAgICAgICAgICAgICB3ZWlnaHQ6IDEuMFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFNDT1JJTkdfRlVOQ1NcbiAgICAgICAgICApXG4gICAgICAgIF0sXG4gICAgICAgIGJvb3N0OiAxLjAsXG4gICAgICAgIGJvb3N0X21vZGU6IHtfX29uZV9vZjogW1wibXVsdGlwbHlcIiwgXCJyZXBsYWNlXCIsIFwic3VtXCIsIFwiYXZnXCIsIFwibWF4XCIsIFwibWluXCJdfSxcbiAgICAgICAgc2NvcmVfbW9kZToge19fb25lX29mOiBbXCJtdWx0aXBseVwiLCBcInN1bVwiLCBcImZpcnN0XCIsIFwiYXZnXCIsIFwibWF4XCIsIFwibWluXCJdfSxcbiAgICAgICAgbWF4X2Jvb3N0OiAxMCxcbiAgICAgICAgbWluX3Njb3JlOiAxLjBcbiAgICAgIH0sXG4gICAgICBTQ09SSU5HX0ZVTkNTXG4gICAgKVxuXG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/query.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,IAAI,YAAY,GAAG;;AAEjB,YAAU,EAAE;AACV,gBAAY,EAAE,aAAa;GAC5B;AACD,WAAS,EAAE;AACT,gBAAY,EAAE,YAAY;GAC3B;AACD,SAAO,EAAE;AACP,gBAAY,EAAE,UAAU;GACzB;AACD,UAAQ,EAAE;AACR,gBAAY,EAAE,WAAW;GAC1B;AACD,WAAS,EAAE;AACT,gBAAY,EAAE,YAAY;GAC3B;AACD,iBAAe,EAAE;AACf,gBAAY,EAAE,kBAAkB;GACjC;AACD,aAAW,EAAE;AACX,gBAAY,EAAE,cAAc;GAC7B;CACF,CAAC;;AAEF,IAAI,eAAe,GAAG;AAClB,YAAU,EAAE;AACV,WAAO,EAAE;AACP,cAAQ,EAAE,EAAE;AACZ,aAAO,EAAE,EAAE;KACZ;GACF;AACD,WAAS,EAAE;AACT,YAAQ,EAAE,EA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,EAAE,GAAG;AACd,YAAM,EAAE,EAAE;AACV,UAAI,EAAE,EAAE;KACT;AACD,WAAO,EAAE;AACP,gBAAU,EAAE;AACV,eAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC7B,aAAK,EAAE,EAAE;OACV;AACD,aAAO,EAAE,CAAC,SAAS,CAAC;AACpB,WAAK,EAAE,EAAE;AACT,oBAAc,EAAE;AACd,oBAAY,EAAE,GAAG;OAClB;KACF;AACD,aAAS,EAAE;AACT,gBAAU,EAAE;AACV,gBAAQ,EAAE,EAAE;AACZ,gBAAQ,EAAE,QAAQ;OACnB;AACD,kBAAY,EAAE,mBAAmB;KAClC;;;AAGD,kBAAc,EAAE,CAAC,CAAC,QAAQ,CAAC;AACvB,gBAAU,EAAE;AACV,aAAK,EAAE,EAAE;AACT,iBAAS,EAAE,CACT,EAAE,CACH;OACF;AACD,WAAK,EAAE,EAAE;AACT,YAAM,EAAE,EAAE;AACV,eAAS,EAAE,CACT,CAAC,CAAC,QAAQ,CACR;AACE,cAAM,EAAE,EAAE;AACV,cAAM,EAAE,GAAG;OACZ,EACD,aAAa,CACd,CACF;AACD,WAAK,EAAE,GAAG;AACV,gBAAU,EAAE,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAC;AAC3E,gBAAU,EAAE,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAC;AACzE,eAAS,EAAE,EAAE;AACb,eAAS,EAAE,GAAG;KACf,EACD,aAAa,CACd;;GAEF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/query.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nvar SPAN_QUERIES = {\n // TODO add one_of for objects\n span_first: {\n __scope_link: '.span_first'\n },\n span_near: {\n __scope_link: '.span_near'\n },\n span_or: {\n __scope_link: '.span_or'\n },\n span_not: {\n __scope_link: '.span_not'\n },\n span_term: {\n __scope_link: '.span_term'\n },\n span_containing: {\n __scope_link: '.span_containing'\n },\n span_within: {\n __scope_link: '.span_within'\n }\n};\n\nvar DECAY_FUNC_DESC = {\n __template: {\n \"FIELD\": {\n \"origin\": \"\",\n \"scale\": \"\"\n }\n },\n \"{field}\": {\n \"origin\": \"\",\n \"scale\": \"\",\n \"offset\": \"\",\n \"decay\": 0.5\n }\n },\n SCORING_FUNCS = {\n \"script_score\": {\n __template: {\n \"script\": \"_score * doc['f'].value\"\n },\n \"script\": {\n //populated by a global rule\n }\n },\n \"boost_factor\": 2.0,\n \"random_score\": {\n \"seed\": 314159265359\n },\n \"linear\": DECAY_FUNC_DESC,\n \"exp\": DECAY_FUNC_DESC,\n \"gauss\": DECAY_FUNC_DESC,\n \"field_value_factor\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"factor\": 1.2,\n \"modifier\": {\n __one_of: [\"none\", \"log\", \"log1p\", \"log2p\", \"ln\", \"ln1p\", \"ln2p\", \"square\", \"sqrt\", \"reciprocal\"]\n }\n }\n };\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('query', {\n match: {\n __template: {\n 'FIELD': 'TEXT'\n },\n '{field}': {\n 'query': '',\n 'operator': {\n __one_of: ['and', 'or']\n },\n 'type': {\n __one_of: ['phrase', 'phrase_prefix', 'boolean']\n },\n 'max_expansions': 10,\n 'analyzer': '',\n 'fuzziness': 1.0,\n 'prefix_length': 1\n }\n },\n match_phrase: {\n __template: {\n 'FIELD': 'PHRASE'\n },\n '{field}': {\n query: '',\n analyzer: ''\n }\n },\n match_phrase_prefix: {\n __template: {\n 'FIELD': 'PREFIX'\n },\n '{field}': {\n query: '',\n analyzer: '',\n max_expansions: 10,\n prefix_length: 1,\n fuzziness: 0.1\n }\n },\n multi_match: {\n __template: {\n 'query': '',\n 'fields': []\n },\n query: '',\n fields: ['{field}'],\n use_dis_max: {\n __template: true,\n __one_of: [true, false]\n },\n tie_breaker: 0.0,\n type: {__one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix']}\n },\n bool: {\n must: [\n {\n __scope_link: '.'\n }\n ],\n must_not: [\n {\n __scope_link: '.'\n }\n ],\n should: [\n {\n __scope_link: '.'\n }\n ],\n filter: {\n __scope_link: 'GLOBAL.filter'\n },\n minimum_number_should_match: 1,\n boost: 1.0\n },\n boosting: {\n positive: {\n __scope_link: '.'\n },\n negative: {\n __scope_link: '.'\n },\n negative_boost: 0.2\n },\n ids: {\n type: '',\n values: []\n },\n constant_score: {\n __template: {\n filter: {},\n boost: 1.2\n },\n query: {},\n filter: {},\n boost: 1.2\n },\n dis_max: {\n __template: {\n tie_breaker: 0.7,\n boost: 1.2,\n queries: []\n },\n tie_breaker: 0.7,\n boost: 1.2,\n queries: [\n {\n __scope_link: '.'\n }\n ]\n },\n field: {\n '{field}': {\n query: '',\n boost: 2.0,\n enable_position_increments: {\n __template: false,\n __one_of: [true, false]\n }\n }\n },\n filtered: {\n __template: {\n query: {},\n filter: {}\n },\n query: {},\n filter: {}\n },\n fuzzy: {\n '{field}': {\n 'value': '',\n 'boost': 1.0,\n 'min_similarity': 0.5,\n 'prefix_length': 0\n }\n },\n has_child: {\n __template: {\n type: 'TYPE',\n query: {}\n },\n 'type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'max', 'sum', 'avg']\n },\n '_scope': '',\n 'query': {},\n 'min_children': 1,\n 'max_children': 10\n },\n has_parent: {\n __template: {\n parent_type: 'TYPE',\n query: {}\n },\n 'parent_type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'score']\n },\n '_scope': '',\n 'query': {}\n },\n match_all: {},\n more_like_this: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n fields: ['{field}'],\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: '',\n docs: [{\n _index: \"{index}\",\n _type: \"{type}\",\n _id: \"\"\n }],\n ids: [\"\"]\n },\n mlt: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n __scope_link: \".more_like_this\"\n },\n prefix: {\n __template: {\n 'FIELD': {\n 'value': ''\n }\n },\n '{field}': {\n value: '',\n boost: 1.0\n }\n },\n query_string: {\n __template: {\n 'default_field': 'FIELD',\n 'query': 'this AND that OR thus'\n },\n query: '',\n default_field: '{field}',\n fields: ['{field}'],\n default_operator: {\n __one_of: ['OR', 'AND']\n },\n analyzer: '',\n allow_leading_wildcard: {\n __one_of: [true, false]\n },\n lowercase_expanded_terms: {\n __one_of: [true, false]\n },\n enable_position_increments: {\n __one_of: [true, false]\n },\n fuzzy_max_expansions: 50,\n fuzzy_min_sim: 0.5,\n fuzzy_prefix_length: 0,\n phrase_slop: 0,\n boost: 1.0,\n analyze_wildcard: {\n __one_of: [false, true]\n },\n auto_generate_phrase_queries: {\n __one_of: [false, true]\n },\n minimum_should_match: '20%',\n lenient: {\n __one_of: [false, true]\n },\n use_dis_max: {\n __one_of: [true, false]\n },\n tie_breaker: 0,\n time_zone: \"+1:00\"\n },\n simple_query_string: {\n __template: {\n query: \"\",\n fields: []\n },\n query: \"\",\n fields: [\"{field}\"],\n default_operator: {__one_of: [\"OR\", \"AND\"]},\n analyzer: \"\",\n flags: \"OR|AND|PREFIX\",\n lowercase_expanded_terms: {__one_of: [true, false]},\n locale: \"ROOT\",\n lenient: {__one_of: [true, false]}\n },\n range: {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n '{field}': {\n __template: {\n gte: 10,\n lte: 20\n },\n gte: 10,\n gt: 10,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n boost: 1.0,\n \"format\": \"dd/MM/yyyy||yyyy\"\n\n }\n },\n span_first: {\n __template: {\n 'match': {\n 'span_term': {\n 'FIELD': 'VALUE'\n }\n },\n 'end': 3\n },\n match: SPAN_QUERIES\n },\n span_near: {\n __template: {\n 'clauses': [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ],\n slop: 12,\n in_order: false\n },\n clauses: [\n SPAN_QUERIES\n ],\n slop: 12,\n in_order: {\n __one_of: [false, true]\n },\n collect_payloads: {\n __one_of: [false, true]\n }\n },\n span_term: {\n __template: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n span_not: {\n __template: {\n include: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n exclude: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n },\n include: SPAN_QUERIES,\n exclude: SPAN_QUERIES\n },\n span_or: {\n __template: {\n clauses: [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ]\n },\n clauses: [\n SPAN_QUERIES\n ]\n },\n span_containing: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n span_within: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n term: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n terms: {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n '{field}': [''],\n minimum_match: 1\n },\n wildcard: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n nested: {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n path: '',\n query: {},\n filter: {},\n score_mode: {\n __one_of: ['avg', 'total', 'max', 'none']\n }\n },\n custom_filters_score: {\n __template: {\n query: {},\n filters: [\n {\n filter: {}\n }\n ]\n },\n query: {},\n filters: [\n {\n filter: {},\n boost: 2.0,\n script: {\n //populated by a global rule\n }\n }\n ],\n score_mode: {\n __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply']\n },\n max_boost: 2.0,\n params: {},\n lang: ''\n },\n indices: {\n __template: {\n indices: ['INDEX1', 'INDEX2'],\n query: {}\n },\n indices: ['{index}'],\n query: {},\n no_match_query: {\n __scope_link: '.'\n }\n },\n geo_shape: {\n __template: {\n location: {},\n relation: 'within'\n },\n __scope_link: '.filter.geo_shape'\n },\n // js hint gets confused here\n /* jshint -W015 */\n function_score: _.defaults({\n __template: {\n query: {},\n functions: [\n {}\n ]\n },\n query: {},\n filter: {},\n functions: [\n _.defaults(\n {\n filter: {},\n weight: 1.0\n },\n SCORING_FUNCS\n )\n ],\n boost: 1.0,\n boost_mode: {__one_of: [\"multiply\", \"replace\", \"sum\", \"avg\", \"max\", \"min\"]},\n score_mode: {__one_of: [\"multiply\", \"sum\", \"first\", \"avg\", \"max\", \"min\"]},\n max_boost: 10,\n min_score: 1.0\n },\n SCORING_FUNCS\n )\n\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [ + "tagged-template-literal" + ] + }, + "ignored": false, + "code": "'use strict';\n\nvar _templateObject = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']fs'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']fs']),\n _templateObject2 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']url'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']url']),\n _templateObject3 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']s3'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']s3']),\n _templateObject4 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']hdfs'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']hdfs']);\n\nfunction _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nmodule.exports = function (api) {\n api.addEndpointDescription('restore_snapshot', {\n methods: ['POST'],\n patterns: ['_snapshot/{id}/{id}/_restore'],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: { __one_of: [true, false] },\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\"\n }\n });\n\n api.addEndpointDescription('single_snapshot', {\n methods: ['GET', 'DELETE'],\n patterns: ['_snapshot/{id}/{id}']\n });\n\n api.addEndpointDescription('all_snapshots', {\n methods: ['GET'],\n patterns: ['_snapshot/{id}/_all']\n });\n\n api.addEndpointDescription('put_snapshot', {\n methods: ['PUT'],\n patterns: ['_snapshot/{id}/{id}'],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: { __one_of: [true, false] },\n include_global_state: { __one_of: [true, false] },\n partial: { __one_of: [true, false] }\n }\n });\n\n api.addEndpointDescription('_snapshot_status', {\n methods: ['GET'],\n patterns: ['_snapshot/_status', '_snapshot/{id}/_status', '_snapshot/{id}/{ids}/_status']\n });\n\n function getRepositoryType(context, editor) {\n var iter = editor.iterForCurrentLoc();\n // for now just iterate back to the first \"type\" key\n var t = iter.getCurrentToken();\n var type;\n while (t && t.type.indexOf(\"url\") < 0) {\n if (t.type === 'variable' && t.value === '\"type\"') {\n t = editor.parser.nextNonEmptyToken(iter);\n if (!t || t.type !== \"punctuation.colon\") {\n // weird place to be in, but safe choice..\n break;\n }\n t = editor.parser.nextNonEmptyToken(iter);\n if (t && t.type === \"string\") {\n type = t.value.replace(/\"/g, '');\n }\n break;\n }\n t = editor.parser.prevNonEmptyToken(iter);\n }\n return type;\n }\n\n api.addEndpointDescription('put_repository', {\n methods: ['PUT'],\n patterns: ['_snapshot/{id}'],\n data_autocomplete_rules: {\n __template: { \"type\": \"\" },\n\n \"type\": {\n __one_of: [\"fs\", \"url\", \"s3\", \"hdfs\"]\n },\n \"settings\": {\n __one_of: [{\n //fs\n __condition: {\n lines_regex: String.raw(_templateObject)\n },\n __template: {\n location: \"path\"\n },\n location: \"path\",\n compress: { __one_of: [true, false] },\n concurrent_streams: 5,\n chunk_size: \"10m\",\n max_restore_bytes_per_sec: \"20mb\",\n max_snapshot_bytes_per_sec: \"20mb\"\n }, { // url\n __condition: {\n lines_regex: String.raw(_templateObject2)\n },\n __template: {\n url: \"\"\n },\n url: \"\",\n concurrent_streams: 5\n }, { //s3\n __condition: {\n lines_regex: String.raw(_templateObject3)\n },\n __template: {\n bucket: \"\"\n },\n bucket: \"\",\n region: \"\",\n base_path: \"\",\n concurrent_streams: 5,\n chunk_size: \"10m\",\n compress: { __one_of: [true, false] }\n }, { // hdfs\n __condition: {\n lines_regex: String.raw(_templateObject4)\n },\n __template: {\n path: \"\"\n },\n uri: \"\",\n path: \"some/path\",\n load_defaults: { __one_of: [true, false] },\n conf_location: \"cfg.xml\",\n concurrent_streams: 5,\n compress: { __one_of: [true, false] },\n chunk_size: \"10m\"\n }]\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvc25hcHNob3RfcmVzdG9yZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxrQkFBa0IsRUFBRTtBQUM3QyxXQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUM7QUFDakIsWUFBUSxFQUFFLENBQ1IsOEJBQThCLENBQy9CO0FBQ0QsY0FBVSxFQUFFO0FBQ1YseUJBQW1CLEVBQUUsVUFBVTtLQUNoQztBQUNELDJCQUF1QixFQUFFO0FBQ3ZCLGFBQU8sRUFBRSxHQUFHO0FBQ1osd0JBQWtCLEVBQUUsRUFBQyxRQUFRLEVBQUUsQ0FBQyxJQUFJLEVBQUUsS0FBSyxDQUFDLEVBQUM7QUFDN0MsMEJBQW9CLEVBQUUsS0FBSztBQUMzQixvQkFBYyxFQUFFLFlBQVk7QUFDNUIsd0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SB7XG4gICAgICBpZiAodC50eXBlID09PSAndmFyaWFibGUnICYmIHQudmFsdWUgPT09ICdcInR5cGVcIicpIHtcbiAgICAgICAgdCA9IGVkaXRvci5wYXJzZXIubmV4dE5vbkVtcHR5VG9rZW4oaXRlcik7XG4gICAgICAgIGlmICghdCB8fCB0LnR5cGUgIT09IFwicHVuY3R1YXRpb24uY29sb25cIikge1xuICAgICAgICAgIC8vIHdlaXJkIHBsYWNlIHRvIGJlIGluLCBidXQgc2FmZSBjaG9pY2UuLlxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIHQgPSBlZGl0b3IucGFyc2VyLm5leHROb25FbXB0eVRva2VuKGl0ZXIpO1xuICAgICAgICBpZiAodCAmJiB0LnR5cGUgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICB0eXBlID0gdC52YWx1ZS5yZXBsYWNlKC9cIi9nLCAnJyk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB0ID0gZWRpdG9yLnBhcnNlci5wcmV2Tm9uRW1wdHlUb2tlbihpdGVyKTtcbiAgICB9XG4gICAgcmV0dXJuIHR5cGU7XG4gIH1cblxuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbigncHV0X3JlcG9zaXRvcnknLCB7XG4gICAgbWV0aG9kczogWydQVVQnXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgJ19zbmFwc2hvdC97aWR9J1xuICAgIF0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcInR5cGVcIjogXCJcIn0sXG5cbiAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgIF9fb25lX29mOiBbXCJmc1wiLCBcInVybFwiLCBcInMzXCIsIFwiaGRmc1wiXVxuICAgICAgfSxcbiAgICAgIFwic2V0dGluZ3NcIjoge1xuICAgICAgICBfX29uZV9vZjogW3tcbiAgICAgICAgICAvL2ZzXG4gICAgICAgICAgX19jb25kaXRpb246IHtcbiAgICAgICAgICAgIGxpbmVzX3JlZ2V4OiBTdHJpbmcucmF3YHR5cGVbXCInXVxccyo6XFxzKltcIiddZnNgXG4gICAgICAgICAgfSxcbiAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICBsb2NhdGlvbjogXCJwYXRoXCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIGxvY2F0aW9uOiBcInBhdGhcIixcbiAgICAgICAgICBjb21wcmVzczoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfSxcbiAgICAgICAgICBjb25jdXJyZW50X3N0cmVhbXM6IDUsXG4gICAgICAgICAgY2h1bmtfc2l6ZTogXCIxMG1cIixcbiAgICAgICAgICBtYXhfcmVzdG9yZV9ieXRlc19wZXJfc2VjOiBcIjIwbWJcIixcbiAgICAgICAgICBtYXhfc25hcHNob3RfYnl0ZXNfcGVyX3NlYzogXCIyMG1iXCJcbiAgICAgICAgfSxcbiAgICAgICAgICB7Ly8gdXJsXG4gICAgICAgICAgICBfX2NvbmRpdGlvbjoge1xuICAgICAgICAgICAgICBsaW5lc19yZWdleDogU3RyaW5nLnJhd2B0eXBlW1wiJ11cXHMqOlxccypbXCInXXVybGBcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgIHVybDogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHVybDogXCJcIixcbiAgICAgICAgICAgIGNvbmN1cnJlbnRfc3RyZWFtczogNVxuICAgICAgICAgIH0sXG4gICAgICAgICAgeyAvL3MzXG4gICAgICAgICAgICBfX2NvbmRpdGlvbjoge1xuICAgICAgICAgICAgICBsaW5lc19yZWdleDogU3RyaW5nLnJhd2B0eXBlW1wiJ11cXHMqOlxccypbXCInXXMzYFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgYnVja2V0OiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYnVja2V0OiBcIlwiLFxuICAgICAgICAgICAgcmVnaW9uOiBcIlwiLFxuICAgICAgICAgICAgYmFzZV9wYXRoOiBcIlwiLFxuICAgICAgICAgICAgY29uY3VycmVudF9zdHJlYW1zOiA1LFxuICAgICAgICAgICAgY2h1bmtfc2l6ZTogXCIxMG1cIixcbiAgICAgICAgICAgIGNvbXByZXNzOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19XG4gICAgICAgICAgfSxcbiAgICAgICAgICB7Ly8gaGRmc1xuICAgICAgICAgICAgX19jb25kaXRpb246IHtcbiAgICAgICAgICAgICAgbGluZXNfcmVnZXg6IFN0cmluZy5yYXdgdHlwZVtcIiddXFxzKjpcXHMqW1wiJ11oZGZzYFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgcGF0aDogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHVyaTogXCJcIixcbiAgICAgICAgICAgIHBhdGg6IFwic29tZS9wYXRoXCIsXG4gICAgICAgICAgICBsb2FkX2RlZmF1bHRzOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgICAgICAgY29uZl9sb2NhdGlvbjogXCJjZmcueG1sXCIsXG4gICAgICAgICAgICBjb25jdXJyZW50X3N0cmVhbXM6IDUsXG4gICAgICAgICAgICBjb21wcmVzczoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfSxcbiAgICAgICAgICAgIGNodW5rX3NpemU6IFwiMTBtXCJcbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js" + ], + "names": [], + "mappings": ";;;;;;;;;AAAA,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AE,CAAC;AACrB,kBAAQ,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;AACnC,oBAAU,EAAE,KAAK;SAClB,CACF;OACF;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('restore_snapshot', {\n methods: ['POST'],\n patterns: [\n '_snapshot/{id}/{id}/_restore'\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: {__one_of: [true, false]},\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\"\n }\n });\n\n\n api.addEndpointDescription('single_snapshot', {\n methods: ['GET', 'DELETE'],\n patterns: [\n '_snapshot/{id}/{id}'\n ]\n });\n\n api.addEndpointDescription('all_snapshots', {\n methods: ['GET'],\n patterns: [\n '_snapshot/{id}/_all'\n ]\n });\n\n api.addEndpointDescription('put_snapshot', {\n methods: ['PUT'],\n patterns: [\n '_snapshot/{id}/{id}'\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: {__one_of: [true, false]},\n include_global_state: {__one_of: [true, false]},\n partial: {__one_of: [true, false]}\n }\n });\n\n api.addEndpointDescription('_snapshot_status', {\n methods: ['GET'],\n patterns: [\n '_snapshot/_status',\n '_snapshot/{id}/_status',\n '_snapshot/{id}/{ids}/_status'\n ]\n });\n\n\n function getRepositoryType(context, editor) {\n var iter = editor.iterForCurrentLoc();\n // for now just iterate back to the first \"type\" key\n var t = iter.getCurrentToken();\n var type;\n while (t && t.type.indexOf(\"url\") < 0) {\n if (t.type === 'variable' && t.value === '\"type\"') {\n t = editor.parser.nextNonEmptyToken(iter);\n if (!t || t.type !== \"punctuation.colon\") {\n // weird place to be in, but safe choice..\n break;\n }\n t = editor.parser.nextNonEmptyToken(iter);\n if (t && t.type === \"string\") {\n type = t.value.replace(/\"/g, '');\n }\n break;\n }\n t = editor.parser.prevNonEmptyToken(iter);\n }\n return type;\n }\n\n api.addEndpointDescription('put_repository', {\n methods: ['PUT'],\n patterns: [\n '_snapshot/{id}'\n ],\n data_autocomplete_rules: {\n __template: {\"type\": \"\"},\n\n \"type\": {\n __one_of: [\"fs\", \"url\", \"s3\", \"hdfs\"]\n },\n \"settings\": {\n __one_of: [{\n //fs\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']fs`\n },\n __template: {\n location: \"path\"\n },\n location: \"path\",\n compress: {__one_of: [true, false]},\n concurrent_streams: 5,\n chunk_size: \"10m\",\n max_restore_bytes_per_sec: \"20mb\",\n max_snapshot_bytes_per_sec: \"20mb\"\n },\n {// url\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']url`\n },\n __template: {\n url: \"\"\n },\n url: \"\",\n concurrent_streams: 5\n },\n { //s3\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']s3`\n },\n __template: {\n bucket: \"\"\n },\n bucket: \"\",\n region: \"\",\n base_path: \"\",\n concurrent_streams: 5,\n chunk_size: \"10m\",\n compress: {__one_of: [true, false]}\n },\n {// hdfs\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']hdfs`\n },\n __template: {\n path: \"\"\n },\n uri: \"\",\n path: \"some/path\",\n load_defaults: {__one_of: [true, false]},\n conf_location: \"cfg.xml\",\n concurrent_streams: 5,\n compress: {__one_of: [true, false]},\n chunk_size: \"10m\"\n }\n ]\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/search.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_search', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_search\", \"{indices}/_search\", \"_search\"],\n url_params: {\n q: \"\",\n df: \"\",\n analyzer: \"\",\n default_operator: [\"AND\", \"OR\"],\n explain: \"__flag__\",\n _source: \"\",\n _source_include: \"\",\n _source_exclude: \"\",\n fields: [],\n sort: \"\",\n track_scores: \"__flag__\",\n timeout: 1,\n from: 0,\n size: 10,\n search_type: [\"dfs_query_then_fetch\", \"dfs_query_and_fetch\", \"query_then_fetch\", \"query_and_fetch\", \"count\", \"scan\"],\n terminate_after: 10,\n lowercase_expanded_terms: [\"true\", \"false\"],\n analyze_wildcard: \"__flag__\",\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n scroll: \"5m\",\n scroll_id: \"\",\n routing: \"\",\n request_cache: [\"true\", \"false\"]\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n aggs: {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n\n post_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n size: {\n __template: 20\n },\n from: 0,\n sort: {\n __template: [{\n 'FIELD': {\n 'order': 'desc'\n }\n }],\n __any_of: [{\n '{field}': {\n 'order': {\n __one_of: ['desc', 'asc']\n },\n missing: {\n __one_of: ['_last', '_first']\n },\n mode: {\n __one_of: ['min', 'max', 'avg', 'sum']\n },\n nested_path: \"\",\n nested_filter: {\n __scope_link: \"GLOBAL.filter\"\n }\n }\n }, '{field}', '_score', {\n '_geo_distance': {\n __template: {\n \"FIELD\": {\n lat: 40,\n lon: -70\n },\n order: \"asc\"\n },\n \"{field}\": {\n __one_of: [{\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }, [{\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }], [\"\"], \"\"]\n },\n distance_type: { __one_of: [\"sloppy_arc\", \"arc\", \"plane\"] },\n sort_mode: { __one_of: [\"min\", \"max\", \"avg\"] },\n order: { __one_of: [\"asc\", \"desc\"] },\n unit: \"km\"\n }\n }]\n },\n fields: ['{field}'],\n fielddata_fields: [\"{field}\"],\n script_fields: {\n __template: {\n 'FIELD': {\n 'script': {\n // populated by a global rule\n }\n }\n },\n '*': {\n __scope_link: 'GLOBAL.script'\n }\n },\n partial_fields: {\n __template: {\n 'NAME': {\n include: []\n }\n },\n '*': {\n include: [],\n exclude: []\n }\n },\n highlight: {\n // populated by a global rule\n },\n _source: {\n __one_of: [\"{field}\", [\"{field}\"], {\n \"include\": {\n __one_of: [\"{field}\", [\"{field}\"]]\n },\n \"exclude\": {\n __one_of: [\"{field}\", [\"{field}\"]]\n }\n }]\n },\n explain: {\n __one_of: [true, false]\n },\n stats: [''],\n timeout: \"1s\",\n version: { __one_of: [true, false] }\n }\n });\n\n api.addEndpointDescription('_search_template', {\n methods: ['GET'],\n patterns: [\"{indices}/{types}/_search/template\", \"{indices}/_search/template\", \"_search/template\"],\n data_autocomplete_rules: {\n \"template\": {\n __one_of: [{ __scope_link: \"_search\" }, { __scope_link: \"GLOBAL.script\" }]\n },\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template', {\n methods: ['GET'],\n patterns: [\"_render/template\"],\n data_autocomplete_rules: {\n __one_of: [{ \"inline\": { __scope_link: \"_search\" } }, { __scope_link: \"GLOBAL.script\" }],\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template_with_id', {\n methods: ['GET'],\n patterns: [\"_render/template/{id}\"],\n data_autocomplete_rules: {\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_get_delete_search_template', {\n methods: ['GET', 'DELETE'],\n patterns: [\"_search/template/{id}\"]\n });\n\n api.addEndpointDescription('_put_search_template', {\n methods: ['PUT'],\n patterns: [\"_search/template/{id}\"],\n data_autocomplete_rules: {\n \"template\": {\n __scope_link: \"_search\"\n }\n }\n });\n\n api.addEndpointDescription('_search_shards', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_search_shards\", \"{indices}/_search_shards\", \"_search_shards\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n local: \"__flag__\"\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvc2VhcmNoLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsU0FBUyxFQUFFO0FBQ3BDLFdBQU8sRUFBRSxDQUFDLEtBQUssRUFBRSxNQUFNLENBQUM7QUFDeEIsWUFBUSxFQUFFLEVBQUU7QUFDWixZQUFRLEVBQUUsQ0FDUiwyQkFBMkIsRUFDM0IsbUJBQW1CLEVBQ25CLFNBQVMsQ0FDVjtBQUNELGNBQVUsRUFBRTtBQUNWLE9BQUMsRUFBRS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iB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9LFxuICAgICAgYWdnczoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgXCJOQU1FXCI6IHtcbiAgICAgICAgICAgIFwiQUdHX1RZUEVcIjoge31cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG5cbiAgICAgIHBvc3RfZmlsdGVyOiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogJ0dMT0JBTC5maWx0ZXInXG4gICAgICB9LFxuICAgICAgc2l6ZToge1xuICAgICAgICBfX3RlbXBsYXRlOiAyMFxuICAgICAgfSxcbiAgICAgIGZyb206IDAsXG4gICAgICBzb3J0OiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICdvcmRlcic6ICdkZXNjJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgXSxcbiAgICAgICAgX19hbnlfb2Y6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgICAgICAgJ29yZGVyJzoge1xuICAgICAgICAgICAgICAgIF9fb25lX29mOiBbJ2Rlc2MnLCAnYXNjJ11cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgbWlzc2luZzoge1xuICAgICAgICAgICAgICAgIF9fb25lX29mOiBbJ19sYXN0JywgJ19maXJzdCddXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIG1vZGU6IHtcbiAgICAgICAgICAgICAgICBfX29uZV9vZjogWydtaW4nLCAnbWF4JywgJ2F2ZycsICdzdW0nXVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBuZXN0ZWRfcGF0aDogXCJcIixcbiAgICAgICAgICAgICAgbmVzdGVkX2ZpbHRlcjoge1xuICAgICAgICAgICAgICAgIF9fc2NvcGVfbGluazogXCJHTE9CQUwuZmlsdGVyXCJcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgJ3tmaWVsZH0nLFxuICAgICAgICAgICdfc2NvcmUnLFxuICAgICAgICAgIHtcbiAgICAgICAgICAgICdfZ2VvX2Rpc3RhbmNlJzoge1xuICAgICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgICAgXCJGSUVMRFwiOiB7XG4gICAgICAgICAgICAgICAgICBsYXQ6IDQwLFxuICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG9yZGVyOiBcImFzY1wiXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIFwie2ZpZWxkfVwiOiB7XG4gICAgICAgICAgICAgICAgX19vbmVfb2Y6IFtcbiAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICAgICAgICAgIGxhdDogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgbGF0OiA0MCxcbiAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXQ6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgIGxhdDogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgIFtcIlwiXSxcbiAgICAgICAgICAgICAgICAgIFwiXCJcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGRpc3RhbmNlX3R5cGU6IHtfX29uZV9vZjogW1wic2xvcHB5X2FyY1wiLCBcImFyY1wiLCBcInBsYW5lXCJdfSxcbiAgICAgICAgICAgICAgc29ydF9tb2RlOiB7X19vbmVfb2Y6IFtcIm1pblwiLCBcIm1heFwiLCBcImF2Z1wiXX0sXG4gICAgICAgICAgICAgIG9yZGVyOiB7X19vbmVfb2Y6IFtcImFzY1wiLCBcImRlc2NcIl19LFxuICAgICAgICAgICAgICB1bml0OiBcImttXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBmaWVsZHM6IFsne2ZpZWxkfSddLFxuICAgICAgZmllbGRkYXRhX2ZpZWxkczogW1wie2ZpZWxkfVwiXSxcbiAgICAgIHNjcmlwdF9maWVsZHM6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICdzY3JpcHQnOiB7XG4gICAgICAgICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICAnKic6IHtcbiAgICAgICAgICBfX3Njb3BlX2xpbms6ICdHTE9CQUwuc2NyaXB0J1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgcGFydGlhbF9maWVsZHM6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICdOQU1FJzoge1xuICAgICAgICAgICAgaW5jbHVkZTogW11cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgICcqJzoge1xuICAgICAgICAgIGluY2x1ZGU6IFtdLFxuICAgICAgICAgIGV4Y2x1ZGU6IFtdXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBoaWdobGlnaHQ6IHtcbiAgICAgICAgLy8gcG9wdWxhdGVkIGJ5IGEgZ2xvYmFsIHJ1bGVcbiAgICAgIH0sXG4gICAgICBfc291cmNlOiB7XG4gICAgICAgIF9fb25lX29mOiBbXG4gICAgICAgICAgXCJ7ZmllbGR9XCIsXG4gICAgICAgICAgW1wie2ZpZWxkfVwiXSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBcImluY2x1ZGVcIjoge1xuICAgICAgICAgICAgICBfX29uZV9vZjogW1xuICAgICAgICAgICAgICAgIFwie2ZpZWxkfVwiLFxuICAgICAgICAgICAgICAgIFtcIntmaWVsZH1cIl1cbiAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiZXhjbHVkZVwiOiB7XG4gICAgICAgICAgICAgIF9fb25lX29mOiBbXG4gICAgICAgICAgICAgICAgXCJ7ZmllbGR9XCIsXG4gICAgICAgICAgICAgICAgW1wie2ZpZWxkfVwiXVxuICAgICAgICAgICAgICBdXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXhwbGFpbjoge1xuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgIHN0YXRzOiBbJyddLFxuICAgICAgdGltZW91dDogXCIxc1wiLFxuICAgICAgdmVyc2lvbjoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfVxuICAgIH1cbiAgfSk7XG5cbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19zZWFyY2hfdGVtcGxhdGUnLCB7XG4gICAgbWV0aG9kczogWydHRVQnXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJ7aW5kaWNlc30ve3R5cGVzfS9fc2VhcmNoL3RlbXBsYXRlXCIsXG4gICAgICBcIntpbmRpY2VzfS9fc2VhcmNo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XCJcIixcbiAgICAgIGxvY2FsOiBcIl9fZmxhZ19fXCJcbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/search.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,SAAS,EAAE;AACpC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,2BAA2B,EAC3B,mBAAmB,EACnB,SAAS,CACV;AACD,cAAU,EAAE;AACV,OAAC,EAAE,EAAE;AACL,QAAE,EAAE,EAAE;AACN,cAAQ,EAAE,EAAE;AACZ,sBAAgB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/B,aAAO,EAAE,UAAU;AACnB,aAAO,EAAE,EAAE;AACX,qBAAe,EAAE,EAAE;AACnB,qBAAe,EAAE,EAAE;AACnB,YAAM,EAAE,EAAE;AACV,UAAI,EAAE,EAAE;AACR,kBAAY,EAAE,UAAU;AACxB,aAAO,EAAE,CAAC;AACV,UAAI,EAAE,CAAC;AACP,UAAI,EAAE,EAAE;AACR,iBAAW,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC;AACpH,qBAAe,EAAE,EAAE;AACnB,8BAAwB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AAC3C,sBAAgB,EAAE,UAAU;AAC5B,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,YAAM,EAAE,IAAI;AACZ,eAAS,EAAE,EAAE;AACb,aAAO,EAAE,EAAE;AACX,mBAAa,EAAE,CAAC,MAAM,EAAE,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BAAsB,CAAC,gBAAgB,EAAE;AAC3C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,kCAAkC,EAClC,0BAA0B,EAC1B,gBAAgB,CACjB;AACD,cAAU,EAAE;AACV,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,aAAO,EAAE,EAAE;AACX,WAAK,EAAE,UAAU;KAClB;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/search.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_search', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_search\",\n \"{indices}/_search\",\n \"_search\"\n ],\n url_params: {\n q: \"\",\n df: \"\",\n analyzer: \"\",\n default_operator: [\"AND\", \"OR\"],\n explain: \"__flag__\",\n _source: \"\",\n _source_include: \"\",\n _source_exclude: \"\",\n fields: [],\n sort: \"\",\n track_scores: \"__flag__\",\n timeout: 1,\n from: 0,\n size: 10,\n search_type: [\"dfs_query_then_fetch\", \"dfs_query_and_fetch\", \"query_then_fetch\", \"query_and_fetch\", \"count\", \"scan\"],\n terminate_after: 10,\n lowercase_expanded_terms: [\"true\", \"false\"],\n analyze_wildcard: \"__flag__\",\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n scroll: \"5m\",\n scroll_id: \"\",\n routing: \"\",\n request_cache: [\"true\", \"false\"]\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n aggs: {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n\n post_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n size: {\n __template: 20\n },\n from: 0,\n sort: {\n __template: [\n {\n 'FIELD': {\n 'order': 'desc'\n }\n }\n ],\n __any_of: [\n {\n '{field}': {\n 'order': {\n __one_of: ['desc', 'asc']\n },\n missing: {\n __one_of: ['_last', '_first']\n },\n mode: {\n __one_of: ['min', 'max', 'avg', 'sum']\n },\n nested_path: \"\",\n nested_filter: {\n __scope_link: \"GLOBAL.filter\"\n }\n }\n },\n '{field}',\n '_score',\n {\n '_geo_distance': {\n __template: {\n \"FIELD\": {\n lat: 40,\n lon: -70\n },\n order: \"asc\"\n },\n \"{field}\": {\n __one_of: [\n {\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n },\n [\n {\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }\n ],\n [\"\"],\n \"\"\n ]\n },\n distance_type: {__one_of: [\"sloppy_arc\", \"arc\", \"plane\"]},\n sort_mode: {__one_of: [\"min\", \"max\", \"avg\"]},\n order: {__one_of: [\"asc\", \"desc\"]},\n unit: \"km\"\n }\n }\n ]\n },\n fields: ['{field}'],\n fielddata_fields: [\"{field}\"],\n script_fields: {\n __template: {\n 'FIELD': {\n 'script': {\n // populated by a global rule\n }\n }\n },\n '*': {\n __scope_link: 'GLOBAL.script'\n }\n },\n partial_fields: {\n __template: {\n 'NAME': {\n include: []\n }\n },\n '*': {\n include: [],\n exclude: []\n }\n },\n highlight: {\n // populated by a global rule\n },\n _source: {\n __one_of: [\n \"{field}\",\n [\"{field}\"],\n {\n \"include\": {\n __one_of: [\n \"{field}\",\n [\"{field}\"]\n ]\n },\n \"exclude\": {\n __one_of: [\n \"{field}\",\n [\"{field}\"]\n ]\n }\n }\n ]\n },\n explain: {\n __one_of: [true, false]\n },\n stats: [''],\n timeout: \"1s\",\n version: {__one_of: [true, false]}\n }\n });\n\n api.addEndpointDescription('_search_template', {\n methods: ['GET'],\n patterns: [\n \"{indices}/{types}/_search/template\",\n \"{indices}/_search/template\",\n \"_search/template\"\n ],\n data_autocomplete_rules: {\n \"template\": {\n __one_of: [\n {__scope_link: \"_search\"},\n {__scope_link: \"GLOBAL.script\"}\n ]\n },\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template', {\n methods: ['GET'],\n patterns: [\n \"_render/template\"\n ],\n data_autocomplete_rules: {\n __one_of: [\n {\"inline\": {__scope_link: \"_search\"}},\n {__scope_link: \"GLOBAL.script\"}\n ],\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template_with_id', {\n methods: ['GET'],\n patterns: [\n \"_render/template/{id}\"\n ],\n data_autocomplete_rules: {\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_get_delete_search_template', {\n methods: ['GET', 'DELETE'],\n patterns: [\n \"_search/template/{id}\"\n ]\n });\n\n api.addEndpointDescription('_put_search_template', {\n methods: ['PUT'],\n patterns: [\n \"_search/template/{id}\"\n ],\n data_autocomplete_rules: {\n \"template\": {\n __scope_link: \"_search\"\n }\n }\n });\n\n api.addEndpointDescription('_search_shards', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_search_shards\",\n \"{indices}/_search_shards\",\n \"_search_shards\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n local: \"__flag__\"\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/settings.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nmodule.exports = function (api) {\n\n api.addEndpointDescription('_get_settings', {\n patterns: [\"{indices}/_settings\", \"_settings\"],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n api.addEndpointDescription('_put_settings', {\n methods: ['PUT'],\n patterns: [\"{indices}/_settings\", \"_settings\"],\n data_autocomplete_rules: {\n refresh_interval: '1s',\n number_of_shards: 5,\n number_of_replicas: 1,\n 'blocks.read_only': {\n __one_of: [false, true]\n },\n 'blocks.read': {\n __one_of: [true, false]\n },\n 'blocks.write': {\n __one_of: [true, false]\n },\n 'blocks.metadata': {\n __one_of: [true, false]\n },\n term_index_interval: 32,\n term_index_divisor: 1,\n 'translog.flush_threshold_ops': 5000,\n 'translog.flush_threshold_size': '200mb',\n 'translog.flush_threshold_period': '30m',\n 'translog.disable_flush': {\n __one_of: [true, false]\n },\n 'cache.filter.max_size': '2gb',\n 'cache.filter.expire': '2h',\n 'gateway.snapshot_interval': '10s',\n routing: {\n allocation: {\n include: {\n tag: ''\n },\n exclude: {\n tag: ''\n },\n require: {\n tag: ''\n },\n total_shards_per_node: -1\n }\n },\n 'recovery.initial_shards': {\n __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1']\n },\n 'ttl.disable_purge': {\n __one_of: [true, false]\n },\n analysis: {\n analyzer: {},\n tokenizer: {},\n filter: {},\n char_filter: {}\n },\n 'cache.query.enable': {\n __one_of: [true, false]\n },\n shadow_replicas: {\n __one_of: [true, false]\n },\n shared_filesystem: {\n __one_of: [true, false]\n },\n data_path: 'path',\n codec: {\n __one_of: ['default', 'best_compression', 'lucene_default']\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWx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ICAgIG51bWJlcl9vZl9yZXBsaWNhczogMSxcbiAgICAgICdibG9ja3MucmVhZF9vbmx5Jzoge1xuICAgICAgICBfX29uZV9vZjogW2ZhbHNlLCB0cnVlXVxuICAgICAgfSxcbiAgICAgICdibG9ja3MucmVhZCc6IHtcbiAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgIH0sXG4gICAgICAnYmxvY2tzLndyaXRlJzoge1xuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgICdibG9ja3MubWV0YWRhdGEnOiB7XG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgdGVybV9pbmRleF9pbnRlcnZhbDogMzIsXG4gICAgICB0ZXJtX2luZGV4X2Rpdmlzb3I6IDEsXG4gICAgICAndHJhbnNsb2cuZmx1c2hfdGhyZXNob2xkX29wcyc6IDUwMDAsXG4gICAgICAndHJhbnNsb2cuZmx1c2hfdGhyZXNob2xkX3NpemUnOiAnMjAwbWInLFxuICAgICAgJ3RyYW5zbG9nLmZsdXNoX3RocmVzaG9sZF9wZXJpb2QnOiAnMzBtJyxcbiAgICAgICd0cmFuc2xvZy5kaXNhYmxlX2ZsdXNoJzoge1xuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgICdjYWNoZS5maWx0ZXIubWF4X3NpemUnOiAnMmdiJyxcbiAgICAgICdjYWNoZS5maWx0ZXIuZXhwaXJlJzogJzJoJyxcbiAgICAgICdnYXRld2F5LnNuYXBzaG90X2ludGVydmFsJzogJzEwcycsXG4gICAgICByb3V0aW5nOiB7XG4gICAgICAgIGFsbG9jYXRpb246IHtcbiAgICAgICAgICBpbmNsdWRlOiB7XG4gICAgICAgICAgICB0YWc6ICcnXG4gICAgICAgICAgfSxcbiAgICAgICAgICBleGNsdWRlOiB7XG4gICAgICAgICAgICB0YWc6ICcnXG4gICAgICAgICAgfSxcbiAgICAgICAgICByZXF1aXJlOiB7XG4gICAgICAgICAgICB0YWc6ICcnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB0b3RhbF9zaGFyZHNfcGVyX25vZGU6IC0xXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICAncmVjb3ZlcnkuaW5pdGlhbF9zaGFyZHMnOiB7XG4gICAgICAgIF9fb25lX29mOiBbJ3F1b3J1bScsICdxdW9ydW0tMScsICdoYWxmJywgJ2Z1bGwnLCAnZnVsbC0xJ11cbiAgICAgIH0sXG4gICAgICAndHRsLmRpc2FibGVfcHVyZ2UnOiB7XG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgYW5hbHlzaXM6IHtcbiAgICAgICAgYW5hbHl6ZXI6IHt9LFxuICAgICAgICB0b2tlbml6ZXI6IHt9LFxuICAgICAgICBmaWx0ZXI6IHt9LFxuICAgICAgICBjaGFyX2ZpbHRlcjoge31cbiAgICAgIH0sXG4gICAgICAnY2FjaGUucXVlcnkuZW5hYmxlJzoge1xuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgIHNoYWRvd19yZXBsaWNhczoge1xuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgIHNoYXJlZF9maWxlc3lzdGVtOiB7XG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgZGF0YV9wYXRoOiAncGF0aCcsXG4gICAgICBjb2RlYzoge1xuICAgICAgICBfX29uZV9vZjogWydkZWZhdWx0JywgJ2Jlc3RfY29tcHJlc3Npb24nLCAnbHVjZW5lX2RlZmF1bHQnXVxuICAgICAgfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_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ACR;AACD,+BAAqB,EAAE,CAAC,CAAC;SAC1B;OACF;AACD,+BAAyB,EAAE;AACzB,gBAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;OAC3D;AACD,yBAAmB,EAAE;AACnB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,cAAQ,EAAE;AACR,gBAAQ,EAAE,EAAE;AACZ,iBAAS,EAAE,EAAE;AACb,cAAM,EAAE,EAAE;AACV,mBAAW,EAAE,EAAE;OAChB;AACD,0BAAoB,EAAE;AACpB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,qBAAe,EAAE;AACf,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,uBAAiB,EAAE;AACjB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,eAAS,EAAE,MAAM;AACjB,WAAK,EAAE;AACL,gBAAQ,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,gBAAgB,CAAC;OAC5D;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/settings.js", + "sourcesContent": [ + "module.exports = function (api) {\n\n api.addEndpointDescription('_get_settings', {\n patterns: [\n \"{indices}/_settings\",\n \"_settings\"\n ],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n api.addEndpointDescription('_put_settings', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_settings\",\n \"_settings\"\n ],\n data_autocomplete_rules: {\n refresh_interval: '1s',\n number_of_shards: 5,\n number_of_replicas: 1,\n 'blocks.read_only': {\n __one_of: [false, true]\n },\n 'blocks.read': {\n __one_of: [true, false]\n },\n 'blocks.write': {\n __one_of: [true, false]\n },\n 'blocks.metadata': {\n __one_of: [true, false]\n },\n term_index_interval: 32,\n term_index_divisor: 1,\n 'translog.flush_threshold_ops': 5000,\n 'translog.flush_threshold_size': '200mb',\n 'translog.flush_threshold_period': '30m',\n 'translog.disable_flush': {\n __one_of: [true, false]\n },\n 'cache.filter.max_size': '2gb',\n 'cache.filter.expire': '2h',\n 'gateway.snapshot_interval': '10s',\n routing: {\n allocation: {\n include: {\n tag: ''\n },\n exclude: {\n tag: ''\n },\n require: {\n tag: ''\n },\n total_shards_per_node: -1\n }\n },\n 'recovery.initial_shards': {\n __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1']\n },\n 'ttl.disable_purge': {\n __one_of: [true, false]\n },\n analysis: {\n analyzer: {},\n tokenizer: {},\n filter: {},\n char_filter: {}\n },\n 'cache.query.enable': {\n __one_of: [true, false]\n },\n shadow_replicas: {\n __one_of: [true, false]\n },\n shared_filesystem: {\n __one_of: [true, false]\n },\n data_path: 'path',\n codec: {\n __one_of: ['default', 'best_compression', 'lucene_default']\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/templates.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_delete_template', {\n methods: ['DELETE'],\n patterns: [\"_template/{id}\"]\n });\n api.addEndpointDescription('_get_template', {\n methods: ['GET'],\n patterns: [\"_template/{id}\", \"_template\"]\n });\n api.addEndpointDescription('_put_template', {\n methods: ['PUT'],\n patterns: [\"_template/{id}\"],\n data_autocomplete_rules: {\n template: 'index*',\n warmers: { __scope_link: '_warmer' },\n mappings: { __scope_link: '_put_mapping' },\n settings: { __scope_link: '_put_settings' }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0L3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvdGVtcGxhdGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsa0JBQWtCLEVBQUU7QUFDN0MsV0FBTyxFQUFFLENBQUMsUUFBUSxDQUFDO0FBQ25CLFlBQVEsRUFBRSxDQUNSLGdCQUFnQixDQUNqQjtHQUNGLENBQUMsQ0FBQztBQUNILEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxlQUFlLEVBQUU7QUFDMUMsV0FBTyxFQUFFLENBQUMsS0FBSyxDQUFDO0FBQ2hCLFlBQVEsRUFBRSxDQUNSLGdCQUFnQixFQUNoQixXQUFXLENBQ1o7R0FDRixDQUFDLENBQUM7QUFDSCxLQUFHLENBQUMsc0JBQXNCLENBQUMsZUFBZSxFQUFFO0FBQzFDLFdBQU8sRUFBRSxDQUFDLEtBQUssQ0FBQztBQUNoQixZQUFRLEVBQUUsQ0FDUixnQkFBZ0IsQ0FDakI7QUFDRCwyQkFBdUIsRUFBRTtBQUN2QixjQUFRLEVBQUUsUUFBUTtBQUNsQixhQUFPLEVBQUUsRUFBQyxZQUFZLEVBQUUsU0FBUyxFQUF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19fc2NvcGVfbGluazogJ19wdXRfbWFwcGluZyd9LFxuICAgICAgc2V0dGluZ3M6IHtfX3Njb3BlX2xpbms6ICdfcHV0X3NldHRpbmdzJ31cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/templates.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,kBAAkB,EAAE;AAC7C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,gBAAgB,CACjB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,gBAAgB,EAChB,WAAW,CACZ;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,gBAAgB,CACjB;AACD,2BAAuB,EAAE;AACvB,cAAQ,EAAE,QAAQ;AAClB,aAAO,EAAE,EAAC,YAAY,EAAE,SAAS,EAAC;AAClC,cAAQ,EAAE,EAAC,YAAY,EAAE,cAAc,EAAC;AACxC,cAAQ,EAAE,EAAC,YAAY,EAAE,eAAe,EAAC;KAC1C;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/templates.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_delete_template', {\n methods: ['DELETE'],\n patterns: [\n \"_template/{id}\",\n ]\n });\n api.addEndpointDescription('_get_template', {\n methods: ['GET'],\n patterns: [\n \"_template/{id}\",\n \"_template\",\n ]\n });\n api.addEndpointDescription('_put_template', {\n methods: ['PUT'],\n patterns: [\n \"_template/{id}\",\n ],\n data_autocomplete_rules: {\n template: 'index*',\n warmers: {__scope_link: '_warmer'},\n mappings: {__scope_link: '_put_mapping'},\n settings: {__scope_link: '_put_settings'}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/warmers.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_warmer', {\n patterns: [\"_warmer\", \"_warmer/{name}\", \"{indices}/_warmer\", \"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_delete_warmer', {\n methods: ['DELETE'],\n patterns: [\"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_put_warmer', {\n methods: ['PUT'],\n patterns: [\"{indices}/_warmer/{name}\", \"{indices}/{types}/_warmer/{name}\"],\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n // populated by a global rule\n },\n aggs: {},\n sort: {\n __scope_link: \"_search.sort\"\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L2VsZWN0cm9uLXF1aWNrLXN0YXJ0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lvbiAoYXBpKSB7XG4gIGFwaS5hZGRFbmRwb2ludERlc2NyaXB0aW9uKCdfZ2V0X3dhcm1lcicsIHtcbiAgICBwYXR0ZXJuczogW1wiX3dhcm1lclwiLCBcIl93YXJtZXIve25hbWV9XCIsIFwie2luZGljZXN9L193YXJtZXJcIiwgXCJ7aW5kaWNlc30vX3dhcm1lci97bmFtZX1cIl1cbiAgfSk7XG4gIGFwaS5hZGRFbmRwb2ludERlc2NyaXB0aW9uKCdfZGVsZXRlX3dhcm1lcicsIHtcbiAgICBtZXRob2RzOiBbJ0RFTEVURSddLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS9fd2FybWVyL3tuYW1lfVwiXG4gICAgXVxuICB9KTtcbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19wdXRfd2FybWVyJywge1xuICAgIG1ldGhvZHM6IFsnUFVUJ10sXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L193YXJtZXIve25hbWV9XCIsXG4gICAgICBcIntpbmRpY2VzfS97dHlwZXN9L193YXJtZXIve25hbWV9XCJcbiAgICBdLFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBxdWVyeToge1xuICAgICAgICAvLyBwb3B1bGF0ZWQgYnkgYSBnbG9iYWwgcnVsZVxuICAgICAgfSxcbiAgICAgIGZhY2V0czoge1xuICAgICAgICAvLyBwb3B1bGF0ZWQgYnkgYSBnbG9iYWwgcnVsZVxuICAgICAgfSxcbiAgICAgIGFnZ3M6IHt9LFxuICAgICAgc29ydDoge1xuICAgICAgICBfX3Njb3BlX2xpbms6IFwiX3NlYXJjaC5zb3J0XCJcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/warmers.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,YAAQ,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,0BAA0B,CAAC;GACzF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;AAC3C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,0BAA0B,CAC3B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,0BAA0B,EAC1B,kCAAkC,CACnC;AACD,2BAAuB,EAAE;AACvB,WAAK,EAAE;;OAEN;AACD,YAAM,EAAE;;OAEP;AACD,UAAI,EAAE,EAAE;AACR,UAAI,EAAE;AACJ,oBAAY,EAAE,cAAc;OAC7B;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/electron-quick-start/sense/installedPlugins/sense/api_server/es_2_0/warmers.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_get_warmer', {\n patterns: [\"_warmer\", \"_warmer/{name}\", \"{indices}/_warmer\", \"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_delete_warmer', {\n methods: ['DELETE'],\n patterns: [\n \"{indices}/_warmer/{name}\"\n ]\n });\n api.addEndpointDescription('_put_warmer', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_warmer/{name}\",\n \"{indices}/{types}/_warmer/{name}\"\n ],\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n // populated by a global rule\n },\n aggs: {},\n sort: {\n __scope_link: \"_search.sort\"\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/index.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (kibana) {\n var _require = require('path');\n\n var resolve = _require.resolve;\n var join = _require.join;\n var sep = _require.sep;\n\n var Joi = require('joi');\n var Boom = require('boom');\n var modules = resolve(__dirname, 'public/webpackShims/');\n var src = resolve(__dirname, 'public/src/');\n\n var _require2 = require('fs');\n\n var existsSync = _require2.existsSync;\n\n var _require3 = require('lodash');\n\n var startsWith = _require3.startsWith;\n var endsWith = _require3.endsWith;\n\n var apps = [{\n title: 'Sense',\n description: 'JSON aware developer\\'s interface to ElasticSearch',\n icon: 'plugins/sense/bonsai.png',\n main: 'plugins/sense/sense',\n autoload: kibana.autoload.styles,\n injectVars: function injectVars(server, options) {\n return options;\n }\n }];\n\n if (existsSync(resolve(__dirname, 'public/tests'))) {\n apps.push({\n title: 'Sense Tests',\n id: 'sense-tests',\n main: 'plugins/sense/tests',\n hidden: true\n //listed: false // uncomment after https://github.com/elastic/kibana/pull/4755\n });\n }\n\n return new kibana.Plugin({\n id: 'sense',\n\n config: function config(Joi) {\n return Joi.object({\n enabled: Joi.boolean()['default'](true),\n defaultServerUrl: Joi.string()['default']('http://localhost:9200'),\n proxyFilter: Joi.array().items(Joi.string()).single()['default'](['.*'])\n })['default']();\n },\n\n init: function init(server, options) {\n var filters = options.proxyFilter.map(function (str) {\n return new RegExp(str);\n });\n\n // http://hapijs.com/api/8.8.1#route-configuration\n server.route({\n path: '/api/sense/proxy',\n method: ['*', 'GET'],\n config: {\n handler: {\n proxy: {\n mapUri: function mapUri(req, cb) {\n var uri = req.query.uri;\n\n if (!uri) {\n cb(Boom.badRequest('URI is a required param.'));\n return;\n }\n\n if (!filters.some(function (re) {\n return re.test(uri);\n })) {\n var err = Boom.forbidden();\n err.output.payload = \"Error connecting to '\" + uri + \"':\\n\\nUnable to send requests to that url.\";\n err.output.headers['content-type'] = 'text/plain';\n cb(err);\n return;\n }\n\n cb(null, uri);\n },\n passThrough: true,\n xforward: true,\n onResponse: function onResponse(err, res, request, reply, settings, ttl) {\n if (err != null) {\n reply(\"Error connecting to '\" + request.query.uri + \"':\\n\\n\" + err.message).type(\"text/plain\").statusCode = 502;\n } else {\n reply(null, res);\n }\n }\n }\n }\n }\n });\n\n server.route({\n path: '/api/sense/api_server',\n method: ['GET', 'POST'],\n handler: function handler(req, reply) {\n var server = require('./api_server/server');\n var _req$query = req.query;\n var sense_version = _req$query.sense_version;\n var apis = _req$query.apis;\n\n if (!apis) {\n reply(Boom.badRequest('\"apis\" is a required param.'));\n return;\n }\n\n return server.resolveApi(sense_version, apis.split(\",\"), reply);\n }\n });\n\n var testApp = kibana.uiExports.apps.hidden.byId['sense-tests'];\n if (testApp) {\n server.route({\n path: '/app/sense-tests',\n method: 'GET',\n handler: function handler(req, reply) {\n return reply.renderApp(testApp);\n }\n });\n }\n },\n\n uiExports: {\n apps: apps,\n\n noParse: [join(modules, 'ace' + sep), join(modules, 'moment_src/moment' + sep), join(src, 'sense_editor/mode/worker.js')]\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2luZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3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1bHRTZXJ2ZXJVcmw6IEpvaS5zdHJpbmcoKS5kZWZhdWx0KCdodHRwOi8vbG9jYWxob3N0OjkyMDAnKSxcbiAgICAgICAgcHJveHlGaWx0ZXI6IEpvaS5hcnJheSgpLml0ZW1zKEpvaS5zdHJpbmcoKSkuc2luZ2xlKCkuZGVmYXVsdChbJy4qJ10pLFxuICAgICAgfSkuZGVmYXVsdCgpO1xuICAgIH0sXG5cbiAgICBpbml0OiBmdW5jdGlvbiAoc2VydmVyLCBvcHRpb25zKSB7XG4gICAgICBjb25zdCBmaWx0ZXJzID0gb3B0aW9ucy5wcm94eUZpbHRlci5tYXAoc3RyID0+IG5ldyBSZWdFeHAoc3RyKSk7XG5cbiAgICAgIC8vIGh0dHA6Ly9oYXBpanMuY29tL2FwaS84LjguMSNyb3V0ZS1jb25maWd1cmF0aW9uXG4gICAgICBzZXJ2ZXIucm91dGUoe1xuICAgICAgICBwYXRoOiAnL2FwaS9zZW5zZS9wcm94eScsXG4gICAgICAgIG1ldGhvZDogWycqJywgJ0dFVCddLFxuICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICBoYW5kbGVyOiB7XG4gICAgICAgICAgICBwcm94eToge1xuICAgICAgICAgICAgICBtYXBVcmk6IGZ1bmN0aW9uIChyZXEsIGNiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHsgdXJpIH0gPSByZXEucXVlcnk7XG4gICAgICAgICAgICAgICAgaWYgKCF1cmkpIHtcbiAgICAgICAgICAgICAgICAgIGNiKEJvb20uYmFkUmVxdWVzdCgnVVJJIGlzIGEgcmVxdWlyZWQgcGFyYW0uJykpO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghZmlsdGVycy5zb21lKHJlID0+IHJlLnRlc3QodXJpKSkpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGVyciA9IEJvb20uZm9yYmlkZGVuKCk7XG4gICAgICAgICAgICAgICAgICBlcnIub3V0cHV0LnBheWxvYWQgPSBcIkVycm9yIGNvbm5lY3RpbmcgdG8gJ1wiICsgdXJpICsgXCInOlxcblxcblVuYWJsZSB0byBzZW5kIHJlcXVlc3RzIHRvIHRoYXQgdXJsLlwiO1xuICAgICAgICAgICAgICAgICAgZXJyLm91dHB1dC5oZWFkZXJzWydjb250ZW50LXR5cGUnXSA9ICd0ZXh0L3BsYWluJztcbiAgICAgICAgICAgICAgICAgIGNiKGVycik7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY2IobnVsbCwgdXJpKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgcGFzc1Rocm91Z2g6IHRydWUsXG4gICAgICAgICAgICAgIHhmb3J3YXJkOiB0cnVlLFxuICAgICAgICAgICAgICBvblJlc3BvbnNlOiBmdW5jdGlvbiAoZXJyLCByZXMsIHJlcXVlc3QsIHJlcGx5LCBzZXR0aW5ncywgdHRsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGVyciAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICByZXBseShcIkVycm9yIGNvbm5lY3RpbmcgdG8gJ1wiICsgcmVxdWVzdC5xdWVyeS51cmkgKyBcIic6XFxuXFxuXCIgKyBlcnIubWVzc2FnZSkudHlwZShcInRleHQvcGxhaW5cIikuc3RhdHVzQ29kZSA9IDUwMjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgcmVwbHkobnVsbCwgcmVzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICBzZXJ2ZXIucm91dGUoe1xuICAgICAgICBwYXRoOiAnL2FwaS9zZW5zZS9hcGlfc2VydmVyJyxcbiAgICAgICAgbWV0aG9kOiBbJ0dFVCcsICdQT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gc2VwKSxcbiAgICAgICAgam9pbihzcmMsICdzZW5zZV9lZGl0b3IvbW9kZS93b3JrZXIuanMnKVxuICAgICAgXVxuICAgIH1cbiAgfSlcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/index.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,MAAM,EAAE;iBACJ,OAAO,CAAC,MAAM,CAAC;;MAAtC,OAAO,YAAP,OAAO;MAAE,IAAI,YAAJ,IAAI;MAAE,GAAG,YAAH,GAAG;;AACxB,MAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AACzB,MAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,MAAI,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AACzD,MAAI,GAAG,GAAG,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;;kBACvB,OAAO,CAAC,IAAI,CAAC;;MAA5B,UAAU,aAAV,UAAU;;kBACiB,OAAO,CAAC,QAAQ,CAAC;;MAA1C,UAAU,aAAV,UAAU;MAAE,QAAQ,aAAR,QAAQ;;AAE5B,MAAM,IAAI,GAAG,CACX;AACE,SAAK,EAAE,OAAO;AACd,eAAW,EAAE,oDAAoD;AACjE,QAAI,EAAE,0BAA0B;AAChC,QAAI,EAAE,qBAAqB;AAC3B,YAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;AAChC,cAAU,EAAE,oBAAU,MAAM,EAAE,OAAO,EAAE;AACrC,aAAO,OAAO,CAAC;KAChB;GACF,CACF,CAAC;;AAEF,MAAI,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,EAAE;AAClD,QAAI,CAAC,IAAI,CAAC;AACR,WAAK,EAAE,aAAa;AACpB,QAAE,EAAE,aAAa;AACjB,UAAI,EAAE,qBAAqB;AAC3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KAAK,CAAC,CAAC;SACjE;OACF,CAAC,CAAC;;AAEH,UAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACjE,UAAI,OAAO,EAAE;AACX,cAAM,CAAC,KAAK,CAAC;AACX,cAAI,EAAE,kBAAkB;AACxB,gBAAM,EAAE,KAAK;AACb,iBAAO,EAAE,iBAAU,GAAG,EAAE,KAAK,EAAE;AAC7B,mBAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;WACjC;SACF,CAAC,CAAC;OACJ;KACF;;AAED,aAAS,EAAE;AACT,UAAI,EAAE,IAAI;;AAEV,aAAO,EAAE,CACP,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,GAAG,CAAC,EAC1B,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EACxC,IAAI,CAAC,GAAG,EAAE,6BAA6B,CAAC,CACzC;KACF;GACF,CAAC,CAAA;CACH,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/index.js", + "sourcesContent": [ + "module.exports = function (kibana) {\n let { resolve, join, sep } = require('path');\n let Joi = require('joi');\n let Boom = require('boom');\n let modules = resolve(__dirname, 'public/webpackShims/');\n let src = resolve(__dirname, 'public/src/');\n let { existsSync } = require('fs');\n const { startsWith, endsWith } = require('lodash');\n\n const apps = [\n {\n title: 'Sense',\n description: 'JSON aware developer\\'s interface to ElasticSearch',\n icon: 'plugins/sense/bonsai.png',\n main: 'plugins/sense/sense',\n autoload: kibana.autoload.styles,\n injectVars: function (server, options) {\n return options;\n }\n }\n ];\n\n if (existsSync(resolve(__dirname, 'public/tests'))) {\n apps.push({\n title: 'Sense Tests',\n id: 'sense-tests',\n main: 'plugins/sense/tests',\n hidden: true\n //listed: false // uncomment after https://github.com/elastic/kibana/pull/4755\n });\n }\n\n return new kibana.Plugin({\n id: 'sense',\n\n config: function (Joi) {\n return Joi.object({\n enabled: Joi.boolean().default(true),\n defaultServerUrl: Joi.string().default('http://localhost:9200'),\n proxyFilter: Joi.array().items(Joi.string()).single().default(['.*']),\n }).default();\n },\n\n init: function (server, options) {\n const filters = options.proxyFilter.map(str => new RegExp(str));\n\n // http://hapijs.com/api/8.8.1#route-configuration\n server.route({\n path: '/api/sense/proxy',\n method: ['*', 'GET'],\n config: {\n handler: {\n proxy: {\n mapUri: function (req, cb) {\n let { uri } = req.query;\n if (!uri) {\n cb(Boom.badRequest('URI is a required param.'));\n return;\n }\n\n if (!filters.some(re => re.test(uri))) {\n const err = Boom.forbidden();\n err.output.payload = \"Error connecting to '\" + uri + \"':\\n\\nUnable to send requests to that url.\";\n err.output.headers['content-type'] = 'text/plain';\n cb(err);\n return;\n }\n\n cb(null, uri);\n },\n passThrough: true,\n xforward: true,\n onResponse: function (err, res, request, reply, settings, ttl) {\n if (err != null) {\n reply(\"Error connecting to '\" + request.query.uri + \"':\\n\\n\" + err.message).type(\"text/plain\").statusCode = 502;\n } else {\n reply(null, res);\n }\n }\n }\n }\n }\n });\n\n server.route({\n path: '/api/sense/api_server',\n method: ['GET', 'POST'],\n handler: function (req, reply) {\n let server = require('./api_server/server');\n let {sense_version, apis} = req.query;\n if (!apis) {\n reply(Boom.badRequest('\"apis\" is a required param.'));\n return;\n }\n\n return server.resolveApi(sense_version, apis.split(\",\"), reply);\n }\n });\n\n const testApp = kibana.uiExports.apps.hidden.byId['sense-tests'];\n if (testApp) {\n server.route({\n path: '/app/sense-tests',\n method: 'GET',\n handler: function (req, reply) {\n return reply.renderApp(testApp);\n }\n });\n }\n },\n\n uiExports: {\n apps: apps,\n\n noParse: [\n join(modules, 'ace' + sep),\n join(modules, 'moment_src/moment' + sep),\n join(src, 'sense_editor/mode/worker.js')\n ]\n }\n })\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/server.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\nmodule.exports.resolveApi = function (sense_version, apis, reply) {\n var result = {};\n _.each(apis, function (name) {\n {\n // for now we ignore sense_version. might add it in the api name later\n var api = require('./' + name);\n result[name] = api.asJson();\n }\n });\n\n return reply(result).type(\"application/json\");\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvc2VydmVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxDQUFDLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDOztBQUUxQixNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsR0FBRyxVQUFVLGFBQWEsRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFO0FBQ2hFLE1BQUksTUFBTSxHQUFHLEVBQUUsQ0FBQztBQUNoQixHQUFDLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxVQUFVLElBQUksRUFBRTtBQUMzQjs7QUFFRSxVQUFJLEdBQUcsR0FBRyxPQUFPLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQyxDQUFDO0FBQy9CLFlBQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxHQUFHLENBQUMsTUFBTSxFQUFFLENBQUM7S0FDN0I7R0FDRixDQUFDLENBQUM7O0FBRUgsU0FBTyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLGtCQUFrQixDQUFDLENBQUM7Q0FDL0MsQ0FBQyIsImZpbGUiOiIvVXNlcnMvZ2lsbHliL2Rldi9zZW5zaXRpdmUvc2Vuc2UvaW5zdGFsbGVkUGx1Z2lucy9zZW5zZS9hcGlfc2VydmVyL3NlcnZlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBfID0gcmVxdWlyZShcImxvZGFzaFwiKTtcblxubW9kdWxlLmV4cG9ydHMucmVzb2x2ZUFwaSA9IGZ1bmN0aW9uIChzZW5zZV92ZXJzaW9uLCBhcGlzLCByZXBseSkge1xuICBsZXQgcmVzdWx0ID0ge307XG4gIF8uZWFjaChhcGlzLCBmdW5jdGlvbiAobmFtZSkge1xuICAgIHtcbiAgICAgIC8vIGZvciBub3cgd2UgaWdub3JlIHNlbnNlX3ZlcnNpb24uIG1pZ2h0IGFkZCBpdCBpbiB0aGUgYXBpIG5hbWUgbGF0ZXJcbiAgICAgIGxldCBhcGkgPSByZXF1aXJlKCcuLycgKyBuYW1lKTtcbiAgICAgIHJlc3VsdFtuYW1lXSA9IGFwaS5hc0pzb24oKTtcbiAgICB9XG4gIH0pO1xuXG4gIHJldHVybiByZXBseShyZXN1bHQpLnR5cGUoXCJhcHBsaWNhdGlvbi9qc29uXCIpO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/server.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE;AAChE,MAAI,MAAM,GAAG,EAAE,CAAC;AAChB,GAAC,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE;AAC3B;;AAEE,UAAI,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAC/B,YAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;KAC7B;GACF,CAAC,CAAC;;AAEH,SAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;CAC/C,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/server.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nmodule.exports.resolveApi = function (sense_version, apis, reply) {\n let result = {};\n _.each(apis, function (name) {\n {\n // for now we ignore sense_version. might add it in the api name later\n let api = require('./' + name);\n result[name] = api.asJson();\n }\n });\n\n return reply(result).type(\"application/json\");\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\nvar Api = require('./api');\nvar parts = [require('./es_2_0/aliases'), require('./es_2_0/aggregations'), require('./es_2_0/cat'), require('./es_2_0/cluster'), require('./es_2_0/count'), require('./es_2_0/document'), require('./es_2_0/field_stats'), require('./es_2_0/filter'), require('./es_2_0/nodes'), require('./es_2_0/globals'), require('./es_2_0/indices'), require('./es_2_0/mappings'), require('./es_2_0/percolator'), require('./es_2_0/query'), require('./es_2_0/snapshot_restore'), require('./es_2_0/search'), require('./es_2_0/settings'), require('./es_2_0/templates'), require('./es_2_0/warmers')];\n\nfunction ES_2_0() {\n Api.call(this, \"es_2_0\");\n _.each(parts, function (apiSection) {\n apiSection(this);\n }, this);\n}\n\nES_2_0.prototype = _.create(Api.prototype, { 'constructor': ES_2_0 });\n\n(function (cls) {\n cls.addEndpointDescription = function (endpoint, description) {\n if (description) {\n var url_params_def = {};\n _.each(description.patterns || [], function (p) {\n if (p.indexOf(\"{indices}\") >= 0) {\n url_params_def[\"ignore_unavailable\"] = \"__flag__\";\n url_params_def[\"allow_no_indices\"] = \"__flag__\";\n url_params_def[\"expand_wildcards\"] = [\"open\", \"closed\"];\n }\n });\n\n if (url_params_def) {\n description.url_params = description.url_params || {};\n _.defaults(description.url_params, url_params_def);\n }\n }\n Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);\n };\n})(ES_2_0.prototype);\n\nmodule.exports = new ES_2_0();\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxDQUFDLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBQzFCLElBQUksR0FBRyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUMzQixJQUFJLEtBQUssR0FBRyxDQUNWLE9B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fLmRlZmF1bHRzKGRlc2NyaXB0aW9uLnVybF9wYXJhbXMsIHVybF9wYXJhbXNfZGVmKTtcbiAgICAgIH1cbiAgICB9XG4gICAgT2JqZWN0LmdldFByb3RvdHlwZU9mKGNscykuYWRkRW5kcG9pbnREZXNjcmlwdGlvbi5jYWxsKHRoaXMsIGVuZHBvaW50LCBkZXNjcmlwdGlvbik7XG4gIH07XG59KShFU18yXzAucHJvdG90eXBlKTtcblxubW9kdWxlLmV4cG9ydHMgPSBuZXcgRVNfMl8wKCk7XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC1B,IAAI,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3B,IAAI,KAAK,GAAG,CACV,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,uBAAuB,CAAC,EAChC,OAAO,CAAC,cAAc,CAAC,EACvB,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,gBAAgB,CAAC,EACzB,OAAO,CAAC,mBAAmB,CAAC,EAC5B,OAAO,CAAC,sBAAsB,CAAC,EAC/B,OAAO,CAAC,iBAAiB,CAAC,EAC1B,OAAO,CAAC,gBAAgB,CAAC,EACzB,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,mBAAmB,CAAC,EAC5B,OAAO,CAAC,qBAAqB,CAAC,EAC9B,OAAO,CAAC,gBAAgB,CAAC,EACzB,OAAO,CAAC,2BAA2B,CAAC,EACpC,OAAO,CAAC,iBAAiB,CAAC,EAC1B,OAAO,CAAC,mBAAmB,CAAC,EAC5B,OAAO,CAAC,oBAAoB,CAAC,EAC7B,OAAO,CAAC,kBAAkB,CAAC,CAC5B,CAAC;;AAEF,SA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AAM,EAAE,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\nlet Api = require('./api');\nlet parts = [\n require('./es_2_0/aliases'),\n require('./es_2_0/aggregations'),\n require('./es_2_0/cat'),\n require('./es_2_0/cluster'),\n require('./es_2_0/count'),\n require('./es_2_0/document'),\n require('./es_2_0/field_stats'),\n require('./es_2_0/filter'),\n require('./es_2_0/nodes'),\n require('./es_2_0/globals'),\n require('./es_2_0/indices'),\n require('./es_2_0/mappings'),\n require('./es_2_0/percolator'),\n require('./es_2_0/query'),\n require('./es_2_0/snapshot_restore'),\n require('./es_2_0/search'),\n require('./es_2_0/settings'),\n require('./es_2_0/templates'),\n require('./es_2_0/warmers')\n];\n\nfunction ES_2_0() {\n Api.call(this, \"es_2_0\");\n _.each(parts, function (apiSection) {\n apiSection(this);\n }, this);\n}\n\nES_2_0.prototype = _.create(Api.prototype, {'constructor': ES_2_0});\n\n(function (cls) {\n cls.addEndpointDescription = function (endpoint, description) {\n if (description) {\n var url_params_def = {};\n _.each(description.patterns || [], function (p) {\n if (p.indexOf(\"{indices}\") >= 0) {\n url_params_def[\"ignore_unavailable\"] = \"__flag__\";\n url_params_def[\"allow_no_indices\"] = \"__flag__\";\n url_params_def[\"expand_wildcards\"] = [\"open\", \"closed\"];\n }\n });\n\n if (url_params_def) {\n description.url_params = description.url_params || {};\n _.defaults(description.url_params, url_params_def);\n }\n }\n Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);\n };\n})(ES_2_0.prototype);\n\nmodule.exports = new ES_2_0();\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/api.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\n'use strict';\n\n/**\n *\n * @param name\n */\nfunction Api(name) {\n this.globalRules = {};\n this.endpoints = {};\n this.name = name;\n}\n\n(function (cls) {\n cls.addGlobalAutocompleteRules = function (parentNode, rules) {\n this.globalRules[parentNode] = rules;\n };\n\n cls.addEndpointDescription = function (endpoint, description) {\n if (this.endpoints[endpoint]) {\n throw new Error(\"endpoint [\" + endpoint + \"] is already registered\");\n }\n\n var copiedDescription = {};\n _.extend(copiedDescription, description || {});\n _.defaults(copiedDescription, {\n id: endpoint,\n patterns: [endpoint],\n methods: ['GET']\n });\n this.endpoints[endpoint] = copiedDescription;\n };\n\n cls.asJson = function () {\n return {\n \"name\": this.name,\n \"globals\": this.globalRules,\n \"endpoints\": this.endpoints\n };\n };\n})(Api.prototype);\n\nmodule.exports = Api;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvYXBpLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBTSxDQUFDLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDOztBQUU1QixZQUFZLENBQUM7Ozs7OztBQU1iLFNBQVMsR0FBRyxDQUFDLElBQUksRUFBRTtBQUNqQixNQ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ge307XG4gICAgXy5leHRlbmQoY29waWVkRGVzY3JpcHRpb24sIGRlc2NyaXB0aW9uIHx8IHt9KTtcbiAgICBfLmRlZmF1bHRzKGNvcGllZERlc2NyaXB0aW9uLCB7XG4gICAgICBpZDogZW5kcG9pbnQsXG4gICAgICBwYXR0ZXJuczogW2VuZHBvaW50XSxcbiAgICAgIG1ldGhvZHM6IFsnR0VUJ11cbiAgICB9KTtcbiAgICB0aGlzLmVuZHBvaW50c1tlbmRwb2ludF0gPSBjb3BpZWREZXNjcmlwdGlvbjtcbiAgfTtcblxuICBjbHMuYXNKc29uID0gZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiB7XG4gICAgICBcIm5hbWVcIjogdGhpcy5uYW1lLFxuICAgICAgXCJnbG9iYWxzXCI6IHRoaXMuZ2xvYmFsUnVsZXMsXG4gICAgICBcImVuZHBvaW50c1wiOiB0aGlzLmVuZHBvaW50c1xuICAgIH1cbiAgfTtcblxufShBcGkucHJvdG90eXBlKSk7XG5cbm1vZHVsZS5leHBvcnRzID0gQXBpO1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/api.js" + ], + "names": [], + "mappings": ";;AAAA,IAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE5B,YAAY,CAAC;;;;;;AAMb,SAAS,GAAG,CAAC,IAAI,EAAE;AACjB,MAAI,CAAC,WAAW,GAAG,EAAE,CAAC;AACtB,MAAI,CAAC,SAAS,GAAG,EAAE,CAAC;AACpB,MAAI,CAAC,IAAI,GAAG,IAAI,CAAC;CAClB;;AAED,AAAC,CAAA,UAAU,GAAG,EAAE;AACd,KAAG,CAAC,0BAA0B,GAAG,UAAU,UAAU,EAAE,KAAK,EAAE;AAC5D,QAAI,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;GACtC,CAAC;;AAEF,KAAG,CAAC,sBAAsB,GAAG,UAAU,QAAQ,EAAE,WAAW,EAAE;AAC5D,QAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,YAAM,IAAI,KAAK,CAAC,YAAY,GAAG,QAAQ,GAAG,yBAAyB,CAAC,CAAC;KACtE;;AAED,QAAI,iBAAiB,GAAG,EAAE,CAAC;AAC3B,KAAC,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,IAAI,EAAE,CAAC,CAAC;AAC/C,KAAC,CAAC,QAAQ,CAAC,iBAAiB,EAAE;AAC5B,QAAE,EAAE,QAAQ;AACZ,cAAQ,EAAE,CAAC,QAAQ,CAAC;AACpB,aAAO,EAAE,CAAC,KAAK,CAAC;KACjB,CAAC,CAAC;AACH,QAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC;GAC9C,CAAC;;AAEF,KAAG,CAAC,MAAM,GAAG,YAAY;AACvB,WAAO;AACL,YAAM,EAAE,IAAI,CAAC,IAAI;AACjB,eAAS,EAAE,IAAI,CAAC,WAAW;AAC3B,iBAAW,EAAE,IAAI,CAAC,SAAS;KAC5B,CAAA;GACF,CAAC;CAEH,CAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAE;;AAElB,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/api.js", + "sourcesContent": [ + "const _ = require(\"lodash\");\n\n'use strict';\n\n/**\n *\n * @param name\n */\nfunction Api(name) {\n this.globalRules = {};\n this.endpoints = {};\n this.name = name;\n}\n\n(function (cls) {\n cls.addGlobalAutocompleteRules = function (parentNode, rules) {\n this.globalRules[parentNode] = rules;\n };\n\n cls.addEndpointDescription = function (endpoint, description) {\n if (this.endpoints[endpoint]) {\n throw new Error(\"endpoint [\" + endpoint + \"] is already registered\");\n }\n\n var copiedDescription = {};\n _.extend(copiedDescription, description || {});\n _.defaults(copiedDescription, {\n id: endpoint,\n patterns: [endpoint],\n methods: ['GET']\n });\n this.endpoints[endpoint] = copiedDescription;\n };\n\n cls.asJson = function () {\n return {\n \"name\": this.name,\n \"globals\": this.globalRules,\n \"endpoints\": this.endpoints\n }\n };\n\n}(Api.prototype));\n\nmodule.exports = Api;\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/aliases.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_post_aliases', {\n methods: ['POST'],\n patterns: [\"_aliases\"],\n data_autocomplete_rules: {\n 'actions': {\n __template: [{ 'add': { 'index': 'test1', 'alias': 'alias1' } }],\n __any_of: [{\n add: {\n index: '{index}',\n alias: '',\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n },\n remove: {\n index: '',\n alias: ''\n }\n }]\n }\n }\n });\n api.addEndpointDescription('_get_aliases', {\n methods: ['GET'],\n patterns: [\"_aliases\"]\n });\n\n var aliasRules = {\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n };\n\n api.addEndpointDescription('_post_alias', {\n methods: [\"POST\", \"PUT\"],\n patterns: [\"{indices}/_alias/{name}\"],\n data_autocomplete_rules: aliasRules\n });\n api.addEndpointDescription('_delete_alias', {\n methods: [\"DELETE\"],\n patterns: [\"{indices}/_alias/{name}\"]\n });\n api.addEndpointDescription('_get_alias', {\n methods: [\"GET\"],\n patterns: [\"_alias\", \"{indices}/_alias\", \"{indices}/_alias/{name}\", \"_alias/{name}\"]\n });\n\n api.addGlobalAutocompleteRules('aliases', {\n '*': aliasRules\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2FsaWFzZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxlQUFlLEVBQUU7QUFDMUMsV0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDO0FBQ2pCLFlBQVEsRUFBRSxDQUNSLFVBQVUsQ0FDWDtBQUNELDJCQUF1QixFQUFFO0FBQ3ZCLGVBQVMsRUFBRTtBQUNULGtCQUFVLEVBQUUsQ0FDVixFQUFDLEtBQUssRUFBRSxFQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUUsT0FBTyxFQUFFLFFBQVEsRUFBQyxFQUFDLENBQy9DO0FBQ0QsZ0JBQVEsRUFBRSxDQUNSO0FBQ0UsYUFBRyxFQUFFO0FBQ0gsaUJBQUssRUFBRSxTQUFTO0FBQ2hCLGlCQUFLLEVBQUUsRUFBRTtBQUNULGtCQUFNLEVBQUUsRUFBRTtBQUNWLG1CQUFPLEVBQUUsR0FBRztBQUNaLDBCQUFjLEVBQUUsS0FBSztBQUNyQix5QkFBYSxFQUFFLEdBQUc7V0FDbkI7QUFDRCxnQkFBTSxFQUFFO0FBQ04saUJBQUssRUFBRSxFQUFFO0FBQ1QsaUJBQUssRUFBRSxFQUFFO1dBQ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xlIjoiL1VzZXJzL2dpbGx5Yi9kZXYvc2Vuc2l0aXZlL3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18yXzAvYWxpYXNlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGFwaSkge1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3Bvc3RfYWxpYXNlcycsIHtcbiAgICBtZXRob2RzOiBbJ1BPU1QnXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJfYWxpYXNlc1wiLFxuICAgIF0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgICdhY3Rpb25zJzoge1xuICAgICAgICBfX3RlbXBsYXRlOiBbXG4gICAgICAgICAgeydhZGQnOiB7J2luZGV4JzogJ3Rlc3QxJywgJ2FsaWFzJzogJ2FsaWFzMSd9fVxuICAgICAgICBdLFxuICAgICAgICBfX2FueV9vZjogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFkZDoge1xuICAgICAgICAgICAgICBpbmRleDogJ3tpbmRleH0nLFxuICAgICAgICAgICAgICBhbGlhczogJycsXG4gICAgICAgICAgICAgIGZpbHRlcjoge30sXG4gICAgICAgICAgICAgIHJvdXRpbmc6ICcxJyxcbiAgICAgICAgICAgICAgc2VhcmNoX3JvdXRpbmc6ICcxLDInLFxuICAgICAgICAgICAgICBpbmRleF9yb3V0aW5nOiAnMSdcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZW1vdmU6IHtcbiAgICAgICAgICAgICAgaW5kZXg6ICcnLFxuICAgICAgICAgICAgICBhbGlhczogJydcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX2dldF9hbGlhc2VzJywge1xuICAgIG1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+ "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/aliases.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,UAAU,CACX;AACD,2BAAuB,EAAE;AACvB,eAAS,EAAE;AACT,kBAAU,EAAE,CACV,EAAC,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAC,EAAC,CAC/C;AACD,gBAAQ,EAAE,CACR;AACE,aAAG,EAAE;AACH,iBAAK,EAAE,SAAS;AAChB,iBAAK,EAAE,EAAE;AACT,kBAAM,EAAE,EAAE;AACV,mBAAO,EAAE,GAAG;AACZ,0BAAc,EAAE,KAAK;AACrB,yBAAa,EAAE,GAAG;WACnB;AACD,gBAAM,EAAE;AACN,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,EAAE;WACV;SACF,CACF;OACF;KACF;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,UAAU,CACX;GACF,CAAC,CAAC;;AAEH,MAAI,UAAU,GAAG;AACf,UAAM,EAAE,EAAE;AACV,WAAO,EAAE,GAAG;AACZ,kBAAc,EAAE,KAAK;AACrB,iBAAa,EAAE,GAAG;GACnB,CAAC;;AAEF,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,WAAO,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACxB,YAAQ,EAAE,CACR,yBAAyB,CAC1B;AACD,2BAAuB,EAAE,UAAU;GACpC,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,yBAAyB,CAC1B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,YAAY,EAAE;AACvC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,CAChB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,0BAA0B,CAAC,SAAS,EAAE;AACxC,OAAG,EAAE,UAAU;GAChB,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/aliases.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_post_aliases', {\n methods: ['POST'],\n patterns: [\n \"_aliases\",\n ],\n data_autocomplete_rules: {\n 'actions': {\n __template: [\n {'add': {'index': 'test1', 'alias': 'alias1'}}\n ],\n __any_of: [\n {\n add: {\n index: '{index}',\n alias: '',\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n },\n remove: {\n index: '',\n alias: ''\n }\n }\n ]\n }\n }\n });\n api.addEndpointDescription('_get_aliases', {\n methods: ['GET'],\n patterns: [\n \"_aliases\",\n ]\n });\n\n var aliasRules = {\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n };\n\n api.addEndpointDescription('_post_alias', {\n methods: [\"POST\", \"PUT\"],\n patterns: [\n \"{indices}/_alias/{name}\"\n ],\n data_autocomplete_rules: aliasRules\n });\n api.addEndpointDescription('_delete_alias', {\n methods: [\"DELETE\"],\n patterns: [\n \"{indices}/_alias/{name}\"\n ]\n });\n api.addEndpointDescription('_get_alias', {\n methods: [\"GET\"],\n patterns: [\n \"_alias\",\n \"{indices}/_alias\",\n \"{indices}/_alias/{name}\",\n \"_alias/{name}\"\n ]\n });\n\n api.addGlobalAutocompleteRules('aliases', {\n '*': aliasRules\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar simple_metric = {\n __template: { field: \"\" },\n field: \"{field}\",\n missing: 0,\n script: {\n // populated by a global rule\n }\n},\n field_metric = {\n __template: { field: \"\" },\n field: \"{field}\"\n},\n gap_policy = {\n __one_of: [\"skip\", \"insert_zeros\"]\n},\n simple_pipeline = {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy\n};\nvar rules = {\n \"*\": {\n \"aggs\": {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n \"min\": simple_metric,\n \"max\": simple_metric,\n \"avg\": simple_metric,\n \"sum\": simple_metric,\n \"stats\": simple_metric,\n \"extended_stats\": simple_metric,\n \"value_count\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n }\n },\n \"global\": {},\n \"filter\": {},\n \"filters\": {\n __template: {\n \"filters\": {\n \"NAME\": {}\n }\n },\n \"filters\": {\n \"*\": { __scope_link: \"GLOBAL.filter\" }\n },\n \"other_bucket\": { __one_of: [true, false] },\n \"other_bucket_key\": \"\"\n },\n \"missing\": field_metric,\n \"nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"reverse_nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"terms\": {\n __template: {\n \"field\": \"\",\n \"size\": 10\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"order\": {\n __template: {\n \"_term\": \"asc\"\n },\n \"_term\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"min_doc_count\": 10,\n \"script\": {\n // populated by a global rule\n },\n \"include\": \".*\",\n \"exclude\": \".*\",\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\", \"global_ordinals_low_cardinality\"] },\n \"show_term_doc_count_error\": { __one_of: [true, false] },\n \"collect_mode\": { __one_of: [\"depth_first\", \"breadth_first\"] },\n \"missing\": \"\"\n },\n \"significant_terms\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"shard_min_doc_count\": 10,\n \"min_doc_count\": 10,\n \"include\": { __one_of: [\"*\", { pattern: \"\", flags: \"\" }] },\n \"exclude\": { __one_of: [\"*\", { pattern: \"\", flags: \"\" }] },\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\"] },\n \"background_filter\": {\n __scope_link: \"GLOBAL.filter\"\n },\n \"mutual_information\": {\n \"include_negatives\": { __one_of: [true, false] }\n },\n \"chi_square\": {\n \"include_negatives\": { __one_of: [true, false] },\n \"background_is_superset\": { __one_of: [true, false] }\n },\n \"percentage\": {},\n \"gnd\": {\n \"background_is_superset\": { __one_of: [true, false] }\n },\n \"script_heuristic\": {\n __template: {\n \"script\": \"_subset_freq/(_superset_freq - _subset_freq + 1)\"\n },\n \"script\": {\n // populated by a global rule\n }\n }\n },\n \"range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": 50, \"to\": 100 }]\n },\n \"field\": \"{field}\",\n \"ranges\": [{ \"to\": 50, \"from\": 100, \"key\": \"\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": {\n // populated by a global rule\n }\n },\n \"date_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": \"now-10d/d\", \"to\": \"now\" }]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [{ \"to\": \"\", \"from\": \"\", \"key\": \"\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": {\n // populated by a global rule\n }\n },\n \"ip_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": \"10.0.0.5\", \"to\": \"10.0.0.10\" }]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [{ \"to\": \"\", \"from\": \"\", \"key\": \"\", \"mask\": \"10.0.0.127/25\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": {\n // populated by a global rule\n }\n },\n \"histogram\": {\n __template: {\n \"field\": \"price\",\n \"interval\": 50\n },\n \"field\": \"{field}\",\n \"interval\": 50,\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"keyed\": { __one_of: [true, false] },\n \"missing\": 0\n },\n \"date_histogram\": {\n __template: {\n \"field\": \"date\",\n \"interval\": \"month\"\n },\n \"field\": \"{field}\",\n \"interval\": { __one_of: [\"year\", \"quarter\", \"week\", \"day\", \"hour\", \"minute\", \"second\"] },\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"keyed\": { __one_of: [true, false] },\n \"pre_zone\": \"-01:00\",\n \"post_zone\": \"-01:00\",\n \"pre_zone_adjust_large_interval\": { __one_of: [true, false] },\n \"factor\": 1000,\n \"pre_offset\": \"1d\",\n \"post_offset\": \"1d\",\n \"format\": \"yyyy-MM-dd\",\n \"time_zone\": \"00:00\",\n \"missing\": \"\"\n },\n \"geo_distance\": {\n __template: {\n \"field\": \"location\",\n \"origin\": { \"lat\": 52.3760, \"lon\": 4.894 },\n \"ranges\": [{ \"from\": 100, \"to\": 300 }]\n },\n \"field\": \"{field}\",\n \"origin\": { \"lat\": 0.0, \"lon\": 0.0 },\n \"unit\": { __one_of: [\"mi\", \"km\", \"in\", \"yd\", \"m\", \"cm\", \"mm\"] },\n \"ranges\": [{ \"from\": 50, \"to\": 100 }],\n \"distance_type\": { __one_of: [\"arc\", \"sloppy_arc\", \"plane\"] }\n\n },\n \"geohash_grid\": {\n __template: {\n \"field\": \"\",\n \"precision\": 3\n },\n \"field\": \"{field}\",\n \"precision\": { __one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },\n \"size\": 10,\n \"shard_size\": 10\n },\n \"percentiles\": {\n __template: {\n \"field\": \"\",\n \"percents\": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]\n },\n \"field\": \"{field}\",\n \"percents\": {\n __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],\n // mark type as list\n __any_of: []\n },\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": { __one_of: [\"hdr\", \"tdigest\"] },\n missing: 0\n },\n \"cardinality\": {\n __template: {\n \"field\": \"\"\n },\n \"precision_threshold\": 100,\n \"rehash\": true,\n \"script\": {\n // populated by a global rule\n },\n missing: \"\"\n },\n \"scripted_metric\": {\n __template: {\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\"\n },\n \"init_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"map_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"combine_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"reduce_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"lang\": \"groovy\",\n \"params\": {},\n \"reduce_params\": {}\n },\n \"geo_bounds\": {\n __template: {\n field: \"\"\n },\n field: \"{field}\",\n wrap_longitude: { __one_of: [true, false] }\n },\n \"top_hits\": {\n __template: {\n size: 10\n },\n from: 0,\n size: 10,\n sort: {\n __template: [],\n __scope_link: \"_search.sort\"\n },\n highlight: {},\n explain: { __one_of: [true, false] },\n _source: {\n __template: \"\",\n __scope_link: \"_search._source\"\n },\n script_fields: {\n __scope_link: \"_search.script_fields\"\n },\n fielddata_fields: [\"{field}\"],\n version: { __one_of: [true, false] }\n },\n \"percentile_ranks\": {\n __template: {\n field: \"\",\n values: [10, 15]\n },\n field: \"{field}\",\n values: [],\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": { __one_of: [\"hdr\", \"tdigest\"] },\n missing: 0\n },\n \"sampler\": {\n __template: {},\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n },\n \"shard_size\": 100,\n \"max_docs_per_value\": 3,\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"bytes_hash\"] }\n },\n \"children\": {\n __template: {\n \"type\": \"\"\n },\n \"type\": \"\"\n },\n \"derivative\": simple_pipeline,\n \"avg_bucket\": simple_pipeline,\n \"max_bucket\": simple_pipeline,\n \"min_bucket\": simple_pipeline,\n \"sum_bucket\": simple_pipeline,\n \"moving_avg\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n \"window\": 5,\n model: { __one_of: [\"simple\", \"linear\", \"ewma\", \"holt\", \"holt_winters\"] },\n settings: {\n type: { __one_of: [\"add\", \"mult\"] },\n alpha: 0.5,\n beta: 0.5,\n gamma: 0.5,\n period: 7\n }\n },\n \"cumulative_sum\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\"\n },\n \"serial_diff\": {\n __template: {\n buckets_path: \"\",\n lag: 7\n },\n lag: 7,\n gap_policy: gap_policy,\n buckets_path: \"\",\n format: \"\"\n },\n \"bucket_script\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n },\n \"bucket_selector\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n }\n }\n};\nmodule.exports = function (api) {\n\n api.addGlobalAutocompleteRules('aggregations', rules);\n api.addGlobalAutocompleteRules('aggs', rules);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2FnZ3JlZ2F0aW9ucy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksYUFBYSxHQUFHO0FBQ2xCLFlBQVUsRUFBRSxFQUFDLEtBQUssRUFBRSxFQUFFLEVBQUM7QUFDdkIsT0FBSyxFQUFFLFNBQVM7QUFDaEIsU0FBTyxFQUFFLENBQUM7QUFDVixRQUFNLEVBQUU7O0dBRVA7Q0FDRjtJQUFFLFlBQVksR0FBRztBQUNoQixZQUFVLEVBQUUsRUFBQyxLQUFLLEVBQUUsRUFBRSxFQUFDO0FBQ3ZCLE9BQUssRUFBRSxTQUFTO0NBQ2pCO0lBQUUsVUFBVSxHQUFHO0FBQ2QsVUFBUSxFQUFFLENBQUMsTUFBTSxFQUFFLGNBQWMsQ0FBQztDQUNuQztJQUFFLGVBQWUsR0FBRztBQUNuQixZQUFVLEVBQUU7QUFDVixnQkFBWSxFQUFFLEVBQUU7R0FDakI7QUFDRCxjQUFZLEVBQUUsRUFBRTtB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lZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9XG4gICAgfSxcbiAgICBcImlwX3JhbmdlXCI6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgXCJmaWVsZFwiOiBcIlwiLFxuICAgICAgICBcInJhbmdlc1wiOiBbXG4gICAgICAgICAge1wiZnJvbVwiOiBcIjEwLjAuMC41XCIsIFwidG9cIjogXCIxMC4wLjAuMTBcIn0sXG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBcImZpZWxkXCI6IFwie2ZpZWxkfVwiLFxuICAgICAgXCJmb3JtYXRcIjogXCJNTS15eXlcIixcbiAgICAgIFwicmFuZ2VzXCI6IFtcbiAgICAgICAge1widG9cIjogXCJcIiwgXCJmcm9tXCI6IFwiXCIsIFwia2V5XCI6IFwiXCIsIFwibWFza1wiOiBcIjEwLjAuMC4xMjcvMjVcIn1cbiAgICAgIF0sXG4gICAgICBcImtleWVkXCI6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX0sXG4gICAgICBcInNjcmlwdFwiOiB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9XG4gICAgfSxcbiAgICBcImhpc3RvZ3JhbVwiOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIFwiZmllbGRcIjogXCJwcmljZVwiLFxuICAgICAgICBcImludGVydmFsXCI6IDUwXG4gICAgICB9LFxuICAgICAgXCJmaWVsZFwiOiBcIntmaWVsZH1cIixcbiAgICAgIFwiaW50ZXJ2YWxcIjogNTAsXG4gICAgICBcIm1pbl9kb2NfY291bnRcIjogMCxcbiAgICAgIFwib3JkZXJcIjoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgXCJfa2V5XCI6IFwiYXNjXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJfa2V5XCI6IHtfX29uZV9vZjogW1wiYXNjXCIsIFwiZGVzY1wiXX0sXG4gICAgICA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b25naXR1ZGU6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX1cbiAgICB9LFxuICAgIFwidG9wX2hpdHNcIjoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBzaXplOiAxMFxuICAgICAgfSxcbiAgICAgIGZyb206IDAsXG4gICAgICBzaXplOiAxMCxcbiAgICAgIHNvcnQ6IHtcbiAgICAgICAgX190ZW1wbGF0ZTogW10sXG4gICAgICAgIF9fc2NvcGVfbGluazogXCJfc2VhcmNoLnNvcnRcIlxuICAgICAgfSxcbiAgICAgIGhpZ2hsaWdodDoge30sXG4gICAgICBleHBsYWluOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgX3NvdXJjZToge1xuICAgICAgICBfX3RlbXBsYXRlOiBcIlwiLFxuICAgICAgICBfX3Njb3BlX2xpbms6IFwiX3NlYXJjaC5fc291cmNlXCJcbiAgICAgIH0sXG4gICAgICBzY3JpcHRfZmllbGRzOiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogXCJfc2VhcmNoLnNjcmlwdF9maWVsZHNcIlxuICAgICAgfSxcbiAgICAgIGZpZWxkZGF0YV9maWVsZHM6IFtcIntmaWVsZH1cIl0sXG4gICAgICB2ZXJzaW9uOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19XG4gICAgfSxcbiAgICBcInBlcmNlbnRpbGVfcmFua3NcIjoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBmaWVsZDogXCJcIixcbiAgICAgICAgdmFsdWVzOiBbMTAsIDE1XVxuICAgICAgfSxcbiAgICAgIGZpZWxkOiBcIntmaWVsZH1cIixcbiAgICAgIHZhbHVlczogW10sXG4gICAgICBcInNjcmlwdFwiOiB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9LFxuICAgICAgXCJjb21wcmVzc2lvblwiOiAxMDAsXG4gICAgICBcIm1ldGhvZFwiOiB7X19vbmVfb2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wgcnVsZVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJidWNrZXRfc2VsZWN0b3JcIjoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBidWNrZXRzX3BhdGg6IFwiXCIsXG4gICAgICAgIHNjcmlwdDoge31cbiAgICAgIH0sXG4gICAgICBidWNrZXRzX3BhdGg6IFwiXCIsXG4gICAgICBnYXBfcG9saWN5OiBnYXBfcG9saWN5LFxuICAgICAgc2NyaXB0OiB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9XG4gICAgfVxuICB9XG59O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoYXBpKSB7XG5cbiAgYXBpLmFkZEdsb2JhbEF1dG9jb21wbGV0ZVJ1bGVzKCdhZ2dyZWdhdGlvbnMnLCBydWxlcyk7XG4gIGFwaS5hZGRHbG9iYWxBdXRvY29tcGxldGVSdWxlcygnYWdncycsIHJ1bGVzKTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,aAAa,GAAG;AAClB,YAAU,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;AACvB,OAAK,EAAE,SAAS;AAChB,SAAO,EAAE,CAAC;AACV,QAAM,EAAE;;GAEP;CACF;IAAE,YAAY,GAAG;AAChB,YAAU,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;AACvB,OAAK,EAAE,SAAS;CACjB;IAAE,UAAU,GAAG;AACd,UAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;CACnC;IAAE,eAAe,GAAG;AACnB,YAAU,EAAE;AACV,gBAAY,EAAE,EAAE;GACjB;AACD,cAAY,EAAE,EAAE;AAChB,QAAM,EAAE,EAAE;AACV,YAAU,EAAE,UAAU;CACvB,CAAC;AACF,IAAI,KAAK,GAAG;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D,mBAAe,EAAE;AACf,gBAAU,EAAE;AACV,oBAAY,EAAE,EAAE;AAChB,cAAM,EAAE,EAAE;OACX;AACD,kBAAY,EAAE,EAAE;AAChB,YAAM,EAAE,EAAE;AACV,gBAAU,EAAE,UAAU;AACtB,YAAM,EAAE;;OAEP;KACF;AACD,qBAAiB,EAAE;AACjB,gBAAU,EAAE;AACV,oBAAY,EAAE,EAAE;AAChB,cAAM,EAAE,EAAE;OACX;AACD,kBAAY,EAAE,EAAE;AAChB,gBAAU,EAAE,UAAU;AACtB,YAAM,EAAE;;OAEP;KACF;GACF;CACF,CAAC;AACF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;;AAE9B,KAAG,CAAC,0BAA0B,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;AACtD,KAAG,CAAC,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC/C,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/aggregations.js", + "sourcesContent": [ + "var simple_metric = {\n __template: {field: \"\"},\n field: \"{field}\",\n missing: 0,\n script: {\n // populated by a global rule\n }\n}, field_metric = {\n __template: {field: \"\"},\n field: \"{field}\"\n}, gap_policy = {\n __one_of: [\"skip\", \"insert_zeros\"]\n}, simple_pipeline = {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy\n};\nvar rules = {\n \"*\": {\n \"aggs\": {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n \"min\": simple_metric,\n \"max\": simple_metric,\n \"avg\": simple_metric,\n \"sum\": simple_metric,\n \"stats\": simple_metric,\n \"extended_stats\": simple_metric,\n \"value_count\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n }\n },\n \"global\": {},\n \"filter\": {},\n \"filters\": {\n __template: {\n \"filters\": {\n \"NAME\": {}\n }\n },\n \"filters\": {\n \"*\": {__scope_link: \"GLOBAL.filter\"}\n },\n \"other_bucket\": {__one_of: [true, false]},\n \"other_bucket_key\": \"\"\n },\n \"missing\": field_metric,\n \"nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"reverse_nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"terms\": {\n __template: {\n \"field\": \"\",\n \"size\": 10\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"order\": {\n __template: {\n \"_term\": \"asc\"\n },\n \"_term\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"min_doc_count\": 10,\n \"script\": {\n // populated by a global rule\n },\n \"include\": \".*\",\n \"exclude\": \".*\",\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\", \"global_ordinals_low_cardinality\"]},\n \"show_term_doc_count_error\": {__one_of: [true, false]},\n \"collect_mode\": {__one_of: [\"depth_first\", \"breadth_first\"]},\n \"missing\": \"\"\n },\n \"significant_terms\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"shard_min_doc_count\": 10,\n \"min_doc_count\": 10,\n \"include\": {__one_of: [\"*\", {pattern: \"\", flags: \"\"}]},\n \"exclude\": {__one_of: [\"*\", {pattern: \"\", flags: \"\"}]},\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\"]},\n \"background_filter\": {\n __scope_link: \"GLOBAL.filter\"\n },\n \"mutual_information\": {\n \"include_negatives\": {__one_of: [true, false]}\n },\n \"chi_square\": {\n \"include_negatives\": {__one_of: [true, false]},\n \"background_is_superset\": {__one_of: [true, false]}\n },\n \"percentage\": {},\n \"gnd\": {\n \"background_is_superset\": {__one_of: [true, false]}\n },\n \"script_heuristic\": {\n __template: {\n \"script\": \"_subset_freq/(_superset_freq - _subset_freq + 1)\"\n },\n \"script\": {\n // populated by a global rule\n }\n }\n },\n \"range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": 50, \"to\": 100},\n ]\n },\n \"field\": \"{field}\",\n \"ranges\": [\n {\"to\": 50, \"from\": 100, \"key\": \"\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": {\n // populated by a global rule\n }\n },\n \"date_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": \"now-10d/d\", \"to\": \"now\"},\n ]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [\n {\"to\": \"\", \"from\": \"\", \"key\": \"\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": {\n // populated by a global rule\n }\n },\n \"ip_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": \"10.0.0.5\", \"to\": \"10.0.0.10\"},\n ]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [\n {\"to\": \"\", \"from\": \"\", \"key\": \"\", \"mask\": \"10.0.0.127/25\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": {\n // populated by a global rule\n }\n },\n \"histogram\": {\n __template: {\n \"field\": \"price\",\n \"interval\": 50\n },\n \"field\": \"{field}\",\n \"interval\": 50,\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"keyed\": {__one_of: [true, false]},\n \"missing\": 0\n },\n \"date_histogram\": {\n __template: {\n \"field\": \"date\",\n \"interval\": \"month\"\n },\n \"field\": \"{field}\",\n \"interval\": {__one_of: [\"year\", \"quarter\", \"week\", \"day\", \"hour\", \"minute\", \"second\"]},\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"keyed\": {__one_of: [true, false]},\n \"pre_zone\": \"-01:00\",\n \"post_zone\": \"-01:00\",\n \"pre_zone_adjust_large_interval\": {__one_of: [true, false]},\n \"factor\": 1000,\n \"pre_offset\": \"1d\",\n \"post_offset\": \"1d\",\n \"format\": \"yyyy-MM-dd\",\n \"time_zone\": \"00:00\",\n \"missing\": \"\"\n },\n \"geo_distance\": {\n __template: {\n \"field\": \"location\",\n \"origin\": {\"lat\": 52.3760, \"lon\": 4.894},\n \"ranges\": [\n {\"from\": 100, \"to\": 300},\n ]\n },\n \"field\": \"{field}\",\n \"origin\": {\"lat\": 0.0, \"lon\": 0.0},\n \"unit\": {__one_of: [\"mi\", \"km\", \"in\", \"yd\", \"m\", \"cm\", \"mm\"]},\n \"ranges\": [\n {\"from\": 50, \"to\": 100}\n ],\n \"distance_type\": {__one_of: [\"arc\", \"sloppy_arc\", \"plane\"]}\n\n },\n \"geohash_grid\": {\n __template: {\n \"field\": \"\",\n \"precision\": 3\n },\n \"field\": \"{field}\",\n \"precision\": {__one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},\n \"size\": 10,\n \"shard_size\": 10\n },\n \"percentiles\": {\n __template: {\n \"field\": \"\",\n \"percents\": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]\n },\n \"field\": \"{field}\",\n \"percents\": {\n __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],\n // mark type as list\n __any_of: []\n },\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": {__one_of: [\"hdr\", \"tdigest\"]},\n missing: 0\n },\n \"cardinality\": {\n __template: {\n \"field\": \"\"\n },\n \"precision_threshold\": 100,\n \"rehash\": true,\n \"script\": {\n // populated by a global rule\n },\n missing: \"\"\n },\n \"scripted_metric\": {\n __template: {\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\"\n },\n \"init_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"map_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"combine_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"reduce_script\": {\n __scope_link: \"GLOBAL.script\"\n },\n \"lang\": \"groovy\",\n \"params\": {},\n \"reduce_params\": {}\n },\n \"geo_bounds\": {\n __template: {\n field: \"\"\n },\n field: \"{field}\",\n wrap_longitude: {__one_of: [true, false]}\n },\n \"top_hits\": {\n __template: {\n size: 10\n },\n from: 0,\n size: 10,\n sort: {\n __template: [],\n __scope_link: \"_search.sort\"\n },\n highlight: {},\n explain: {__one_of: [true, false]},\n _source: {\n __template: \"\",\n __scope_link: \"_search._source\"\n },\n script_fields: {\n __scope_link: \"_search.script_fields\"\n },\n fielddata_fields: [\"{field}\"],\n version: {__one_of: [true, false]}\n },\n \"percentile_ranks\": {\n __template: {\n field: \"\",\n values: [10, 15]\n },\n field: \"{field}\",\n values: [],\n \"script\": {\n // populated by a global rule\n },\n \"compression\": 100,\n \"method\": {__one_of: [\"hdr\", \"tdigest\"]},\n missing: 0\n },\n \"sampler\": {\n __template: {},\n \"field\": \"{field}\",\n \"script\": {\n // populated by a global rule\n },\n \"shard_size\": 100,\n \"max_docs_per_value\": 3,\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"bytes_hash\"]}\n },\n \"children\": {\n __template: {\n \"type\": \"\",\n },\n \"type\": \"\"\n },\n \"derivative\": simple_pipeline,\n \"avg_bucket\": simple_pipeline,\n \"max_bucket\": simple_pipeline,\n \"min_bucket\": simple_pipeline,\n \"sum_bucket\": simple_pipeline,\n \"moving_avg\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n \"window\": 5,\n model: {__one_of: [\"simple\", \"linear\", \"ewma\", \"holt\", \"holt_winters\"]},\n settings: {\n type: {__one_of: [\"add\", \"mult\"]},\n alpha: 0.5,\n beta: 0.5,\n gamma: 0.5,\n period: 7\n }\n },\n \"cumulative_sum\": {\n __template: {\n buckets_path: \"\"\n },\n buckets_path: \"\",\n format: \"\"\n },\n \"serial_diff\": {\n __template: {\n buckets_path: \"\",\n lag: 7\n },\n lag: 7,\n gap_policy: gap_policy,\n buckets_path: \"\",\n format: \"\"\n },\n \"bucket_script\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n format: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n },\n \"bucket_selector\": {\n __template: {\n buckets_path: \"\",\n script: {}\n },\n buckets_path: \"\",\n gap_policy: gap_policy,\n script: {\n // populated by a global rule\n }\n }\n }\n};\nmodule.exports = function (api) {\n\n api.addGlobalAutocompleteRules('aggregations', rules);\n api.addGlobalAutocompleteRules('aggs', rules);\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/cat.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\nfunction addSimpleCat(endpoint, api, params, patterns) {\n var url_params = { \"help\": \"__flag__\", \"v\": \"__flag__\", \"bytes\": [\"b\"] };\n _.each(params || [], function (p) {\n if (_.isString(p)) {\n url_params[p] = \"__flag__\";\n } else {\n var k = Object.keys(p)[0];\n url_params[k] = p[k];\n }\n });\n api.addEndpointDescription(endpoint, {\n match: endpoint,\n url_params: url_params,\n patterns: patterns || [endpoint]\n });\n}\n\nfunction addNodeattrsCat(api) {\n api.addEndpointDescription('_cat/nodeattrs', {\n methods: ['GET'],\n patterns: [\"_cat/nodeattrs\"],\n url_params: {\n help: \"__flag__\",\n v: \"__flag__\",\n h: [\"node\", \"name\", \"id\", \"nodeId\", \"pid\", \"p\", \"host\", \"h\", \"ip\", \"i\", \"port\", \"po\", \"attr\", \"attr.name\", \"value\", \"attr.value\"]\n }\n });\n}\n\nmodule.exports = function (api) {\n addSimpleCat('_cat/aliases', api);\n addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);\n addSimpleCat('_cat/count', api);\n addSimpleCat('_cat/health', api, [{ \"ts\": [\"false\", \"true\"] }]);\n addSimpleCat('_cat/indices', api, [{ h: [] }, \"pri\"], ['_cat/indices', '_cat/indices/{indices}']);\n addSimpleCat('_cat/master', api);\n addSimpleCat('_cat/nodes', api);\n addSimpleCat('_cat/pending_tasks', api);\n addSimpleCat('_cat/recovery', api);\n addSimpleCat('_cat/thread_pool', api);\n addSimpleCat('_cat/shards', api);\n addSimpleCat('_cat/plugins', api);\n addSimpleCat('_cat/segments', api);\n addNodeattrsCat(api);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2NhdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQzs7QUFFMUIsU0FBUy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RpY2VzJywgYXBpLCBbXG4gICAgICB7aDogW119LFxuICAgICAgXCJwcmlcIixcbiAgICBdLFxuICAgIFsnX2NhdC9pbmRpY2VzJywgJ19jYXQvaW5kaWNlcy97aW5kaWNlc30nXSk7XG4gIGFkZFNpbXBsZUNhdCgnX2NhdC9tYXN0ZXInLCBhcGkpO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvbm9kZXMnLCBhcGkpO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvcGVuZGluZ190YXNrcycsIGFwaSk7XG4gIGFkZFNpbXBsZUNhdCgnX2NhdC9yZWNvdmVyeScsIGFwaSk7XG4gIGFkZFNpbXBsZUNhdCgnX2NhdC90aHJlYWRfcG9vbCcsIGFwaSk7XG4gIGFkZFNpbXBsZUNhdCgnX2NhdC9zaGFyZHMnLCBhcGkpO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvcGx1Z2lucycsIGFwaSk7XG4gIGFkZFNpbXBsZUNhdCgnX2NhdC9zZWdtZW50cycsIGFwaSk7XG4gIGFkZE5vZGVhdHRyc0NhdChhcGkpO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/cat.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,SAAS,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE;AACrD,MAAI,UAAU,GAAG,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAC,CAAC;AACvE,GAAC,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,UAAU,CAAC,EAAE;AAChC,QAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;AACjB,gBAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;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EAAE,CAC9B,EAAC,CAAC,EAAE,EAAE,EAAC,EACP,KAAK,CACN,EACD,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC,CAAC;AAC9C,cAAY,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AACjC,cAAY,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAChC,cAAY,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;AACxC,cAAY,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AACnC,cAAY,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AACtC,cAAY,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AACjC,cAAY,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;AAClC,cAAY,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AACnC,iBAAe,CAAC,GAAG,CAAC,CAAC;CACtB,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/cat.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nfunction addSimpleCat(endpoint, api, params, patterns) {\n var url_params = {\"help\": \"__flag__\", \"v\": \"__flag__\", \"bytes\": [\"b\"]};\n _.each(params || [], function (p) {\n if (_.isString(p)) {\n url_params[p] = \"__flag__\";\n }\n else {\n var k = Object.keys(p)[0];\n url_params[k] = p[k];\n }\n });\n api.addEndpointDescription(endpoint, {\n match: endpoint,\n url_params: url_params,\n patterns: patterns || [endpoint]\n });\n}\n\nfunction addNodeattrsCat(api) {\n api.addEndpointDescription('_cat/nodeattrs', {\n methods: ['GET'],\n patterns: [\n \"_cat/nodeattrs\"\n ],\n url_params: {\n help: \"__flag__\",\n v: \"__flag__\",\n h: [\"node\", \"name\", \"id\", \"nodeId\", \"pid\", \"p\", \"host\", \"h\", \"ip\", \"i\", \"port\", \"po\", \"attr\", \"attr.name\", \"value\", \"attr.value\"]\n }\n });\n}\n\nmodule.exports = function (api) {\n addSimpleCat('_cat/aliases', api);\n addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);\n addSimpleCat('_cat/count', api);\n addSimpleCat('_cat/health', api, [\n {\"ts\": [\"false\", \"true\"]}\n ]);\n addSimpleCat('_cat/indices', api, [\n {h: []},\n \"pri\",\n ],\n ['_cat/indices', '_cat/indices/{indices}']);\n addSimpleCat('_cat/master', api);\n addSimpleCat('_cat/nodes', api);\n addSimpleCat('_cat/pending_tasks', api);\n addSimpleCat('_cat/recovery', api);\n addSimpleCat('_cat/thread_pool', api);\n addSimpleCat('_cat/shards', api);\n addSimpleCat('_cat/plugins', api);\n addSimpleCat('_cat/segments', api);\n addNodeattrsCat(api);\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/cluster.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_cluster/nodes/stats');\n api.addEndpointDescription('_cluster/state', {\n patterns: [\"_cluster/state\", \"_cluster/state/{metrics}\", \"_cluster/state/{metrics}/{indices}\"],\n url_components: {\n \"metrics\": [\"version\", \"master_node\", \"nodes\", \"routing_table\", \"routing_node\", \"metadata\", \"blocks\"]\n }\n });\n api.addEndpointDescription('_cluster/health', {\n url_params: {\n \"local\": \"__flag__\",\n \"level\": [\"indices\", \"shards\"],\n \"master_timeout\": \"30s\",\n \"timeout\": \"30s\",\n \"wait_for_status\": [\"yellow\", \"green\"],\n \"wait_for_relocating_shards\": 0,\n \"wait_for_active_shards\": 0,\n \"wait_for_nodes\": 0\n }\n });\n api.addEndpointDescription('_cluster/pending_tasks');\n api.addEndpointDescription('get_cluster/settings', {\n patterns: ['_cluster/settings']\n });\n\n api.addEndpointDescription('put_cluster/settings', {\n methods: ['PUT'],\n patterns: ['_cluster/settings'],\n data_autocomplete_rules: {\n persistent: {\n cluster: {\n routing: {\n 'allocation.enable': { __one_of: [\"all\", \"primaries\", \"new_primaries\", \"none\"] },\n 'allocation.disk.threshold_enabled': { __one_of: [false, true] },\n 'allocation.disk.watermark.low': '85%',\n 'allocation.disk.watermark.high': '90%',\n 'allocation.disk.include_relocations': { __one_of: [true, false] },\n 'allocation.disk.reroute_interval': '60s',\n 'allocation.exclude': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.include': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.require': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.awareness.attributes': [],\n 'allocation.awareness.force': {\n '*': {\n 'values': []\n }\n },\n 'allocation.allow_rebalance': { __one_of: ['always', 'indices_primaries_active', 'indices_all_active'] },\n 'allocation.cluster_concurrent_rebalance': 2,\n 'allocation.node_initial_primaries_recoveries': 4,\n 'allocation.node_concurrent_recoveries': 2,\n 'allocation.same_shard.host': { __one_of: [false, true] }\n }\n },\n indices: {\n breaker: {\n \"total.limit\": \"70%\",\n \"fielddata.limit\": \"60%\",\n \"fielddata.overhead\": 1.03,\n \"request.limit\": \"40%\",\n \"request.overhead\": 1.0\n }\n }\n },\n transient: {\n __scope_link: '.persistent'\n }\n }\n });\n\n api.addEndpointDescription('_cluster/reroute', {\n methods: ['POST'],\n url_params: {\n explain: \"__flag__\",\n dry_run: \"__flag__\"\n },\n data_autocomplete_rules: {\n commands: [{\n move: {\n __template: {\n index: \"\",\n shard: 0,\n from_node: \"\",\n to_node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n from_node: \"{node}\",\n to_node: \"{node}\"\n },\n cancel: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: { __one_of: [true, false] }\n },\n allocate: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: { __one_of: [true, false] }\n }\n }],\n dry_run: { __one_of: [true, false] }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2NsdXN0ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ25ELEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxnQkFBZ0IsRUFBRTtBQUMzQyxZQUFRLEVBQUUsQ0FDUixnQkFBZ0IsRUFDaEIsMEJBQTBCLEVBQzFCLG9DQUFvQyxDQUNyQztBQUNELGtCQUFjLEVBQUU7QUFDZCxlQUFTLEVBQUUsQ0FBQyxTQUFTLEVBQUUsYUFBYSxFQUFFLE9BQU8sRUFBRSxlQUFlLEVBQUUsY0FBYyxFQUFFLFVBQVUsRUFBRSxRQUFRLENBQUM7S0FDdEc7R0FDRixDQUFDLENBQUM7QUFDSCxLQUFHLENBQUMsc0JB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3RlbnQ6IHtcbiAgICAgICAgY2x1c3Rlcjoge1xuICAgICAgICAgIHJvdXRpbmc6IHtcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmVuYWJsZSc6IHtfX29uZV9vZjogW1wiYWxsXCIsIFwicHJpbWFyaWVzXCIsIFwibmV3X3ByaW1hcmllc1wiLCBcIm5vbmVcIl19LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uZGlzay50aHJlc2hvbGRfZW5hYmxlZCc6IHtfX29uZV9vZjogW2ZhbHNlLCB0cnVlXX0sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5kaXNrLndhdGVybWFyay5sb3cnOiAnODUlJyxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmRpc2sud2F0ZXJtYXJrLmhpZ2gnOiAnOTAlJyxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmRpc2suaW5jbHVkZV9yZWxvY2F0aW9ucyc6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX0sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5kaXNrLnJlcm91dGVfaW50ZXJ2YWwnOiAnNjBzJyxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmV4Y2x1ZGUnOiB7XG4gICAgICAgICAgICAgICdfaXAnOiBcIlwiLFxuICAgICAgICAgICAgICAnX25hbWUnOiBcIlwiLFxuICAgICAgICAgICAgICAnX2hvc3QnOiBcIlwiLFxuICAgICAgICAgICAgICAnX2lkJzogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmluY2x1ZGUnOiB7XG4gICAgICAgICAgICAgICdfaXAnOiBcIlwiLFxuICAgICAgICAgICAgICAnX25hbWUnOiBcIlwiLFxuICAgICAgICAgICAgICAnX2hvc3QnOiBcIlwiLFxuICAgICAgICAgICAgICAnX2lkJzogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLnJlcXVpcmUnOiB7XG4gICAgICAgICAgICAgICdfaXAnOiBcIlwiLFxuICAgICAgICAgICAgICAnX25hbWUnOiBcIlwiLFxuICAgICAgICAgICAgICAnX2hvc3QnOiBcIlwiLFxuICAgICAgICAgICAgICAnX2lkJzogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmF3YXJlbmVzcy5hdHRyaWJ1dGVzJzogW10sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5hd2FyZW5lc3MuZm9yY2UnOiB7XG4gICAgICAgICAgICAgICcqJzoge1xuICAgICAgICAgICAgICAgICd2YWx1ZXMnOiBbXVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uYWxsb3dfcmViYWxhbmNlJzoge19fb25lX29mOiBbJ2Fsd2F5cycsICdpbmRpY2VzX3ByaW1hcmllc19hY3RpdmUnLCAnaW5kaWNlc19hbGxfYWN0aXZlJ119LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uY2x1c3Rlcl9jb25jdXJyZW50X3JlYmFsYW5jZSc6IDIsXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5ub2RlX2luaXRpYWxfcHJpbWFyaWVzX3JlY292ZXJpZXMnOiA0LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24ubm9kZV9jb25jdXJyZW50X3JlY292ZXJpZXMnOiAyLFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uc2FtZV9zaGFyZC5ob3N0Jzoge19fb25lX29mOiBbZmFsc2UsIHRydWVdfVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgaW5kaWNlczoge1xuICAgICAgICAgIGJyZWFrZXI6IHtcbiAgICAgICAgICAgIFwidG90YWwubGltaXRcIjogXCI3MCVcIixcbiAgICAgICAgICAgIFwiZmllbGRkYXRhLmxpbWl0XCI6IFwiNjAlXCIsXG4gICAgICAgICAgICBcImZpZWxkZGF0YS5vdmVyaGVhZFwiOiAxLjAzLFxuICAgICAgICAgICAgXCJyZXF1ZXN0LmxpbWl0XCI6IFwiNDAlXCIsXG4gICAgICAgICAgICBcInJlcXVlc3Qub3ZlcmhlYWRcIjogMS4wXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgdHJhbnNpZW50OiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogJy5wZXJzaXN0ZW50J1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG5cbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19jbHVzdGVyL3Jlcm91dGUnLCB7XG4gICAgbWV0aG9kczogWydQT1NUJ10sXG4gICAgdXJsX3BhcmFtczoge1xuICAgICAgZXhwbGFpbjogXCJfX2ZsYWdfX1wiLFxuICAgICAgZHJ5X3J1bjogXCJfX2ZsYWdfX1wiXG4gICAgfSxcbiAgICBkYXRhX2F1dG9jb21wbGV0ZV9ydWxlczoge1xuICAgICAgY29tbWFuZHM6IFtcbiAgICAgICAge1xuICAgICAgICAgIG1vdmU6IHtcbiAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgaW5kZXg6IFwiXCIsXG4gICAgICAgICAgICAgIHNoYXJkOiAwLFxuICAgICAgICAgICAgICBmcm9tX25vZGU6IFwiXCIsXG4gICAgICAgICAgICAgIHRvX25vZGU6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbmRleDogXCJ7aW5kZXh9XCIsXG4gICAgICAgICAgICBzaGFyZDogMCxcbiAgICAgICAgICAgIGZyb21fbm9kZTogXCJ7bm9kZX1cIixcbiAgICAgICAgICAgIHRvX25vZGU6IFwie25vZGV9XCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNhbmNlbDoge1xuICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICBpbmRleDogXCJcIixcbiAgICAgICAgICAgICAgc2hhcmQ6IDAsXG4gICAgICAgICAgICAgIG5vZGU6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbmRleDogXCJ7aW5kZXh9XCIsXG4gICAgICAgICAgICBzaGFyZDogMCxcbiAgICAgICAgICAgIG5vZGU6IFwie25vZGV9XCIsXG4gICAgICAgICAgICBhbGxvd19wcmltYXJ5OiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19XG4gICAgICAgICAgfSxcbiAgICAgICAgICBhbGxvY2F0ZToge1xuICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICBpbmRleDogXCJcIixcbiAgICAgICAgICAgICAgc2hhcmQ6IDAsXG4gICAgICAgICAgICAgIG5vZGU6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbmRleDogXCJ7aW5kZXh9XCIsXG4gICAgICAgICAgICBzaGFyZDogMCxcbiAgICAgICAgICAgIG5vZGU6IFwie25vZGV9XCIsXG4gICAgICAgICAgICBhbGxvd19wcmltYXJ5OiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICBdLFxuICAgICAgZHJ5X3J1bjoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/cluster.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,CAAC;AACnD,KAAG,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;AAC3C,YAAQ,EAAE,CACR,gBAAgB,EAChB,0BAA0B,EAC1B,oCAAoC,CACrC;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAA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AO,EAAE,QAAQ;SAClB;AACD,cAAM,EAAE;AACN,oBAAU,EAAE;AACV,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,CAAC;AACR,gBAAI,EAAE,EAAE;WACT;AACD,eAAK,EAAE,SAAS;AAChB,eAAK,EAAE,CAAC;AACR,cAAI,EAAE,QAAQ;AACd,uBAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;SACzC;AACD,gBAAQ,EAAE;AACR,oBAAU,EAAE;AACV,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,CAAC;AACR,gBAAI,EAAE,EAAE;WACT;AACD,eAAK,EAAE,SAAS;AAChB,eAAK,EAAE,CAAC;AACR,cAAI,EAAE,QAAQ;AACd,uBAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;SACzC;OACF,CACF;AACD,aAAO,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;KACnC;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/cluster.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_cluster/nodes/stats');\n api.addEndpointDescription('_cluster/state', {\n patterns: [\n \"_cluster/state\",\n \"_cluster/state/{metrics}\",\n \"_cluster/state/{metrics}/{indices}\"\n ],\n url_components: {\n \"metrics\": [\"version\", \"master_node\", \"nodes\", \"routing_table\", \"routing_node\", \"metadata\", \"blocks\"]\n }\n });\n api.addEndpointDescription('_cluster/health', {\n url_params: {\n \"local\": \"__flag__\",\n \"level\": [\"indices\", \"shards\"],\n \"master_timeout\": \"30s\",\n \"timeout\": \"30s\",\n \"wait_for_status\": [\"yellow\", \"green\"],\n \"wait_for_relocating_shards\": 0,\n \"wait_for_active_shards\": 0,\n \"wait_for_nodes\": 0\n }\n });\n api.addEndpointDescription('_cluster/pending_tasks');\n api.addEndpointDescription('get_cluster/settings', {\n patterns: [\n '_cluster/settings'\n ]\n });\n\n api.addEndpointDescription('put_cluster/settings', {\n methods: ['PUT'],\n patterns: [\n '_cluster/settings'\n ],\n data_autocomplete_rules: {\n persistent: {\n cluster: {\n routing: {\n 'allocation.enable': {__one_of: [\"all\", \"primaries\", \"new_primaries\", \"none\"]},\n 'allocation.disk.threshold_enabled': {__one_of: [false, true]},\n 'allocation.disk.watermark.low': '85%',\n 'allocation.disk.watermark.high': '90%',\n 'allocation.disk.include_relocations': {__one_of: [true, false]},\n 'allocation.disk.reroute_interval': '60s',\n 'allocation.exclude': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.include': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.require': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.awareness.attributes': [],\n 'allocation.awareness.force': {\n '*': {\n 'values': []\n }\n },\n 'allocation.allow_rebalance': {__one_of: ['always', 'indices_primaries_active', 'indices_all_active']},\n 'allocation.cluster_concurrent_rebalance': 2,\n 'allocation.node_initial_primaries_recoveries': 4,\n 'allocation.node_concurrent_recoveries': 2,\n 'allocation.same_shard.host': {__one_of: [false, true]}\n }\n },\n indices: {\n breaker: {\n \"total.limit\": \"70%\",\n \"fielddata.limit\": \"60%\",\n \"fielddata.overhead\": 1.03,\n \"request.limit\": \"40%\",\n \"request.overhead\": 1.0\n }\n }\n },\n transient: {\n __scope_link: '.persistent'\n }\n }\n });\n\n api.addEndpointDescription('_cluster/reroute', {\n methods: ['POST'],\n url_params: {\n explain: \"__flag__\",\n dry_run: \"__flag__\"\n },\n data_autocomplete_rules: {\n commands: [\n {\n move: {\n __template: {\n index: \"\",\n shard: 0,\n from_node: \"\",\n to_node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n from_node: \"{node}\",\n to_node: \"{node}\"\n },\n cancel: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: {__one_of: [true, false]}\n },\n allocate: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: {__one_of: [true, false]}\n }\n }\n ],\n dry_run: {__one_of: [true, false]}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/count.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_count', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_count\", \"{indices}/_count\", \"_count\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n min_score: 1.0,\n terminate_after: 10\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN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pZFxuICAgICAgcGF0dGVybnM6IFtcbiAgICAgICAgXCJ7aW5kaWNlc30ve3R5cGVzfS9fY291bnRcIixcbiAgICAgICAgXCJ7aW5kaWNlc30vX2NvdW50XCIsXG4gICAgICAgIFwiX2NvdW50XCJcbiAgICAgIF0sXG4gICAgICB1cmxfcGFyYW1zOiB7XG4gICAgICAgIHByZWZlcmVuY2U6IFtcIl9wcmltYXJ5XCIsIFwiX3ByaW1hcnlfZmlyc3RcIiwgXCJfbG9jYWxcIiwgXCJfb25seV9ub2RlOnh5elwiLCBcIl9wcmVmZXJfbm9kZTp4eXpcIiwgXCJfc2hhcmRzOjIsM1wiXSxcbiAgICAgICAgcm91dGluZzogXCJcIixcbiAgICAgICAgbWluX3Njb3JlOiAxLjAsXG4gICAgICAgIHRlcm1pbmF0ZV9hZnRlcjogMTAsXG4gICAgICB9LFxuICAgICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgICAgcXVlcnk6IHtcbiAgICAgICAgICAvLyBwb3B1bGF0ZWQgYnkgYSBnbG9iYWwgcnVsZVxuICAgICAgICB9XG4gICAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/count.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACjC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,0BAA0B,EAC1B,kBAAkB,EAClB,QAAQ,CACT;AACD,cAAU,EAAE;AACV,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,aAAO,EAAE,EAAE;AACX,eAAS,EAAE,GAAG;AACd,qBAAe,EAAE,EAAE;KACpB;AACD,2BAAuB,EAAE;AACvB,WAAK,EAAE;;OAEN;KACF;GACJ,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/count.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_count', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_count\",\n \"{indices}/_count\",\n \"_count\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n min_score: 1.0,\n terminate_after: 10,\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/document.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_doc', {\n methods: ['GET'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_get_doc_source', {\n methods: ['GET'],\n patterns: [\"{index}/{type}/{id}/_source\"],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_delete_doc', {\n methods: ['DELETE'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\"\n }\n });\n api.addEndpointDescription('index_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('create_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/{type}/{id}/_create\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('index_doc_no_id', {\n methods: ['POST'],\n patterns: [\"{index}/{type}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n\n api.addEndpointDescription('_update', {\n methods: ['POST'],\n patterns: [\"{index}/{type}/{id}/_update\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"force\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\",\n \"retry_on_conflict\": 3,\n \"fields\": \"\"\n },\n data_autocomplete_rules: {\n \"script\": {\n // populated by a global rule\n },\n \"doc\": {},\n \"upsert\": {},\n \"scripted_upsert\": { __one_of: [true, false] }\n }\n\n });\n\n api.addEndpointDescription('_put_script', {\n methods: ['POST', 'PUT'],\n patterns: [\"_scripts/{lang}/{id}\", \"_scripts/{lang}/{id}/_create\"],\n url_components: {\n \"lang\": [\"groovy\", \"expressions\"]\n },\n data_autocomplete_rules: {\n \"script\": \"\"\n }\n });\n\n api.addEndpointDescription('_termvectors', {\n methods: ['GET', 'POST'],\n patterns: [\"{index}/{type}/_termvectors\"],\n priority: 10, // collision with get doc\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n offsets: { __one_of: [false, true] },\n payloads: { __one_of: [false, true] },\n positions: { __one_of: [false, true] },\n term_statistics: { __one_of: [true, false] },\n field_statistics: { __one_of: [false, true] },\n dfs: { __one_of: [true, false] },\n per_field_analyzer: {\n __template: { \"FIELD\": \"\" },\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n doc: {},\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n api.addEndpointDescription('_termvectors_id', {\n methods: ['GET', 'POST'],\n patterns: [\"{index}/{type}/{id}/_termvectors\"],\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n offsets: { __one_of: [false, true] },\n payloads: { __one_of: [false, true] },\n positions: { __one_of: [false, true] },\n term_statistics: { __one_of: [true, false] },\n field_statistics: { __one_of: [false, true] },\n dfs: { __one_of: [true, false] },\n per_field_analyzer: {\n __template: { \"FIELD\": \"\" },\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2RvY3VtZW50LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsVUFBVSxFQUFFO0FBQ3JDLFdBQU8sRUFBRSxDQU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bmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgZmllbGRfc3RhdGlzdGljczoge19fb25lX29mOiBbZmFsc2UsIHRydWVdfSxcbiAgICAgIGRmczoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfSxcbiAgICAgIHBlcl9maWVsZF9hbmFseXplcjoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XCJGSUVMRFwiOiBcIlwifSxcbiAgICAgICAgXCJ7ZmllbGR9XCI6IFwiXCJcbiAgICAgIH0sXG4gICAgICByb3V0aW5nOiBcIlwiLFxuICAgICAgdmVyc2lvbjogMSxcbiAgICAgIHZlcnNpb25fdHlwZTogW1wiZXh0ZXJuYWxcIiwgXCJleHRlcm5hbF9ndFwiLCBcImV4dGVybmFsX2d0ZVwiLCBcImZvcmNlXCIsIFwiaW50ZXJuYWxcIl0sXG4gICAgICBmaWx0ZXI6IHsgLy8gVE9ETzogRXhjbHVkZSBmcm9tIGdsb2JhbCBmaWx0ZXIgcnVsZXNcbiAgICAgICAgXCJtYXhfbnVtX3Rlcm1zXCI6IDEsXG4gICAgICAgIFwibWluX3Rlcm1fZnJlcVwiOiAxLFxuICAgICAgICBcIm1heF90ZXJtX2ZyZXFcIjogMSxcbiAgICAgICAgXCJtaW5fZG9jX2ZyZXFcIjogMSxcbiAgICAgICAgXCJtYXhfZG9jX2ZyZXFcIjogMSxcbiAgICAgICAgXCJtaW5fd29yZF9sZW5ndGhcIjogMSxcbiAgICAgICAgXCJtYXhfd29yZF9sZW5ndGhcIjogMVxuICAgICAgfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/document.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,UAAU,EAAE;AACrC,WAAO,EAAE,CAAC,KAAK,CAAC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+ "module.exports = function (api) {\n api.addEndpointDescription('_get_doc', {\n methods: ['GET'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_get_doc_source', {\n methods: ['GET'],\n patterns: [\n \"{index}/{type}/{id}/_source\"\n ],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_delete_doc', {\n methods: ['DELETE'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\"\n }\n });\n api.addEndpointDescription('index_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('create_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/{type}/{id}/_create\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('index_doc_no_id', {\n methods: ['POST'],\n patterns: [\n \"{index}/{type}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n\n api.addEndpointDescription('_update', {\n methods: ['POST'],\n patterns: [\n \"{index}/{type}/{id}/_update\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"force\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\",\n \"retry_on_conflict\": 3,\n \"fields\": \"\"\n },\n data_autocomplete_rules: {\n \"script\": {\n // populated by a global rule\n },\n \"doc\": {},\n \"upsert\": {},\n \"scripted_upsert\": {__one_of: [true, false]}\n }\n\n });\n\n api.addEndpointDescription('_put_script', {\n methods: ['POST', 'PUT'],\n patterns: [\n \"_scripts/{lang}/{id}\",\n \"_scripts/{lang}/{id}/_create\"\n ],\n url_components: {\n \"lang\": [\n \"groovy\",\n \"expressions\"\n ]\n },\n data_autocomplete_rules: {\n \"script\": \"\"\n }\n });\n\n api.addEndpointDescription('_termvectors', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{index}/{type}/_termvectors\"\n ],\n priority: 10, // collision with get doc\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\"\n ],\n offsets: {__one_of: [false, true]},\n payloads: {__one_of: [false, true]},\n positions: {__one_of: [false, true]},\n term_statistics: {__one_of: [true, false]},\n field_statistics: {__one_of: [false, true]},\n dfs: {__one_of: [true, false]},\n per_field_analyzer: {\n __template: {\"FIELD\": \"\"},\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n doc: {},\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n api.addEndpointDescription('_termvectors_id', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{index}/{type}/{id}/_termvectors\"\n ],\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\",\n \"dfs\": \"__flag__\"\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\"\n ],\n offsets: {__one_of: [false, true]},\n payloads: {__one_of: [false, true]},\n positions: {__one_of: [false, true]},\n term_statistics: {__one_of: [true, false]},\n field_statistics: {__one_of: [false, true]},\n dfs: {__one_of: [true, false]},\n per_field_analyzer: {\n __template: {\"FIELD\": \"\"},\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n filter: { // TODO: Exclude from global filter rules\n \"max_num_terms\": 1,\n \"min_term_freq\": 1,\n \"max_term_freq\": 1,\n \"min_doc_freq\": 1,\n \"max_doc_freq\": 1,\n \"min_word_length\": 1,\n \"max_word_length\": 1\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_field_stats', {\n methods: ['GET', 'POST'],\n patterns: [\"_field_stats\", \"{indices}/_field_stats\"],\n url_params: {\n fields: [],\n level: [\"cluster\", \"indices\"],\n ignore_unavailable: [\"true\", \"false\"],\n allow_no_indices: [false, true],\n expand_wildcards: [\"open\", \"closed\", \"none\", \"all\"]\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n index_constraints: {\n \"{field}\": {\n min_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n },\n max_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n }\n },\n __template: {\n \"FIELD\": {\n min_value: {\n gt: \"MIN\"\n },\n max_value: {\n lt: \"MAX\"\n }\n }\n }\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2ZpZWxkX3N0YXRzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRy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SU5cIixcbiAgICAgICAgICAgIGx0ZTogXCJNQVhcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgbWF4X3ZhbHVlOiB7XG4gICAgICAgICAgICBndDogXCJNSU5cIixcbiAgICAgICAgICAgIGd0ZTogXCJNQVhcIixcbiAgICAgICAgICAgIGx0OiBcIk1JTlwiLFxuICAgICAgICAgICAgbHRlOiBcIk1BWFwiXG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgXCJGSUVMRFwiOiB7XG4gICAgICAgICAgICBtaW5fdmFsdWU6IHtcbiAgICAgICAgICAgICAgZ3Q6IFwiTUlOXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtYXhfdmFsdWU6IHtcbiAgICAgICAgICAgICAgbHQ6IFwiTUFYXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,CACR,cAAc,EACd,wBAAwB,CACzB;AACD,cAAU,EAAE;AACV,YAAM,EAAE,EAAE;AACV,WAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;AAC7B,wBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AACrC,sBAAgB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/B,sBAAgB,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC;KACpD;AACD,2BAAuB,EAAE;AACvB,YAAM,EAAE,CACN,SAAS,CACV;AACD,uBAAiB,EAAE;AACjB,iBAAS,EAAE;AACT,mBAAS,EAAE;AACT,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;AACV,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;WACX;AACD,mBAAS,EAAE;AACT,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;AACV,cAAE,EAAE,KAAK;AACT,eAAG,EAAE,KAAK;WACX;SACF;AACD,kBAAU,EAAE;AACV,iBAAO,EAAE;AACP,qBAAS,EAAE;AACT,gBAAE,EAAE,KAAK;aACV;AACD,qBAAS,EAAE;AACT,gBAAE,EAAE,KAAK;aACV;WACF;SACF;OACF;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/field_stats.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_field_stats', {\n methods: ['GET', 'POST'],\n patterns: [\n \"_field_stats\",\n \"{indices}/_field_stats\"\n ],\n url_params: {\n fields: [],\n level: [\"cluster\", \"indices\"],\n ignore_unavailable: [\"true\", \"false\"],\n allow_no_indices: [false, true],\n expand_wildcards: [\"open\", \"closed\", \"none\", \"all\"]\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\",\n ],\n index_constraints: {\n \"{field}\": {\n min_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n },\n max_value: {\n gt: \"MIN\",\n gte: \"MAX\",\n lt: \"MIN\",\n lte: \"MAX\"\n }\n },\n __template: {\n \"FIELD\": {\n min_value: {\n gt: \"MIN\"\n },\n max_value: {\n lt: \"MAX\"\n }\n }\n }\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/filter.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar filters = {};\n\nfilters.and = {\n __template: {\n filters: [{}]\n },\n filters: [{\n __scope_link: '.'\n }]\n};\n\nfilters.bool = {\n __scope_link: 'GLOBAL.query'\n};\n\nfilters.exists = {\n __template: {\n 'field': 'FIELD_NAME'\n },\n 'field': '{field}'\n};\n\nfilters.ids = {\n __template: {\n 'values': ['ID']\n },\n 'type': '{type}',\n 'values': ['']\n};\n\nfilters.limit = {\n __template: {\n value: 100\n },\n value: 100\n};\n\nfilters.type = {\n __template: {\n value: 'TYPE'\n },\n value: '{type}'\n};\n\nfilters.geo_bounding_box = {\n __template: {\n 'FIELD': {\n 'top_left': {\n 'lat': 40.73,\n 'lon': -74.1\n },\n 'bottom_right': {\n 'lat': 40.717,\n 'lon': -73.99\n }\n }\n },\n\n '{field}': {\n top_left: {\n lat: 40.73,\n lon: -74.1\n },\n bottom_right: {\n lat: 40.73,\n lon: -74.1\n }\n },\n type: {\n __one_of: ['memory', 'indexed']\n }\n};\n\nfilters.geo_distance = {\n __template: {\n distance: 100,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n distance: 100,\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n optimize_bbox: {\n __one_of: ['memory', 'indexed', 'none']\n },\n '{field}': {\n lat: 40.73,\n lon: -74.1\n }\n};\n\nfilters.geo_distance_range = {\n __template: {\n from: 100,\n to: 200,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n from: 100,\n to: 200,\n\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n include_lower: {\n __one_of: [true, false]\n },\n include_upper: {\n __one_of: [true, false]\n },\n\n '{field}': {\n lat: 40.73,\n lon: -74.1\n }\n};\n\nfilters.geo_polygon = {\n __template: {\n 'FIELD': {\n 'points': [{\n lat: 40.73,\n lon: -74.1\n }, {\n lat: 40.83,\n lon: -75.1\n }]\n }\n },\n '{field}': {\n points: [{\n lat: 40.73,\n lon: -74.1\n }]\n }\n};\n\nfilters.geo_shape = {\n __template: {\n 'FIELD': {\n shape: {\n type: 'envelope',\n coordinates: [[-45, 45], [45, -45]]\n },\n 'relation': 'within'\n }\n },\n '{field}': {\n shape: {\n type: '',\n coordinates: []\n },\n indexed_shape: {\n id: '',\n index: '{index}',\n type: '{type}',\n shape_field_name: 'shape'\n },\n relation: {\n __one_of: ['within', 'intersects', 'disjoint']\n }\n }\n};\n\nfilters.has_child = {\n __template: {\n type: 'TYPE',\n filter: {}\n },\n type: '{type}',\n query: {},\n filter: {},\n _scope: '',\n min_children: 1,\n max_children: 10\n};\n\nfilters.has_parent = {\n __template: {\n parent_type: 'TYPE',\n filter: {}\n },\n parent_type: '{type}',\n query: {},\n filter: {},\n _scope: ''\n};\n\nfilters.m = filters.missing = {\n __template: {\n field: 'FIELD'\n },\n existence: {\n __one_of: [true, false]\n },\n null_value: {\n __one_of: [true, false]\n },\n field: '{field}'\n};\n\nfilters.not = {\n __template: {\n filter: {}\n },\n filter: {}\n};\n\nfilters.range = {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n \"{field}\": {\n gte: 1,\n gt: 1,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n \"format\": \"dd/MM/yyyy||yyyy\",\n execution: { __one_of: [\"index\", \"fielddata\"] }\n }\n};\n\nfilters.or = {\n __template: {\n filters: [{}]\n },\n filters: [{\n __scope_link: '.'\n }]\n};\n\nfilters.prefix = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\nfilters.query = {\n // global query\n};\n\nfilters.script = {\n __template: {\n script: {}\n },\n script: {\n // populated by a global rule\n }\n};\n\nfilters.term = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\nfilters.terms = {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n field: ['{field}'],\n execution: {\n __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']\n }\n};\n\nfilters.nested = {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n query: {},\n path: '',\n _name: ''\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('filter', filters);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2ZpbHRlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksT0FBTyxHQUFHLEVBQUUsQ0FBQzs7QUFFakIsT0FBTyxDQUFDLEdBQUcsR0FBRztBQUNaLFlBQVUsRUFBRTtBQUNWLFdBQU8sRUFBRSxDQUNQLEVBQUUsQ0FDSDtHQUNGO0FBQ0QsU0FBTyxFQUFFLENBQ1A7QUFDRSxnQkFBWSxFQUFFLEdBQUc7R0FDbEIsQ0FDRjtDQUNGLENBQUM7O0FBR0YsT0FBTyxDQUFDLElBQUksR0FBRztBQUNiLGNBQVksRUFBRSxjQUFjO0NBQzdCLENBQUM7O0FBR0YsT0FBTyxDQUFDLE1BQU0sR0FBRzt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XVlcnkgPSB7XG4gIC8vIGdsb2JhbCBxdWVyeVxufTtcblxuZmlsdGVycy5zY3JpcHQgPSB7XG4gIF9fdGVtcGxhdGU6IHtcbiAgICBzY3JpcHQ6IHt9XG4gIH0sXG4gIHNjcmlwdDoge1xuICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gIH1cbn07XG5cblxuZmlsdGVycy50ZXJtID0ge1xuICBfX3RlbXBsYXRlOiB7XG4gICAgJ0ZJRUxEJzogJ1ZBTFVFJ1xuICB9LFxuICAne2ZpZWxkfSc6ICcnXG59O1xuXG5cbmZpbHRlcnMudGVybXMgPSB7XG4gIF9fdGVtcGxhdGU6IHtcbiAgICAnRklFTEQnOiBbJ1ZBTFVFMScsICdWQUxVRTInXVxuICB9LFxuICBmaWVsZDogWyd7ZmllbGR9J10sXG4gIGV4ZWN1dGlvbjoge1xuICAgIF9fb25lX29mOiBbJ3BsYWluJywgJ2Jvb2wnLCAnYW5kJywgJ29yJywgJ2Jvb2xfbm9jYWNoZScsICdhbmRfbm9jYWNoZScsICdvcl9ub2NhY2hlJ11cbiAgfVxufTtcblxuXG5maWx0ZXJzLm5lc3RlZCA9IHtcbiAgX190ZW1wbGF0ZToge1xuICAgIHBhdGg6ICdwYXRoX3RvX25lc3RlZF9kb2MnLFxuICAgIHF1ZXJ5OiB7fVxuICB9LFxuICBxdWVyeToge30sXG4gIHBhdGg6ICcnLFxuICBfbmFtZTogJydcbn07XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGFwaSkge1xuICBhcGkuYWRkR2xvYmFsQXV0b2NvbXBsZXRlUnVsZXMoJ2ZpbHRlcicsIGZpbHRlcnMpO1xufTtcblxuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/filter.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,OAAO,GAAG,EAAE,CAAC;;AAEjB,OAAO,CAAC,G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GACjB;AACD,WAAS,EAAE,EAAE;CACd,CAAC;;AAGF,OAAO,CAAC,KAAK,GAAG;AACd,YAAU,EAAE;AACV,WAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;GAC9B;AACD,OAAK,EAAE,CAAC,SAAS,CAAC;AAClB,WAAS,EAAE;AACT,YAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,CAAC;GACtF;CACF,CAAC;;AAGF,OAAO,CAAC,MAAM,GAAG;AACf,YAAU,EAAE;AACV,QAAI,EAAE,oBAAoB;AAC1B,SAAK,EAAE,EAAE;GACV;AACD,OAAK,EAAE,EAAE;AACT,MAAI,EAAE,EAAE;AACR,OAAK,EAAE,EAAE;CACV,CAAC;;AAEF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,0BAA0B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;CACnD,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/filter.js", + "sourcesContent": [ + "var filters = {};\n\nfilters.and = {\n __template: {\n filters: [\n {}\n ]\n },\n filters: [\n {\n __scope_link: '.'\n }\n ],\n};\n\n\nfilters.bool = {\n __scope_link: 'GLOBAL.query'\n};\n\n\nfilters.exists = {\n __template: {\n 'field': 'FIELD_NAME'\n },\n 'field': '{field}'\n};\n\n\nfilters.ids = {\n __template: {\n 'values': ['ID']\n },\n 'type': '{type}',\n 'values': ['']\n};\n\n\nfilters.limit = {\n __template: {\n value: 100\n },\n value: 100\n};\n\n\nfilters.type = {\n __template: {\n value: 'TYPE'\n },\n value: '{type}'\n};\n\n\nfilters.geo_bounding_box = {\n __template: {\n 'FIELD': {\n 'top_left': {\n 'lat': 40.73,\n 'lon': -74.1\n },\n 'bottom_right': {\n 'lat': 40.717,\n 'lon': -73.99\n }\n }\n },\n\n '{field}': {\n top_left: {\n lat: 40.73,\n lon: -74.1\n },\n bottom_right: {\n lat: 40.73,\n lon: -74.1\n }\n },\n type: {\n __one_of: ['memory', 'indexed']\n },\n};\n\n\nfilters.geo_distance = {\n __template: {\n distance: 100,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n distance: 100,\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n optimize_bbox: {\n __one_of: ['memory', 'indexed', 'none']\n },\n '{field}': {\n lat: 40.73,\n lon: -74.1\n },\n};\n\n\nfilters.geo_distance_range = {\n __template: {\n from: 100,\n to: 200,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n from: 100,\n to: 200,\n\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n include_lower: {\n __one_of: [true, false]\n },\n include_upper: {\n __one_of: [true, false]\n },\n\n '{field}': {\n lat: 40.73,\n lon: -74.1\n }\n};\n\n\nfilters.geo_polygon = {\n __template: {\n 'FIELD': {\n 'points': [\n {\n lat: 40.73,\n lon: -74.1\n },\n {\n lat: 40.83,\n lon: -75.1\n }\n ]\n }\n },\n '{field}': {\n points: [\n {\n lat: 40.73,\n lon: -74.1\n }\n ]\n }\n};\n\n\nfilters.geo_shape = {\n __template: {\n 'FIELD': {\n shape: {\n type: 'envelope',\n coordinates: [\n [-45, 45],\n [45, -45]\n ]\n },\n 'relation': 'within'\n }\n },\n '{field}': {\n shape: {\n type: '',\n coordinates: []\n },\n indexed_shape: {\n id: '',\n index: '{index}',\n type: '{type}',\n shape_field_name: 'shape'\n },\n relation: {\n __one_of: ['within', 'intersects', 'disjoint']\n }\n }\n};\n\n\nfilters.has_child = {\n __template: {\n type: 'TYPE',\n filter: {}\n },\n type: '{type}',\n query: {},\n filter: {},\n _scope: '',\n min_children: 1,\n max_children: 10\n};\n\n\nfilters.has_parent = {\n __template: {\n parent_type: 'TYPE',\n filter: {}\n },\n parent_type: '{type}',\n query: {},\n filter: {},\n _scope: ''\n};\n\n\nfilters.m = filters.missing = {\n __template: {\n field: 'FIELD'\n },\n existence: {\n __one_of: [true, false]\n },\n null_value: {\n __one_of: [true, false]\n },\n field: '{field}'\n};\n\n\nfilters.not = {\n __template: {\n filter: {}\n },\n filter: {}\n};\n\n\nfilters.range = {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n \"{field}\": {\n gte: 1,\n gt: 1,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n \"format\": \"dd/MM/yyyy||yyyy\",\n execution: {__one_of: [\"index\", \"fielddata\"]}\n }\n};\n\n\nfilters.or = {\n __template: {\n filters: [\n {}\n ]\n },\n filters: [\n {\n __scope_link: '.'\n }\n ]\n};\n\n\nfilters.prefix = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\n\nfilters.query = {\n // global query\n};\n\nfilters.script = {\n __template: {\n script: {}\n },\n script: {\n // populated by a global rule\n }\n};\n\n\nfilters.term = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': ''\n};\n\n\nfilters.terms = {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n field: ['{field}'],\n execution: {\n __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']\n }\n};\n\n\nfilters.nested = {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n query: {},\n path: '',\n _name: ''\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('filter', filters);\n};\n\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/nodes.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_nodes/hot_threads', {\n methods: ['GET'],\n patterns: [\"_nodes/hot_threads\", \"_nodes/{nodes}/hot_threads\"]\n });\n api.addEndpointDescription('_nodes/info', {\n patterns: [\"_nodes\", \"_nodes/{metrics}\", \"_nodes/{nodes}\", \"_nodes/{nodes}/{metrics}\", \"_nodes/{nodes}/info/{metrics}\"],\n url_components: {\n \"metrics\": [\"settings\", \"os\", \"process\", \"jvm\", \"thread_pool\", \"network\", \"transport\", \"http\", \"plugins\", \"_all\"]\n }\n });\n api.addEndpointDescription('_nodes/stats', {\n patterns: [\"_nodes/stats\", \"_nodes/stats/{metrics}\", \"_nodes/stats/{metrics}/{index_metric}\", \"_nodes/{nodes}/stats\", \"_nodes/{nodes}/stats/{metrics}\", \"_nodes/{nodes}/stats/{metrics}/{index_metric}\"],\n url_components: {\n \"metrics\": [\"os\", \"jvm\", \"thread_pool\", \"network\", \"fs\", \"transport\", \"http\", \"indices\", \"process\", \"breaker\", \"_all\"],\n \"index_metric\": [\"store\", \"indexing\", \"get\", \"search\", \"merge\", \"flush\", \"refresh\", \"filter_cache\", \"fielddata\", \"docs\", \"warmer\", \"percolate\", \"completion\", \"segments\", \"translog\", \"query_cache\", \"_all\"]\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZW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b25lbnRzOiB7XG4gICAgICBcIm1ldHJpY3NcIjogW1xuICAgICAgICBcInNldHRpbmdzXCIsXG4gICAgICAgIFwib3NcIixcbiAgICAgICAgXCJwcm9jZXNzXCIsXG4gICAgICAgIFwianZtXCIsXG4gICAgICAgIFwidGhyZWFkX3Bvb2xcIixcbiAgICAgICAgXCJuZXR3b3JrXCIsXG4gICAgICAgIFwidHJhbnNwb3J0XCIsXG4gICAgICAgIFwiaHR0cFwiLFxuICAgICAgICBcInBsdWdpbnNcIixcbiAgICAgICAgXCJfYWxsXCJcbiAgICAgIF1cbiAgICB9XG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX25vZGVzL3N0YXRzJywge1xuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIl9ub2Rlcy9zdGF0c1wiLFxuICAgICAgXCJfbm9kZXMvc3RhdHMve21ldHJpY3N9XCIsXG4gICAgICBcIl9ub2Rlcy9zdGF0cy97bWV0cmljc30ve2luZGV4X21ldHJpY31cIixcbiAgICAgIFwiX25vZGVzL3tub2Rlc30vc3RhdHNcIixcbiAgICAgIFwiX25vZGVzL3tub2Rlc30vc3RhdHMve21ldHJpY3N9XCIsXG4gICAgICBcIl9ub2Rlcy97bm9kZXN9L3N0YXRzL3ttZXRyaWNzfS97aW5kZXhfbWV0cmljfVwiXG4gICAgXSxcbiAgICB1cmxfY29tcG9uZW50czoge1xuICAgICAgXCJtZXRyaWNzXCI6IFtcbiAgICAgICAgXCJvc1wiLFxuICAgICAgICBcImp2bVwiLFxuICAgICAgICBcInRocmVhZF9wb29sXCIsXG4gICAgICAgIFwibmV0d29ya1wiLFxuICAgICAgICBcImZzXCIsXG4gICAgICAgIFwidHJhbnNwb3J0XCIsXG4gICAgICAgIFwiaHR0cFwiLFxuICAgICAgICBcImluZGljZXNcIixcbiAgICAgICAgXCJwcm9jZXNzXCIsXG4gICAgICAgIFwiYnJlYWtlclwiLFxuICAgICAgICBcIl9hbGxcIlxuICAgICAgXSxcbiAgICAgIFwiaW5kZXhfbWV0cmljXCI6IFtcbiAgICAgICAgXCJzdG9yZVwiLFxuICAgICAgICBcImluZGV4aW5nXCIsXG4gICAgICAgIFwiZ2V0XCIsXG4gICAgICAgIFwic2VhcmNoXCIsXG4gICAgICAgIFwibWVyZ2VcIixcbiAgICAgICAgXCJmbHVzaFwiLFxuICAgICAgICBcInJlZnJlc2hcIixcbiAgICAgICAgXCJmaWx0ZXJfY2FjaGVcIixcbiAgICAgICAgXCJmaWVsZGRhdGFcIixcbiAgICAgICAgXCJkb2NzXCIsXG4gICAgICAgIFwid2FybWVyXCIsXG4gICAgICAgIFwicGVyY29sYXRlXCIsXG4gICAgICAgIFwiY29tcGxldGlvblwiLFxuICAgICAgICBcInNlZ21lbnRzXCIsXG4gICAgICAgIFwidHJhbnNsb2dcIixcbiAgICAgICAgXCJxdWVyeV9jYWNoZVwiLFxuICAgICAgICBcIl9hbGxcIlxuICAgICAgXVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/nodes.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,oBAAoB,EAAE;AAC/C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,oBAAoB,EACpB,4BAA4B,CAC7B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,+BAA+B,CAChC;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,UAAU,EACV,IAAI,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,CACP;KACF;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,YAAQ,EAAE,CACR,cAAc,EACd,wBAAwB,EACxB,uCAAuC,EACvC,sBAAsB,EACtB,gCAAgC,EAChC,+CAA+C,CAChD;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,IAAI,EACJ,KAAK,EACL,aAAa,EACb,SAAS,EACT,IAAI,EACJ,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,CACP;AACD,oBAAc,EAAE,CACd,OAAO,EACP,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,MAAM,CACP;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/nodes.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_nodes/hot_threads', {\n methods: ['GET'],\n patterns: [\n \"_nodes/hot_threads\",\n \"_nodes/{nodes}/hot_threads\"\n ]\n });\n api.addEndpointDescription('_nodes/info', {\n patterns: [\n \"_nodes\",\n \"_nodes/{metrics}\",\n \"_nodes/{nodes}\",\n \"_nodes/{nodes}/{metrics}\",\n \"_nodes/{nodes}/info/{metrics}\"\n ],\n url_components: {\n \"metrics\": [\n \"settings\",\n \"os\",\n \"process\",\n \"jvm\",\n \"thread_pool\",\n \"network\",\n \"transport\",\n \"http\",\n \"plugins\",\n \"_all\"\n ]\n }\n });\n api.addEndpointDescription('_nodes/stats', {\n patterns: [\n \"_nodes/stats\",\n \"_nodes/stats/{metrics}\",\n \"_nodes/stats/{metrics}/{index_metric}\",\n \"_nodes/{nodes}/stats\",\n \"_nodes/{nodes}/stats/{metrics}\",\n \"_nodes/{nodes}/stats/{metrics}/{index_metric}\"\n ],\n url_components: {\n \"metrics\": [\n \"os\",\n \"jvm\",\n \"thread_pool\",\n \"network\",\n \"fs\",\n \"transport\",\n \"http\",\n \"indices\",\n \"process\",\n \"breaker\",\n \"_all\"\n ],\n \"index_metric\": [\n \"store\",\n \"indexing\",\n \"get\",\n \"search\",\n \"merge\",\n \"flush\",\n \"refresh\",\n \"filter_cache\",\n \"fielddata\",\n \"docs\",\n \"warmer\",\n \"percolate\",\n \"completion\",\n \"segments\",\n \"translog\",\n \"query_cache\",\n \"_all\"\n ]\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/globals.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('highlight', {\n pre_tags: {},\n post_tags: {},\n tags_schema: {},\n fields: {\n '{field}': {\n fragment_size: 20,\n number_of_fragments: 3\n }\n }\n });\n\n api.addGlobalAutocompleteRules('script', {\n __template: {\n inline: \"SCRIPT\"\n },\n inline: \"SCRIPT\",\n file: \"FILE_SCRIPT_NAME\",\n id: \"SCRIPT_ID\",\n lang: \"\",\n params: {}\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uI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LCB7XG4gICAgcHJlX3RhZ3M6IHt9LFxuICAgIHBvc3RfdGFnczoge30sXG4gICAgdGFnc19zY2hlbWE6IHt9LFxuICAgIGZpZWxkczoge1xuICAgICAgJ3tmaWVsZH0nOiB7XG4gICAgICAgIGZyYWdtZW50X3NpemU6IDIwLFxuICAgICAgICBudW1iZXJfb2ZfZnJhZ21lbnRzOiAzXG4gICAgICB9XG4gICAgfVxuICB9KTtcblxuICBhcGkuYWRkR2xvYmFsQXV0b2NvbXBsZXRlUnVsZXMoJ3NjcmlwdCcsIHtcbiAgICBfX3RlbXBsYXRlOiB7XG4gICAgICBpbmxpbmU6IFwiU0NSSVBUXCJcbiAgICB9LFxuICAgIGlubGluZTogXCJTQ1JJUFRcIixcbiAgICBmaWxlOiBcIkZJTEVfU0NSSVBUX05BTUVcIixcbiAgICBpZDogXCJTQ1JJUFRfSURcIixcbiAgICBsYW5nOiBcIlwiLFxuICAgIHBhcmFtczoge31cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/globals.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,0BAA0B,CAAC,WAAW,EAAE;AAC1C,YAAQ,EAAE,EAAE;AACZ,aAAS,EAAE,EAAE;AACb,eAAW,EAAE,EAAE;AACf,UAAM,EAAE;AACN,eAAS,EAAE;AACT,qBAAa,EAAE,EAAE;AACjB,2BAAmB,EAAE,CAAC;OACvB;KACF;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,0BAA0B,CAAC,QAAQ,EAAE;AACvC,cAAU,EAAE;AACV,YAAM,EAAE,QAAQ;KACjB;AACD,UAAM,EAAE,QAAQ;AAChB,QAAI,EAAE,kBAAkB;AACxB,MAAE,EAAE,WAAW;AACf,QAAI,EAAE,EAAE;AACR,UAAM,EAAE,EAAE;GACX,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/globals.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addGlobalAutocompleteRules('highlight', {\n pre_tags: {},\n post_tags: {},\n tags_schema: {},\n fields: {\n '{field}': {\n fragment_size: 20,\n number_of_fragments: 3\n }\n }\n });\n\n api.addGlobalAutocompleteRules('script', {\n __template: {\n inline: \"SCRIPT\"\n },\n inline: \"SCRIPT\",\n file: \"FILE_SCRIPT_NAME\",\n id: \"SCRIPT_ID\",\n lang: \"\",\n params: {}\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/indices.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_refresh', {\n methods: ['POST'],\n patterns: [\"_refresh\", \"{indices}/_refresh\"]\n });\n\n api.addEndpointDescription('_flush', {\n methods: ['POST'],\n patterns: [\"_flush\", \"{indices}/_flush\"],\n url_params: {\n wait_if_ongoing: [true, false],\n force: [true, false]\n }\n });\n\n api.addEndpointDescription('_flush_synced', {\n methods: ['POST'],\n patterns: [\"_flush/synced\", \"{indices}/_flush/synced\"]\n });\n\n api.addEndpointDescription('_stats', {\n patterns: [\"_stats\", \"_stats/{metrics}\", \"{indices}/_stats\", \"{indices}/_stats/{metrics}\"],\n url_components: {\n \"metrics\": [\"docs\", \"store\", \"indexing\", \"search\", \"get\", \"merge\", \"refresh\", \"flush\", \"warmer\", \"filter_cache\", \"percolate\", \"segments\", \"fielddata\", \"completion\", \"translog\", \"query_cache\", \"commit\", \"_all\"]\n },\n url_params: {\n \"fields\": [],\n \"types\": [],\n \"completion_fields\": [],\n \"fielddata_fields\": [],\n \"level\": [\"cluster\", \"indices\", \"shards\"]\n }\n\n });\n\n api.addEndpointDescription('_segments', {\n patterns: [\"{indices}/_segments\", \"_segments\"]\n });\n\n api.addEndpointDescription('_recovery', {\n patterns: [\"{indices}/_recovery\", \"_recovery\"],\n url_params: {\n detailed: \"__flag__\",\n active_only: \"__flag__\",\n human: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_analyze', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/_analyze\", \"_analyze\"],\n url_params: {\n \"analyzer\": \"\",\n \"char_filters\": [],\n \"field\": \"\",\n \"filters\": [],\n \"text\": \"\",\n \"tokenizer\": \"\"\n }\n });\n\n api.addEndpointDescription('_validate_query', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/_validate/query\", \"_validate/query\"],\n url_params: {\n explain: \"__flag__\",\n rewrite: \"__flag__\"\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n\n api.addEndpointDescription('_shard_stores', {\n methods: ['GET'],\n patterns: [\"{indices}/_shard_stores\", \"_shard_stores\"],\n url_params: {\n status: [\"green\", \"yellow\", \"red\", \"all\"]\n }\n });\n\n api.addEndpointDescription('__create_index__', {\n methods: ['PUT'],\n patterns: [\"{index}\"],\n data_autocomplete_rules: {\n mappings: {\n __scope_link: '_put_mapping'\n },\n settings: {\n __scope_link: '_put_settings'\n },\n aliases: {\n __template: {\n \"NAME\": {}\n }\n }\n }\n });\n\n api.addEndpointDescription('__delete_indices__', {\n methods: ['DELETE'],\n patterns: [\"{indices}\"]\n });\n\n api.addEndpointDescription('_get_index_settings', {\n methods: ['GET'],\n patterns: [\"{indices}/_settings\"],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_get_index', {\n methods: ['GET'],\n patterns: [\"{indices}\", \"{indices}/{feature}\"],\n url_components: {\n \"feature\": [\"_mappings\", \"_warmers\", \"_aliases\"]\n }\n });\n\n api.addEndpointDescription('_cache/clear', {\n patterns: [\"_cache/clear\", \"{indices}/_cache/clear\"]\n });\n\n api.addEndpointDescription('_upgrade', {\n methods: [\"POST\"],\n patterns: [\"_upgrade\", \"{indices}/_upgrade\"],\n url_params: {\n wait_for_completion: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_upgrade_status', {\n methods: [\"GET\"],\n patterns: [\"_upgrade\", \"{indices}/_upgrade\"]\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL2luZGljZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxVQUFVLEVBQUU7QUFDckMsV0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDO0FBQ2pCLFlBQVEsRUFBRSxDQUNSLFVBQVUsRUFDVixvQkFBb0IsQ0FDckI7R0FDRixDQUFDLENBQUM7O0FBRUgsS0FBRyxDQUFDLHNCQUFzQixDQUFDLFFBQVEsRUFBRTtBQUNuQyxXQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUM7QUFDakIsWUFBUSxFQUFFLENBQ1IsUUFBUSxFQUNSLGtCQUFrQixDQUNu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AgXCJpbmRleGluZ1wiLFxuICAgICAgICBcInNlYXJjaFwiLFxuICAgICAgICBcImdldFwiLFxuICAgICAgICBcIm1lcmdlXCIsXG4gICAgICAgIFwicmVmcmVzaFwiLFxuICAgICAgICBcImZsdXNoXCIsXG4gICAgICAgIFwid2FybWVyXCIsXG4gICAgICAgIFwiZmlsdGVyX2NhY2hlXCIsXG4gICAgICAgIFwicGVyY29sYXRlXCIsXG4gICAgICAgIFwic2VnbWVudHNcIixcbiAgICAgICAgXCJmaWVsZGRhdGFcIixcbiAgICAgICAgXCJjb21wbGV0aW9uXCIsXG4gICAgICAgIFwidHJhbnNsb2dcIixcbiAgICAgICAgXCJxdWVyeV9jYWNoZVwiLFxuICAgICAgICBcImNvbW1pdFwiLFxuICAgICAgICBcIl9hbGxcIlxuICAgICAgXVxuICAgIH0sXG4gICAgdXJsX3BhcmFtczoge1xuICAgICAgXCJmaWVsZHNcIjogW10sXG4gICAgICBcInR5cGVzXCI6IFtdLFxuICAgICAgXCJjb21wbGV0aW9uX2ZpZWxkc1wiOiBbXSxcbiAgICAgIFwiZmllbGRkYXRhX2ZpZWxkc1wiOiBbXSxcbiAgICAgIFwibGV2ZWxcIjogW1wiY2x1c3RlclwiLCBcImluZGljZXNcIiwgXCJzaGFyZHNcIl1cbiAgICB9XG5cbiAgfSk7XG5cbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19zZWdtZW50cycsIHtcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJ7aW5kaWNlc30vX3NlZ21lbnRzXCIsXG4gICAgICBcIl9zZWdtZW50c1wiXG4gICAgXVxuICB9KTtcblxuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3JlY292ZXJ5Jywge1xuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS9fcmVjb3ZlcnlcIixcbiAgICAgIFwiX3JlY292ZXJ5XCJcbiAgICBdLFxuICAgIHVybF9wYXJhbXM6IHtcbi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kdFVFwiXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJfdXBncmFkZVwiLFxuICAgICAgXCJ7aW5kaWNlc30vX3VwZ3JhZGVcIlxuICAgIF1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/indices.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,UAAU,EAAE;AACrC,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,UAAU,EACV,oBAAoB,CACrB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACnC,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,CACnB;AACD,cAAU,EAAE;AACV,qBAAe,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;AAC9B,WAAK,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;KACrB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,eAAe,EACf,yBAAyB,CAC1B;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACnC,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,CAC7B;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,QAAQ,EACR,M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MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,UAAU,EACV,oBAAoB,CACrB;AACD,cAAU,EAAE;AACV,yBAAmB,EAAE,UAAU;KAChC;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,UAAU,EACV,oBAAoB,CACrB;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/indices.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_refresh', {\n methods: ['POST'],\n patterns: [\n \"_refresh\",\n \"{indices}/_refresh\"\n ],\n });\n\n api.addEndpointDescription('_flush', {\n methods: ['POST'],\n patterns: [\n \"_flush\",\n \"{indices}/_flush\"\n ],\n url_params: {\n wait_if_ongoing: [true, false],\n force: [true, false]\n }\n });\n\n api.addEndpointDescription('_flush_synced', {\n methods: ['POST'],\n patterns: [\n \"_flush/synced\",\n \"{indices}/_flush/synced\"\n ]\n });\n\n api.addEndpointDescription('_stats', {\n patterns: [\n \"_stats\",\n \"_stats/{metrics}\",\n \"{indices}/_stats\",\n \"{indices}/_stats/{metrics}\",\n ],\n url_components: {\n \"metrics\": [\n \"docs\",\n \"store\",\n \"indexing\",\n \"search\",\n \"get\",\n \"merge\",\n \"refresh\",\n \"flush\",\n \"warmer\",\n \"filter_cache\",\n \"percolate\",\n \"segments\",\n \"fielddata\",\n \"completion\",\n \"translog\",\n \"query_cache\",\n \"commit\",\n \"_all\"\n ]\n },\n url_params: {\n \"fields\": [],\n \"types\": [],\n \"completion_fields\": [],\n \"fielddata_fields\": [],\n \"level\": [\"cluster\", \"indices\", \"shards\"]\n }\n\n });\n\n api.addEndpointDescription('_segments', {\n patterns: [\n \"{indices}/_segments\",\n \"_segments\"\n ]\n });\n\n api.addEndpointDescription('_recovery', {\n patterns: [\n \"{indices}/_recovery\",\n \"_recovery\"\n ],\n url_params: {\n detailed: \"__flag__\",\n active_only: \"__flag__\",\n human: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_analyze', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/_analyze\",\n \"_analyze\"\n ],\n url_params: {\n \"analyzer\": \"\",\n \"char_filters\": [],\n \"field\": \"\",\n \"filters\": [],\n \"text\": \"\",\n \"tokenizer\": \"\"\n }\n });\n\n api.addEndpointDescription('_validate_query', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/_validate/query\",\n \"_validate/query\"\n ],\n url_params: {\n explain: \"__flag__\",\n rewrite: \"__flag__\"\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n\n api.addEndpointDescription('_shard_stores', {\n methods: ['GET'],\n patterns: [\n \"{indices}/_shard_stores\",\n \"_shard_stores\"\n ],\n url_params: {\n status: [\"green\", \"yellow\", \"red\", \"all\"]\n }\n });\n\n api.addEndpointDescription('__create_index__', {\n methods: ['PUT'],\n patterns: [\n \"{index}\"\n ],\n data_autocomplete_rules: {\n mappings: {\n __scope_link: '_put_mapping'\n },\n settings: {\n __scope_link: '_put_settings'\n },\n aliases: {\n __template: {\n \"NAME\": {}\n }\n }\n }\n });\n\n api.addEndpointDescription('__delete_indices__', {\n methods: ['DELETE'],\n patterns: [\n \"{indices}\"\n ]\n });\n\n api.addEndpointDescription('_get_index_settings', {\n methods: ['GET',],\n patterns: [\n \"{indices}/_settings\",\n ],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_get_index', {\n methods: ['GET',],\n patterns: [\n \"{indices}\",\n \"{indices}/{feature}\"\n ],\n url_components: {\n \"feature\": [\n \"_mappings\",\n \"_warmers\",\n \"_aliases\"\n ]\n }\n });\n\n api.addEndpointDescription('_cache/clear', {\n patterns: [\n \"_cache/clear\",\n \"{indices}/_cache/clear\"\n ]\n });\n\n api.addEndpointDescription('_upgrade', {\n methods: [\"POST\"],\n patterns: [\n \"_upgrade\",\n \"{indices}/_upgrade\"\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_upgrade_status', {\n methods: [\"GET\"],\n patterns: [\n \"_upgrade\",\n \"{indices}/_upgrade\"\n ]\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/mappings.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\n\nvar INDEX_SETTING = {\n __one_of: ['analyzed', 'not_analyzed', 'no']\n},\n BOOLEAN = {\n __one_of: [true, false]\n};\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping\", \"{indices}/_mapping/{types}\", \"{indices}/{types}/_mapping\", \"_mapping\"]\n });\n api.addEndpointDescription('_get_field_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping/field/{fields}\", \"{indices}/_mapping/{type}/field/{fields}\"],\n url_params: {\n \"include_defaults\": \"__flag__\"\n }\n });\n api.addEndpointDescription('_delete_mapping', {\n methods: ['DELETE'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping\", \"{indices}/_mapping/{types}\", \"{indices}/{types}/_mapping\", \"_mapping\"]\n });\n api.addEndpointDescription('_put_type_mapping', {\n methods: ['PUT', 'POST'],\n patterns: [\"{indices}/{type}/_mapping\", \"{indices}/_mapping/{type}\"],\n priority: 10, // collides with put doc by id\n data_autocomplete_rules: {\n __template: {\n properties: {\n 'FIELD': {}\n }\n },\n '_source': {\n 'enabled': BOOLEAN\n },\n '_all': {\n 'enabled': BOOLEAN\n },\n '_field_names': {\n 'index': INDEX_SETTING\n },\n '_routing': {\n 'required': BOOLEAN\n },\n '_index': {\n 'enabled': BOOLEAN\n },\n '_parent': {\n __template: {\n 'type': ''\n },\n 'type': '{type}'\n },\n '_timestamp': {\n 'enabled': BOOLEAN,\n 'format': 'YYYY-MM-dd',\n 'default': \"\"\n },\n 'dynamic_date_formats': ['yyyy-MM-dd'],\n 'date_detection': BOOLEAN,\n 'numeric_detection': BOOLEAN,\n 'transform': {\n __template: {\n script: {}\n },\n __one_of: [{\n __scope_link: \"GLOBAL.script\"\n }, [{\n __scope_link: \"GLOBAL.script\"\n }]]\n\n },\n 'properties': {\n '*': {\n type: {\n __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean', 'binary', 'object', 'nested', \"geo_point\", \"geo_shape\"]\n },\n\n // strings\n store: BOOLEAN,\n index: INDEX_SETTING,\n term_vector: {\n __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']\n },\n boost: 1.0,\n null_value: '',\n omit_norms: {\n __one_of: [true, false]\n },\n index_options: {\n __one_of: ['docs', 'freqs', 'positions']\n },\n analyzer: 'standard',\n search_analyzer: 'standard',\n include_in_all: {\n __one_of: [false, true]\n },\n ignore_above: 10,\n position_increment_gap: 0,\n\n // numeric\n precision_step: 4,\n ignore_malformed: BOOLEAN,\n\n // geo_point\n lat_lon: {\n __one_of: [true, false]\n },\n geohash: {\n __one_of: [true, false]\n },\n geohash_precision: '1m',\n geohash_prefix: {\n __one_of: [true, false]\n },\n validate: {\n __one_of: [true, false]\n },\n validate_lat: {\n __one_of: [true, false]\n },\n validate_lon: {\n __one_of: [true, false]\n },\n normalize: {\n __one_of: [true, false]\n },\n normalize_lat: {\n __one_of: [true, false]\n },\n normalize_lon: {\n __one_of: [true, false]\n },\n\n // geo_shape\n tree: {\n __one_of: ['geohash', 'quadtree']\n },\n precision: '5km',\n tree_levels: 12,\n distance_error_pct: 0.025,\n orientation: 'ccw',\n\n // dates\n format: {\n __one_of: _.flatten([_.map(['date', 'date_time', 'date_time_no_millis', 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis', 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'week_date_time_no_millis'], function (s) {\n return ['basic_' + s, 'strict_' + s];\n }), ['date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction', 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis', 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis', 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis', 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year', 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second']])\n },\n\n fielddata: {\n filter: {\n regex: '',\n frequency: {\n min: 0.001,\n max: 0.1,\n min_segment_size: 500\n }\n }\n },\n similarity: {\n __one_of: ['default', 'BM25']\n },\n\n // objects\n properties: {\n __scope_link: '_put_mapping.{type}.properties'\n },\n\n // multi_field\n fields: {\n '*': {\n __scope_link: '_put_mapping.type.properties.field'\n }\n },\n copy_to: { __one_of: ['{field}', ['{field}']] },\n\n // nested\n include_in_parent: BOOLEAN,\n include_in_root: BOOLEAN\n }\n }\n }\n\n });\n api.addEndpointDescription('_put_mapping', {\n methods: ['PUT'],\n patterns: [\"{indices}/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iBCT09MRUFOXG4gICAgICB9LFxuICAgICAgJ19hbGwnOiB7XG4gICAgICAgICdlbmFibGVkJzogQk9PTEVBTlxuICAgICAgfSxcbiAgICAgICdfZmllbGRfbmFtZXMnOiB7XG4gICAgICAgICdpbmRleCc6IElOREVYX1NFVFRJTkdcbiAgICAgIH0sXG4gICAgICAnX3JvdXRpbmcnOiB7XG4gICAgICAgICdyZXF1aXJlZCc6IEJPT0xFQU4sXG4gICAgICB9LFxuICAgICAgJ19pbmRleCc6IHtcbiAgICAgICAgJ2VuYWJsZWQnOiBCT09MRUFOXG4gICAgICB9LFxuICAgICAgJ19wYXJlbnQnOiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAndHlwZSc6ICcnXG4gICAgICAgIH0sXG4gICAgICAgICd0eXBlJzogJ3t0eXBlfSdcbiAgICAgIH0sXG4gICAgICAnX3RpbWVzdGFtcCc6IHtcbiAgICAgICAgJ2VuYWJsZWQnOiBCT09MRUFOLFxuICAgICAgICAnZm9ybWF0JzogJ1lZWVktTU0tZGQnLFxuICAgICAgICAnZGVmYXVsdCc6IFwiXCJcbiAgICAgIH0sXG4gICAgICAnZHluYW1pY19kYXRlX2Zvcm1hdHMnOiBbJ3l5eXktTU0tZGQnXSxcbiAgICAgICdkYXRlX2RldGVjdGlvbic6IEJPT0xFQU4sXG4gICAgICAnbnVtZXJpY19kZXRlY3Rpb24nOiBCT09MRUFOLFxuICAgICAgJ3RyYW5zZm9ybSc6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIHNjcmlwdDoge31cbiAgICAgICAgfSxcbiAgICAgICAgX19vbmVfb2Y6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBfX3Njb3BlX2xpbms6IFwiR0xPQkFMLnNjcmlwdFwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICBbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIF9fc2NvcGVfbGluazogXCJHTE9CQUwuc2NyaXB0XCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBdXG4gICAgICAgIF1cblxuXG4gICAgICB9LFxuICAgICAgJ3Byb3BlcnRpZXMnOiB7XG4gICAgICAgICcqJzoge1xuICAgICAgICAgIHR5cGU6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbJ3N0cmluZycsICdmbG9hdCcsICdkb3VibGUnLCAnYnl0ZScsICdzaG9ydCcsICdpbnRlZ2VyJywgJ2xvbmcnLCAnZGF0ZScsICdib29sZWFuJyxcbiAgICAgICAgICAgICAgJ2JpbmFyeScsICdvYmplY3QnLCAnbmVzdGVkJywgXCJnZW9fcG9pbnRcIiwgXCJnZW9fc2hhcGVcIlxuICAgICAgICAgICAgXVxuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvLyBzdHJpbmdzXG4gICAgICAgICAgc3RvcmU6IEJPT0xFQU4sXG4gICAgICAgICAgaW5kZXg6IElOREVYX1NFVFRJTkcsXG4gICAgICAgICAgdGVybV92ZWN0b3I6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbJ25vJywgJ3llcycsICd3aXRoX29mZnNldHMnLCAnd2l0aF9wb3NpdGlvbnMnLCAnd2l0aF9wb3NpdGlvbnNfb2Zmc2V0cyddXG4gICAgICAgICAgfSxcbiAgICAgICAgICBib29zdDogMS4wLFxuICAgICAgICAgIG51bGxfdmFsdWU6ICcnLFxuICAgICAgICAgIG9taXRfbm9ybXM6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBpbmRleF9vcHRpb25zOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydkb2NzJywgJ2ZyZXFzJywgJ3Bvc2l0aW9ucyddXG4gICAgICAgICAgfSxcbiAgICAgICAgICBhbmFseXplcjogJ3N0YW5kYXJkJyxcbiAgICAgICAgICBzZWFyY2hfYW5hbHl6ZXI6ICdzdGFuZGFyZCcsXG4gICAgICAgICAgaW5jbHVkZV9pbl9hbGw6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbZmFsc2UsIHRydWVdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBpZ25vcmVfYWJvdmU6IDEwLFxuICAgICAgICAgIHBvc2l0aW9uX2luY3JlbWVudF9nYXA6IDAsXG5cbiAgICAgICAgICAvLyBudW1lcmljXG4gICAgICAgICAgcHJlY2lzaW9uX3N0ZXA6IDQsXG4gICAgICAgICAgaWdub3JlX21hbGZvcm1lZDogQk9PTEVBTixcblxuICAgICAgICAgIC8vIGdlb19wb2ludFxuICAgICAgICAgIGxhdF9sb246IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBnZW9oYXNoOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2VvaGFzaF9wcmVjaXNpb246ICcxbScsXG4gICAgICAgICAgZ2VvaGFzaF9wcmVmaXg6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB2YWxpZGF0ZToge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHZhbGlkYXRlX2xhdDoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHZhbGlkYXRlX2xvbjoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuICAgICAgICAgIG5vcm1hbGl6ZToge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuICAgICAgICAgIG5vcm1hbGl6ZV9sYXQ6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBub3JtYWxpemVfbG9uOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvLyBnZW9fc2hhcGVcbiAgICAgICAgICB0cmVlOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydnZW9oYXNoJywgJ3F1YWR0cmVlJ11cbiAgICAgICAgICB9LFxuICAgICAgICAgIHByZWNpc2lvbjogJzVrbScsXG4gICAgICAgICAgdHJlZV9sZXZlbHM6IDEyLFxuICAgICAgICAgIGRpc3RhbmNlX2Vycm9yX3BjdDogMC4wMjUsXG4gICAgICAgICAgb3JpZW50YXRpb246ICdjY3cnLFxuXG4gICAgICAgICAgLy8gZGF0ZXNcbiAgICAgICAgICBmb3JtYXQ6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBfLmZsYXR0ZW4oW18ubWFwKFsnZGF0ZScsICdkYXRlX3RpbWUnLCAnZGF0ZV90aW1lX25vX21pbGxpcycsXG4gICAgICAgICAgICAgICdvcmRpbmFsX2RhdGUnLCAnb3JkaW5hbF9kYXRlX3RpbWUnLCAnb3JkaW5hbF9kYXRlX3RpbWVfbm9fbWlsbGlzJyxcbiAgICAgICAgICAgICAgJ3RpbWUnLCAndGltZV9ub19taWxsaXMnLCAndF90aW1lJywgJ3RfdGltZV9ub19taWxsaXMnLFxuICAgICAgICAgICAgICAnd2Vla19kYXRlJywgJ3dlZWtfZGF0ZV90aW1lJywgJ3dlZWtfZGF0ZV90aW1lX25vX21pbGxpcyddLCBmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgICByZXR1cm4gWydiYXNpY18nICsgcywgJ3N0cmljdF8nICsgc107XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICdkYXRlJywgJ2RhdGVfaG91cicsICdkYXRlX2hvdXJfbWludXRlJywgJ2RhdGVfaG91cl9taW51dGVfc2Vjb25kJywgJ2RhdGVfaG91cl9taW51dGVfc2Vjb25kX2ZyYWN0aW9uJyxcbiAgICAgICAgICAgICAgICAnZGF0ZV9ob3VyX21pbnV0ZV9zZWNvbmRfbWlsbGlzJywgJ2RhdGVfb3B0aW9uYWxfdGltZScsICdkYXRlX3RpbWUnLCAnZGF0ZV90aW1lX25vX21pbGxpcycsXG4gICAgICAgICAgICAgICAgJ2hvdXInLCAnaG91cl9taW51dGUnLCAnaG91cl9taW51dGVfc2Vjb25kJywgJ2hvdXJfbWludXRlX3NlY29uZF9mcmFjdGlvbicsICdob3VyX21pbnV0ZV9zZWNvbmRfbWlsbGlzJyxcbiAgICAgICAgICAgICAgICAnb3JkaW5hbF9kYXRlJywgJ29yZGluYWxfZGF0ZV90aW1lJywgJ29yZGluYWxfZGF0ZV90aW1lX25vX21pbGxpcycsICd0aW1lJywgJ3RpbWVfbm9fbWlsbGlzJyxcbiAgICAgICAgICAgICAgICAndF90aW1lJywgJ3RfdGltZV9ub19taWxsaXMnLCAnd2Vla19kYXRlJywgJ3dlZWtfZGF0ZV90aW1lJywgJ3dlZWtEYXRlVGltZU5vTWlsbGlzJywgJ3dlZWtfeWVhcicsXG4gICAgICAgICAgICAgICAgJ3dlZWt5ZWFyV2VlaycsICd3ZWVreWVhcldlZWtEYXknLCAneWVhcicsICd5ZWFyX21vbnRoJywgJ3llYXJfbW9udGhfZGF5JywgJ2Vwb2NoX21pbGxpcycsICdlcG9jaF9zZWNvbmQnXG4gICAgICAgICAgICAgIF1dKVxuICAgICAgICAgIH0sXG5cbiAgICAgICAgICBmaWVsZGRhdGE6IHtcbiAgICAgICAgICAgIGZpbHRlcjoge1xuICAgICAgICAgICAgICByZWdleDogJycsXG4gICAgICAgICAgICAgIGZyZXF1ZW5jeToge1xuICAgICAgICAgICAgICAgIG1pbjogMC4wMDEsXG4gICAgICAgICAgICAgICAgbWF4OiAwLjEsXG4gICAgICAgICAgICAgICAgbWluX3NlZ21lbnRfc2l6ZTogNTAwXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHNpbWlsYXJpdHk6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbJ2RlZmF1bHQnLCAnQk0yNSddXG4gICAgICAgICAgfSxcblxuICAgICAgICAgIC8vIG9iamVjdHNcbiAgICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgICBfX3Njb3BlX2xpbms6ICdfcHV0X21hcHBpbmcue3R5cGV9LnByb3BlcnRpZXMnXG4gICAgICAgICAgfSxcblxuICAgICAgICAgIC8vIG11bHRpX2ZpZWxkXG4gICAgICAgICAgZmllbGRzOiB7XG4gICAgICAgICAgICAnKic6IHtcbiAgICAgICAgICAgICAgX19zY29wZV9saW5rOiAnX3B1dF9tYXBwaW5nLnR5cGUucHJvcGVydGllcy5maWVsZCdcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGNvcHlfdG86IHtfX29uZV9vZjogWyd7ZmllbGR9JywgWyd7ZmllbGR9J11dfSxcblxuICAgICAgICAgIC8vIG5lc3RlZFxuICAgICAgICAgIGluY2x1ZGVfaW5fcGFyZW50OiBCT09MRUFOLFxuICAgICAgICAgIGluY2x1ZGVfaW5fcm9vdDogQk9PTEVBTlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3B1dF9tYXBwaW5nJywge1xuICAgIG1ldGhvZHM6IFsnUFVUJ10sXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L19tYXBwaW5nXCJcbiAgICBdLFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICAne3R5cGV9Jzoge1xuICAgICAgICBfX3Njb3BlX2xpbms6ICdfcHV0X3R5cGVfbWFwcGluZydcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/mappings.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,IAAI,aAAa,GAAG;AAClB,UAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,IAAI,CAAC;CAC7C;IAAE,OAAO,GAAG;AACX,UAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;CACxB,CAAC;;AAEF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC5B,UAAU,CACX;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,oBAAoB,EAAE;AAC/C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,mCAAmC,EACnC,0CAA0C,CAC3C;AACD,cAAU,EAAE;AACV,wBAAkB,EAAE,UAAU;KAC/B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC5B,UAAU,CACX;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,mBAAmB,EAAE;AAC9C,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,CACR,2BAA2B,EAC3B,2BAA2B,CAC5B;AACD,YAAQ,EAAE,E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E;AACN,eAAG,EAAE;AACH,0BAAY,EAAE,oCAAoC;aACnD;WACF;AACD,iBAAO,EAAE,EAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,EAAC;;;AAG7C,2BAAiB,EAAE,OAAO;AAC1B,yBAAe,EAAE,OAAO;SACzB;OACF;KACF;;GAEF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,oBAAoB,CACrB;AACD,2BAAuB,EAAE;AACvB,cAAQ,EAAE;AACR,oBAAY,EAAE,mBAAmB;OAClC;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/mappings.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nvar INDEX_SETTING = {\n __one_of: ['analyzed', 'not_analyzed', 'no']\n}, BOOLEAN = {\n __one_of: [true, false]\n};\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping\",\n \"{indices}/_mapping/{types}\",\n \"{indices}/{types}/_mapping\",\n \"_mapping\"\n ]\n });\n api.addEndpointDescription('_get_field_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping/field/{fields}\",\n \"{indices}/_mapping/{type}/field/{fields}\"\n ],\n url_params: {\n \"include_defaults\": \"__flag__\"\n }\n });\n api.addEndpointDescription('_delete_mapping', {\n methods: ['DELETE'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping\",\n \"{indices}/_mapping/{types}\",\n \"{indices}/{types}/_mapping\",\n \"_mapping\"\n ]\n });\n api.addEndpointDescription('_put_type_mapping', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{indices}/{type}/_mapping\",\n \"{indices}/_mapping/{type}\"\n ],\n priority: 10, // collides with put doc by id\n data_autocomplete_rules: {\n __template: {\n properties: {\n 'FIELD': {}\n }\n },\n '_source': {\n 'enabled': BOOLEAN\n },\n '_all': {\n 'enabled': BOOLEAN\n },\n '_field_names': {\n 'index': INDEX_SETTING\n },\n '_routing': {\n 'required': BOOLEAN,\n },\n '_index': {\n 'enabled': BOOLEAN\n },\n '_parent': {\n __template: {\n 'type': ''\n },\n 'type': '{type}'\n },\n '_timestamp': {\n 'enabled': BOOLEAN,\n 'format': 'YYYY-MM-dd',\n 'default': \"\"\n },\n 'dynamic_date_formats': ['yyyy-MM-dd'],\n 'date_detection': BOOLEAN,\n 'numeric_detection': BOOLEAN,\n 'transform': {\n __template: {\n script: {}\n },\n __one_of: [\n {\n __scope_link: \"GLOBAL.script\"\n },\n [\n {\n __scope_link: \"GLOBAL.script\"\n }\n ]\n ]\n\n\n },\n 'properties': {\n '*': {\n type: {\n __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',\n 'binary', 'object', 'nested', \"geo_point\", \"geo_shape\"\n ]\n },\n\n // strings\n store: BOOLEAN,\n index: INDEX_SETTING,\n term_vector: {\n __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']\n },\n boost: 1.0,\n null_value: '',\n omit_norms: {\n __one_of: [true, false]\n },\n index_options: {\n __one_of: ['docs', 'freqs', 'positions']\n },\n analyzer: 'standard',\n search_analyzer: 'standard',\n include_in_all: {\n __one_of: [false, true]\n },\n ignore_above: 10,\n position_increment_gap: 0,\n\n // numeric\n precision_step: 4,\n ignore_malformed: BOOLEAN,\n\n // geo_point\n lat_lon: {\n __one_of: [true, false]\n },\n geohash: {\n __one_of: [true, false]\n },\n geohash_precision: '1m',\n geohash_prefix: {\n __one_of: [true, false]\n },\n validate: {\n __one_of: [true, false]\n },\n validate_lat: {\n __one_of: [true, false]\n },\n validate_lon: {\n __one_of: [true, false]\n },\n normalize: {\n __one_of: [true, false]\n },\n normalize_lat: {\n __one_of: [true, false]\n },\n normalize_lon: {\n __one_of: [true, false]\n },\n\n // geo_shape\n tree: {\n __one_of: ['geohash', 'quadtree']\n },\n precision: '5km',\n tree_levels: 12,\n distance_error_pct: 0.025,\n orientation: 'ccw',\n\n // dates\n format: {\n __one_of: _.flatten([_.map(['date', 'date_time', 'date_time_no_millis',\n 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis',\n 'time', 'time_no_millis', 't_time', 't_time_no_millis',\n 'week_date', 'week_date_time', 'week_date_time_no_millis'], function (s) {\n return ['basic_' + s, 'strict_' + s];\n }),\n [\n 'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction',\n 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis',\n 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis',\n 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis',\n 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year',\n 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second'\n ]])\n },\n\n fielddata: {\n filter: {\n regex: '',\n frequency: {\n min: 0.001,\n max: 0.1,\n min_segment_size: 500\n }\n }\n },\n similarity: {\n __one_of: ['default', 'BM25']\n },\n\n // objects\n properties: {\n __scope_link: '_put_mapping.{type}.properties'\n },\n\n // multi_field\n fields: {\n '*': {\n __scope_link: '_put_mapping.type.properties.field'\n }\n },\n copy_to: {__one_of: ['{field}', ['{field}']]},\n\n // nested\n include_in_parent: BOOLEAN,\n include_in_root: BOOLEAN\n }\n }\n }\n\n });\n api.addEndpointDescription('_put_mapping', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_mapping\"\n ],\n data_autocomplete_rules: {\n '{type}': {\n __scope_link: '_put_type_mapping'\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/percolator.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_put_percolator', {\n priority: 10, // to override doc\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/.percolator/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n },\n data_autocomplete_rules: {\n query: {}\n }\n });\n api.addEndpointDescription('_percolate', {\n methods: ['GET', 'POST'],\n priority: 10, // to override doc\n patterns: [\"{indices}/{type}/_percolate\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {},\n size: 10,\n track_scores: { __one_of: [true, false] },\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_id', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/{type}/{id}/_percolate\"],\n url_params: {\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"],\n percolate_index: \"{index}\",\n percolate_type: \"{type}\",\n percolate_routing: \"\",\n percolate_preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n version: 1,\n version_type: [\"external\", \"internal\"]\n },\n data_autocomplete_rules: {\n query: {},\n filter: {},\n size: 10,\n track_scores: { __one_of: [true, false] },\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_count', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/{type}/_percolate/count\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {}\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL3BlcmNvbGF0b3IuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxpQkFBaUIsRUFBRTtBQUM1QyxZQUFRLEVBQUUsRUFBRTtBQUNaLFdBQU8sRUFBRSxDQUFDLEtBQUssRUFBRSxNQUFNLENBQUM7QUFDeEIsWUFBUSxFQUFFLENBQ1IsMEJBQTBCLENBQzNCO0FBQ0QsY0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ZXJzaW9uX3R5cGU6IFtcImV4dGVybmFsXCIsIFwiaW50ZXJuYWxcIl1cbiAgICB9LFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBxdWVyeToge30sXG4gICAgICBmaWx0ZXI6IHt9LFxuICAgICAgc2l6ZTogMTAsXG4gICAgICB0cmFja19zY29yZXM6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX0sXG4gICAgICBzb3J0OiBcIl9zY29yZVwiLFxuICAgICAgYWdnczoge30sXG4gICAgICBoaWdobGlnaHQ6IHt9XG4gICAgfVxuICB9KTtcbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19wZXJjb2xhdGVfY291bnQnLCB7XG4gICAgbWV0aG9kczogWydHRVQnLCAnUE9TVCddLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS97dHlwZX0vX3BlcmNvbGF0ZS9jb3VudFwiXG4gICAgXSxcbiAgICB1cmxfcGFyYW1zOiB7XG4gICAgICBwcmVmZXJlbmNlOiBbXCJfcHJpbWFyeVwiLCBcIl9wcmltYXJ5X2ZpcnN0XCIsIFwiX2xvY2FsXCIsIFwiX29ubHlfbm9kZTp4eXpcIiwgXCJfcHJlZmVyX25vZGU6eHl6XCIsIFwiX3NoYXJkczoyLDNcIl0sXG4gICAgICByb3V0aW5nOiBcIlwiLFxuICAgICAgaWdub3JlX3VuYXZhaWxhYmxlOiBbXCJ0cnVlXCIsIFwiZmFsc2VcIl0sXG4gICAgICBwZXJjb2xhdGVfZm9ybWF0OiBbXCJpZHNcIl1cbiAgICB9LFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBkb2M6IHt9LFxuICAgICAgcXVlcnk6IHt9LFxuICAgICAgZmlsdGVyOiB7fVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPl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AAC,KAAK,CAAC;KAC1B;AACD,2BAAuB,EAAE;AACvB,SAAG,EAAE,EAAE;AACP,WAAK,EAAE,EAAE;AACT,YAAM,EAAE,EAAE;KACX;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/percolator.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_put_percolator', {\n priority: 10, // to override doc\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/.percolator/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n },\n data_autocomplete_rules: {\n query: {}\n }\n });\n api.addEndpointDescription('_percolate', {\n methods: ['GET', 'POST'],\n priority: 10, // to override doc\n patterns: [\n \"{indices}/{type}/_percolate\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {},\n size: 10,\n track_scores: {__one_of: [true, false]},\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_id', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/{type}/{id}/_percolate\"\n ],\n url_params: {\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"],\n percolate_index: \"{index}\",\n percolate_type: \"{type}\",\n percolate_routing: \"\",\n percolate_preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n version: 1,\n version_type: [\"external\", \"internal\"]\n },\n data_autocomplete_rules: {\n query: {},\n filter: {},\n size: 10,\n track_scores: {__one_of: [true, false]},\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_count', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/{type}/_percolate/count\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/query.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\n\nvar SPAN_QUERIES = {\n // TODO add one_of for objects\n span_first: {\n __scope_link: '.span_first'\n },\n span_near: {\n __scope_link: '.span_near'\n },\n span_or: {\n __scope_link: '.span_or'\n },\n span_not: {\n __scope_link: '.span_not'\n },\n span_term: {\n __scope_link: '.span_term'\n },\n span_containing: {\n __scope_link: '.span_containing'\n },\n span_within: {\n __scope_link: '.span_within'\n }\n};\n\nvar DECAY_FUNC_DESC = {\n __template: {\n \"FIELD\": {\n \"origin\": \"\",\n \"scale\": \"\"\n }\n },\n \"{field}\": {\n \"origin\": \"\",\n \"scale\": \"\",\n \"offset\": \"\",\n \"decay\": 0.5\n }\n},\n SCORING_FUNCS = {\n \"script_score\": {\n __template: {\n \"script\": \"_score * doc['f'].value\"\n },\n \"script\": {\n //populated by a global rule\n }\n },\n \"boost_factor\": 2.0,\n \"random_score\": {\n \"seed\": 314159265359\n },\n \"linear\": DECAY_FUNC_DESC,\n \"exp\": DECAY_FUNC_DESC,\n \"gauss\": DECAY_FUNC_DESC,\n \"field_value_factor\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"factor\": 1.2,\n \"modifier\": {\n __one_of: [\"none\", \"log\", \"log1p\", \"log2p\", \"ln\", \"ln1p\", \"ln2p\", \"square\", \"sqrt\", \"reciprocal\"]\n }\n }\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('query', {\n match: {\n __template: {\n 'FIELD': 'TEXT'\n },\n '{field}': {\n 'query': '',\n 'operator': {\n __one_of: ['and', 'or']\n },\n 'type': {\n __one_of: ['phrase', 'phrase_prefix', 'boolean']\n },\n 'max_expansions': 10,\n 'analyzer': '',\n 'fuzziness': 1.0,\n 'prefix_length': 1\n }\n },\n match_phrase: {\n __template: {\n 'FIELD': 'PHRASE'\n },\n '{field}': {\n query: '',\n analyzer: ''\n }\n },\n match_phrase_prefix: {\n __template: {\n 'FIELD': 'PREFIX'\n },\n '{field}': {\n query: '',\n analyzer: '',\n max_expansions: 10,\n prefix_length: 1,\n fuzziness: 0.1\n }\n },\n multi_match: {\n __template: {\n 'query': '',\n 'fields': []\n },\n query: '',\n fields: ['{field}'],\n use_dis_max: {\n __template: true,\n __one_of: [true, false]\n },\n tie_breaker: 0.0,\n type: { __one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix'] }\n },\n bool: {\n must: [{\n __scope_link: '.'\n }],\n must_not: [{\n __scope_link: '.'\n }],\n should: [{\n __scope_link: '.'\n }],\n filter: {\n __scope_link: 'GLOBAL.filter'\n },\n minimum_number_should_match: 1,\n boost: 1.0\n },\n boosting: {\n positive: {\n __scope_link: '.'\n },\n negative: {\n __scope_link: '.'\n },\n negative_boost: 0.2\n },\n ids: {\n type: '',\n values: []\n },\n constant_score: {\n __template: {\n filter: {},\n boost: 1.2\n },\n query: {},\n filter: {},\n boost: 1.2\n },\n dis_max: {\n __template: {\n tie_breaker: 0.7,\n boost: 1.2,\n queries: []\n },\n tie_breaker: 0.7,\n boost: 1.2,\n queries: [{\n __scope_link: '.'\n }]\n },\n field: {\n '{field}': {\n query: '',\n boost: 2.0,\n enable_position_increments: {\n __template: false,\n __one_of: [true, false]\n }\n }\n },\n filtered: {\n __template: {\n query: {},\n filter: {}\n },\n query: {},\n filter: {}\n },\n fuzzy: {\n '{field}': {\n 'value': '',\n 'boost': 1.0,\n 'min_similarity': 0.5,\n 'prefix_length': 0\n }\n },\n has_child: {\n __template: {\n type: 'TYPE',\n query: {}\n },\n 'type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'max', 'sum', 'avg']\n },\n '_scope': '',\n 'query': {},\n 'min_children': 1,\n 'max_children': 10\n },\n has_parent: {\n __template: {\n parent_type: 'TYPE',\n query: {}\n },\n 'parent_type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'score']\n },\n '_scope': '',\n 'query': {}\n },\n match_all: {},\n more_like_this: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n fields: ['{field}'],\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: '',\n docs: [{\n _index: \"{index}\",\n _type: \"{type}\",\n _id: \"\"\n }],\n ids: [\"\"]\n },\n mlt: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n __scope_link: \".more_like_this\"\n },\n prefix: {\n __template: {\n 'FIELD': {\n 'value': ''\n }\n },\n '{field}': {\n value: '',\n boost: 1.0\n }\n },\n query_string: {\n __template: {\n 'default_field': 'FIELD',\n 'query': 'this AND that OR thus'\n },\n query: '',\n default_field: '{field}',\n fields: ['{field}'],\n default_operator: {\n __one_of: ['OR', 'AND']\n },\n analyzer: '',\n allow_leading_wildcard: {\n __one_of: [true, false]\n },\n lowercase_expanded_terms: {\n __one_of: [true, false]\n },\n enable_position_increments: {\n __one_of: [true, false]\n },\n fuzzy_max_expansions: 50,\n fuzzy_min_sim: 0.5,\n fuzzy_prefix_length: 0,\n phrase_slop: 0,\n boost: 1.0,\n analyze_wildcard: {\n __one_of: [false, true]\n },\n auto_generate_phrase_queries: {\n __one_of: [false, true]\n },\n minimum_should_match: '20%',\n lenient: {\n __one_of: [false, true]\n },\n use_dis_max: {\n __one_of: [true, false]\n },\n tie_breaker: 0,\n time_zone: \"+1:00\"\n },\n simple_query_string: {\n __template: {\n query: \"\",\n fields: []\n },\n query: \"\",\n fields: [\"{field}\"],\n default_operator: { __one_of: [\"OR\", \"AND\"] },\n analyzer: \"\",\n flags: \"OR|AND|PREFIX\",\n lowercase_expanded_terms: { __one_of: [true, false] },\n locale: \"ROOT\",\n lenient: { __one_of: [true, false] }\n },\n range: {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n '{field}': {\n __template: {\n gte: 10,\n lte: 20\n },\n gte: 10,\n gt: 10,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n boost: 1.0,\n \"format\": \"dd/MM/yyyy||yyyy\"\n\n }\n },\n span_first: {\n __template: {\n 'match': {\n 'span_term': {\n 'FIELD': 'VALUE'\n }\n },\n 'end': 3\n },\n match: SPAN_QUERIES\n },\n span_near: {\n __template: {\n 'clauses': [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }],\n slop: 12,\n in_order: false\n },\n clauses: [SPAN_QUERIES],\n slop: 12,\n in_order: {\n __one_of: [false, true]\n },\n collect_payloads: {\n __one_of: [false, true]\n }\n },\n span_term: {\n __template: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n span_not: {\n __template: {\n include: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n exclude: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n },\n include: SPAN_QUERIES,\n exclude: SPAN_QUERIES\n },\n span_or: {\n __template: {\n clauses: [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }]\n },\n clauses: [SPAN_QUERIES]\n },\n span_containing: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }, {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n span_within: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }, {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n term: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n terms: {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n '{field}': [''],\n minimum_match: 1\n },\n wildcard: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n nested: {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n path: '',\n query: {},\n filter: {},\n score_mode: {\n __one_of: ['avg', 'total', 'max', 'none']\n }\n },\n custom_filters_score: {\n __template: {\n query: {},\n filters: [{\n filter: {}\n }]\n },\n query: {},\n filters: [{\n filter: {},\n boost: 2.0,\n script: {\n //populated by a global rule\n }\n }],\n score_mode: {\n __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply']\n },\n max_boost: 2.0,\n params: {},\n lang: ''\n },\n indices: {\n __template: {\n indices: ['INDEX1', 'INDEX2'],\n query: {}\n },\n indices: ['{index}'],\n query: {},\n no_match_query: {\n __scope_link: '.'\n }\n },\n geo_shape: {\n __template: {\n location: {},\n relation: 'within'\n },\n __scope_link: '.filter.geo_shape'\n },\n // js hint gets confused here\n /* jshint -W015 */\n function_score: _.defaults({\n __template: {\n query: {},\n functions: [{}]\n },\n query: {},\n filter: {},\n functions: [_.defaults({\n filter: {},\n weight: 1.0\n }, SCORING_FUNCS)],\n boost: 1.0,\n boost_mode: { __one_of: [\"multiply\", \"replace\", \"sum\", \"avg\", \"max\", \"min\"] },\n score_mode: { __one_of: [\"multiply\", \"sum\", \"first\", \"avg\", \"max\", \"min\"] },\n max_boost: 10,\n min_score: 1.0\n }, SCORING_FUNCS)\n\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL3F1ZXJ5LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxDQUFDLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDOztBQUUxQixJQUFJLFlBQVksR0FBRzs7QUFFak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gICBtYXRjaDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnRklFTEQnOiAnVEVYVCdcbiAgICAgIH0sXG4gICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgJ3F1ZXJ5JzogJycsXG4gICAgICAgICdvcGVyYXRvcic6IHtcbiAgICAgICAgICBfX29uZV9vZjogWydhbmQnLCAnb3InXVxuICAgICAgICB9LFxuICAgICAgICAndHlwZSc6IHtcbiAgICAgICAgICBfX29uZV9vZjogWydwaHJhc2UnLCAncGhyYXNlX3ByZWZpeCcsICdib29sZWFuJ11cbiAgICAgICAgfSxcbiAgICAgICAgJ21heF9leHBhbnNpb25zJzogMTAsXG4gICAgICAgICdhbmFseXplcic6ICcnLFxuICAgICAgICAnZnV6emluZXNzJzogMS4wLFxuICAgICAgICAncHJlZml4X2xlbmd0aCc6IDFcbiAgICAgIH1cbiAgICB9LFxuICAgIG1hdGNoX3BocmFzZToge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnRklFTEQnOiAnUEhSQVNFJ1xuICAgICAgfSxcbiAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICBxdWVyeTogJycsXG4gICAgICAgIGFuYWx5emVyOiAnJ1xuICAgICAgfVxuICAgIH0sXG4gICAgbWF0Y2hfcGhyYXNlX3ByZWZpeDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnRklFTEQnOiAnUFJFRklYJ1xuICAgICAgfSxcbiAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICBxdWVyeTogJycsXG4gICAgICAgIGFuYWx5emVyOiAnJyxcbiAgICAgICAgbWF4X2V4cGFuc2lvbnM6IDEwLFxuICAgICAgICBwcmVmaXhfbGVuZ3RoOiAxLFxuICAgICAgICBmdXp6aW5lc3M6IDAuMVxuICAgICAgfVxuICAgIH0sXG4gICAgbXVsdGlfbWF0Y2g6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ3F1ZXJ5JzogJycsXG4gICAgICAgICdmaWVsZHMnOiBbXVxuICAgICAgfSxcbiAgICAgIHF1ZXJ5OiAnJyxcbiAgICAgIGZpZWxkczogWyd7ZmllbGR9J10sXG4gICAgICB1c2VfZGlzX21heDoge1xuICAgICAgICBfX3RlbXBsYXRlOiB0cnVlLFxuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgIHRpZV9icmVha2VyOiAwLjAsXG4gICAgICB0eXBlOiB7X19vbmVfb2Y6IFsnYmVzdF9maWVsZHMnLCAnbW9zdF9maWVsZHMnLCAnY3Jvc3NfZmllbGRzJywgJ3BocmFzZScsICdwaHJhc2VfcHJlZml4J119XG4gICAgfSxcbiAgICBib29sOiB7XG4gICAgICBtdXN0OiBbXG4gICAgICAgIHtcbiAgICAgICAgICBfX3Njb3BlX2xpbms6ICcuJ1xuICAgICAgICB9XG4gICAgICBdLFxuICAgICAgbXVzdF9ub3Q6IFtcbiAgICAgICAge1xuICAgICAgICAgIF9fc2NvcGVfbGluazogJy4nXG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBzaG91bGQ6IFtcbiAgICAgICAge1xuICAgICAgICAgIF9fc2NvcGVfbGluazogJy4nXG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBmaWx0ZXI6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnR0xPQkFMLmZpbHRlcidcbiAgICAgIH0sXG4gICAgICBtaW5pbXVtX251bWJlcl9zaG91bGRfbWF0Y2g6IDEsXG4gICAgICBib29zdDogMS4wXG4gICAgfSxcbiAgICBib29zdGluZzoge1xuICAgICAgcG9zaXRpdmU6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnLidcbiAgICAgIH0sXG4gICAgICBuZWdhdGl2ZToge1xuICAgICAgICBfX3Njb3BlX2xpbms6ICcuJ1xuICAgICAgfSxcbiAgICAgIG5lZ2F0aXZlX2Jvb3N0OiAwLjJcbiAgICB9LFxuICAgIGlkczoge1xuICAgICAgdHlwZTogJycsXG4gICAgICB2YWx1ZXM6IFtdXG4gICAgfSxcbiAgICBjb25zdGFudF9zY29yZToge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBmaWx0ZXI6IHt9LFxuICAgICAgICBib29zdDogMS4yXG4gICAgICB9LFxuICAgICAgcXVlcnk6IHt9LFxuICAgICAgZmlsdGVyOiB7fSxcbiAgICAgIGJvb3N0OiAxLjJcbiAgICB9LFxuICAgIGRpc19tYXg6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgdGllX2JyZWFrZXI6IDAuNyxcbiAgICAgICAgYm9vc3Q6IDEuMixcbiAgICAgICAgcXVlcmllczogW11cbiAgICAgIH0sXG4gICAgICB0aWVfYnJlYWtlcjogMC43LFxuICAgICAgYm9vc3Q6IDEuMixcbiAgICAgIHF1ZXJpZXM6IFtcbiAgICAgICAge1xuICAgICAgICAgIF9fc2NvcGVfbGluazogJy4nXG4gICAgICAgIH1cbiAgICAgIF1cbiAgICB9LFxuICAgIGZpZWxkOiB7XG4gICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgcXVlcnk6ICcnLFxuICAgICAgICBib29zdDogMi4wLFxuICAgICAgICBlbmFibGVfcG9zaXRpb25faW5jcmVtZW50czoge1xuICAgICAgICAgIF9fdGVtcGxhdGU6IGZhbHNlLFxuICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIGZpbHRlcmVkOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgICAgZmlsdGVyOiB7fVxuICAgICAgfSxcbiAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgIGZpbHRlcjoge31cbiAgICB9LFxuICAgIGZ1enp5OiB7XG4gICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgJ3ZhbHVlJzogJycsXG4gICAgICAgICdib29zdCc6IDEuMCxcbiAgICAgICAgJ21pbl9zaW1pbGFyaXR5JzogMC41LFxuICAgICAgICAncHJlZml4X2xlbmd0aCc6IDBcbiAgICAgIH1cbiAgICB9LFxuICAgIGhhc19jaGlsZDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICB0eXBlOiAnVFlQRScsXG4gICAgICAgIHF1ZXJ5OiB7fVxuICAgICAgfSxcbiAgICAgICd0eXBlJzogJ3t0eXBlfScsXG4gICAgICAnc2NvcmVfbW9kZSc6IHtcbiAgICAgICAgX19vbmVfb2Y6IFsnbm9uZScsICdtYXgnLCAnc3VtJywgJ2F2ZyddXG4gICAgICB9LFxuICAgICAgJ19zY29wZSc6ICcnLFxuICAgICAgJ3F1ZXJ5Jzoge30sXG4gICAgICAnbWluX2NoaWxkcmVuJzogMSxcbiAgICAgICdtYXhfY2hpbGRyZW4nOiAxMFxuICAgIH0sXG4gICAgaGFzX3BhcmVudDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBwYXJlbnRfdHlwZTogJ1RZUEUnLFxuICAgICAgICBxdWVyeToge31cbiAgICAgIH0sXG4gICAgICAncGFyZW50X3R5cGUnOiAne3R5cGV9JyxcbiAgICAgICdzY29yZV9tb2RlJzoge1xuICAgICAgICBfX29uZV9vZjogWydub25lJywgJ3Njb3JlJ11cbiAgICAgIH0sXG4gICAgICAnX3Njb3BlJzogJycsXG4gICAgICAncXVlcnknOiB7fVxuICAgIH0sXG4gICAgbWF0Y2hfYWxsOiB7fSxcbiAgICBtb3JlX2xpa2VfdGhpczoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnZmllbGRzJzogWydGSUVMRCddLFxuICAgICAgICAnbGlrZV90ZXh0JzogJ3RleHQgbGlrZSB0aGlzIG9uZScsXG4gICAgICAgICdtaW5fdGVybV9mcmVxJzogMSxcbiAgICAgICAgJ21heF9xdWVyeV90ZXJtcyc6IDEyXG4gICAgICB9LFxuICAgICAgZmllbGRzOiBbJ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11bV9zaG91bGRfbWF0Y2g6ICcyMCUnLFxuICAgICAgbGVuaWVudDoge1xuICAgICAgICBfX29uZV9vZjogW2ZhbHNlLCB0cnVlXVxuICAgICAgfSxcbiAgICAgIHVzZV9kaXNfbWF4OiB7XG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgdGllX2JyZWFrZXI6IDAsXG4gICAgICB0aW1lX3pvbmU6IFwiKzE6MDBcIlxuICAgIH0sXG4gICAgc2ltcGxlX3F1ZXJ5X3N0cmluZzoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBxdWVyeTogXCJcIixcbiAgICAgICAgZmllbGRzOiBbXVxuICAgICAgfSxcbiAgICAgIHF1ZXJ5OiBcIlwiLFxuICAgICAgZmllbGRzOiBbXCJ7ZmllbGR9XCJdLFxuICAgICAgZGVmYXVsdF9vcGVyYXRvcjoge19fb25lX29mOiBbXCJPUlwiLCBcIkFORFwiXX0sXG4gICAgICBhbmFseXplcjogXCJcIixcbiAgICAgIGZsYWdzOiBcIk9SfEFORHxQUkVGSVhcIixcbiAgICAgIGxvd2VyY2FzZV9leHBhbmRlZF90ZXJtczoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfSxcbiAgICAgIGxvY2FsZTogXCJST09UXCIsXG4gICAgICBsZW5pZW50OiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19XG4gICAgfSxcbiAgICByYW5nZToge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgZ3RlOiAxMCxcbiAgICAgICAgICBsdGU6IDIwXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIGd0ZTogMTAsXG4gICAgICAgICAgbHRlOiAyMFxuICAgICAgICB9LFxuICAgICAgICBndGU6IDEwLFxuICAgICAgICBndDogMTAsXG4gICAgICAgIGx0ZTogMjAsXG4gICAgICAgIGx0OiAyMCxcbiAgICAgICAgdGltZV96b25lOiBcIisxOjAwXCIsXG4gICAgICAgIGJvb3N0OiAxLjAsXG4gICAgICAgIFwiZm9ybWF0XCI6IFwiZGQvTU0veXl5eXx8eXl5eVwiXG5cbiAgICAgIH1cbiAgICB9LFxuICAgIHNwYW5fZmlyc3Q6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ21hdGNoJzoge1xuICAgICAgICAgICdzcGFuX3Rlcm0nOiB7XG4gICAgICAgICAgICAnRklFTEQnOiAnVkFMVUUnXG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICAnZW5kJzogM1xuICAgICAgfSxcbiAgICAgIG1hdGNoOiBTUEFOX1FVRVJJRVNcbiAgICB9LFxuICAgIHNwYW5fbmVhcjoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnY2xhdXNlcyc6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgXSxcbiAgICAgICAgc2xvcDogMTIsXG4gICAgICAgIGluX29yZGVyOiBmYWxzZVxuICAgICAgfSxcbiAgICAgIGNsYXVzZXM6IFtcbiAgICAgICAgU1BBTl9RVUVSSUVTXG4gICAgICBdLFxuICAgICAgc2xvcDogMTIsXG4gICAgICBpbl9vcmRlcjoge1xuICAgICAgICBfX29uZV9vZjogW2ZhbHNlLCB0cnVlXVxuICAgICAgfSxcbiAgICAgIGNvbGxlY3RfcGF5bG9hZHM6IHtcbiAgICAgICAgX19vbmVfb2Y6IFtmYWxzZSwgdHJ1ZV1cbiAgICAgIH1cbiAgICB9LFxuICAgIHNwYW5fdGVybToge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ3tmaWVsZH0nOiB7XG4gICAgICAgIHZhbHVlOiAnJyxcbiAgICAgICAgYm9vc3Q6IDIuMFxuICAgICAgfVxuICAgIH0sXG4gICAgc3Bhbl9ub3Q6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgaW5jbHVkZToge1xuICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBleGNsdWRlOiB7XG4gICAgICAgICAgc3Bhbl90ZXJtOiB7XG4gICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBpbmNsdWRlOiBTUEFOX1FVRVJJRVMsXG4gICAgICBleGNsdWRlOiBTUEFOX1FVRVJJRVNcbiAgICB9LFxuICAgIHNwYW5fb3I6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgY2xhdXNlczogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgY2xhdXNlczogW1xuICAgICAgICBTUEFOX1FVRVJJRVNcbiAgICAgIF1cbiAgICB9LFxuICAgIHNwYW5fY29udGFpbmluZzoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBsaXR0bGU6IHtcbiAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgYmlnOiB7XG4gICAgICAgICAgc3Bhbl9uZWFyOiB7XG4gICAgICAgICAgICAnY2xhdXNlcyc6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc3Bhbl90ZXJtOiB7XG4gICAgICAgICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcInNsb3BcIjogNSxcbiAgICAgICAgICAgIFwiaW5fb3JkZXJcIjogZmFsc2VcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBsaXR0bGU6IFNQQU5fUVVFUklFUyxcbiAgICAgIGJpZzogU1BBTl9RVUVSSUVTXG4gICAgfSxcbiAgICBzcGFuX3dpdGhpbjoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBsaXR0bGU6IHtcbiAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgYmlnOiB7XG4gICAgICAgICAgc3Bhbl9uZWFyOiB7XG4gICAgICAgICAgICAnY2xhdXNlcyc6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc3Bhbl90ZXJtOiB7XG4gICAgICAgICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcInNsb3BcIjogNSxcbiAgICAgICAgICAgIFwiaW5fb3JkZXJcIjogZmFsc2VcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBsaXR0bGU6IFNQQU5fUVVFUklFUyxcbiAgICAgIGJpZzogU1BBTl9RVUVSSUVTXG4gICAgfSxcbiAgICB0ZXJtOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICB2YWx1ZTogJ1ZBTFVFJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ3tmaWVsZH0nOiB7XG4gICAgICAgIHZhbHVlOiAnJyxcbiAgICAgICAgYm9vc3Q6IDIuMFxuICAgICAgfVxuICAgIH0sXG4gICAgdGVybXM6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ0ZJRUxEJzogWydWQUxVRTEnLCAnVkFMVUUyJ11cbiAgICAgIH0sXG4gICAgICAne2ZpZWxkfSc6IFsnJ10sXG4gICAgICBtaW5pbXVtX21hdGNoOiAxXG4gICAgfSxcbiAgICB3aWxkY2FyZDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgdmFsdWU6ICdWQUxVRSdcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICB2YWx1ZTogJycsXG4gICAgICAgIGJvb3N0OiAyLjBcbiAgICAgIH1cbiAgICB9LFxuICAgIG5lc3RlZDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBwYXRoOiAncGF0aF90b19uZXN0ZWRfZG9jJyxcbiAgICAgICAgcXVlcnk6IHt9XG4gICAgICB9LFxuICAgICAgcGF0aDogJycsXG4gICAgICBxdWVyeToge30sXG4gICAgICBmaWx0ZXI6IHt9LFxuICAgICAgc2NvcmVfbW9kZToge1xuICAgICAgICBfX29uZV9vZjogWydhdmcnLCAndG90YWwnLCAnbWF4JywgJ25vbmUnXVxuICAgICAgfVxuICAgIH0sXG4gICAgY3VzdG9tX2ZpbHRlcnNfc2NvcmU6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgcXVlcnk6IHt9LFxuICAgICAgICBmaWx0ZXJzOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmlsdGVyOiB7fVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgIGZpbHRlcnM6IFtcbiAgICAgICAge1xuICAgICAgICAgIGZpbHRlcjoge30sXG4gICAgICAgICAgYm9vc3Q6IDIuMCxcbiAgICAgICAgICBzY3JpcHQ6IHtcbiAgICAgICAgICAgIC8vcG9wdWxhdGVkIGJ5IGEgZ2xvYmFsIHJ1bGVcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBzY29yZV9tb2RlOiB7XG4gICAgICAgIF9fb25lX29mOiBbJ2ZpcnN0JywgJ21pbicsICdtYXgnLCAndG90YWwnLCAnYXZnJywgJ211bHRpcGx5J11cbiAgICAgIH0sXG4gICAgICBtYXhfYm9vc3Q6IDIuMCxcbiAgICAgIHBhcmFtczoge30sXG4gICAgICBsYW5nOiAnJ1xuICAgIH0sXG4gICAgaW5kaWNlczoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBpbmRpY2VzOiBbJ0lOREVYMScsICdJTkRFWDInXSxcbiAgICAgICAgcXVlcnk6IHt9XG4gICAgICB9LFxuICAgICAgaW5kaWNlczogWyd7aW5kZXh9J10sXG4gICAgICBxdWVyeToge30sXG4gICAgICBub19tYXRjaF9xdWVyeToge1xuICAgICAgICBfX3Njb3BlX2xpbms6ICcuJ1xuICAgICAgfVxuICAgIH0sXG4gICAgZ2VvX3NoYXBlOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIGxvY2F0aW9uOiB7fSxcbiAgICAgICAgcmVsYXRpb246ICd3aXRoaW4nXG4gICAgICB9LFxuICAgICAgX19zY29wZV9saW5rOiAnLmZpbHRlci5nZW9fc2hhcGUnXG4gICAgfSxcbiAgICAvLyBqcyBoaW50IGdldHMgY29uZnVzZWQgaGVyZVxuICAgIC8qIGpzaGludCAtVzAxNSAqL1xuICAgIGZ1bmN0aW9uX3Njb3JlOiBfLmRlZmF1bHRzKHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgICAgICBmdW5jdGlvbnM6IFtcbiAgICAgICAgICAgIHt9XG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBxdWVyeToge30sXG4gICAgICAgIGZpbHRlcjoge30sXG4gICAgICAgIGZ1bmN0aW9uczogW1xuICAgICAgICAgIF8uZGVmYXVsdHMoXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGZpbHRlcjoge30sXG4gICAgICAgICAgICAgIHdlaWdodDogMS4wXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgU0NPUklOR19GVU5DU1xuICAgICAgICAgIClcbiAgICAgICAgXSxcbiAgICAgICAgYm9vc3Q6IDEuMCxcbiAgICAgICAgYm9vc3RfbW9kZToge19fb25lX29mOiBbXCJtdWx0aXBseVwiLCBcInJlcGxhY2VcIiwgXCJzdW1cIiwgXCJhdmdcIiwgXCJtYXhcIiwgXCJtaW5cIl19LFxuICAgICAgICBzY29yZV9tb2RlOiB7X19vbmVfb2Y6IFtcIm11bHRpcGx5XCIsIFwic3VtXCIsIFwiZmlyc3RcIiwgXCJhdmdcIiwgXCJtYXhcIiwgXCJtaW5cIl19LFxuICAgICAgICBtYXhfYm9vc3Q6IDEwLFxuICAgICAgICBtaW5fc2NvcmU6IDEuMFxuICAgICAgfSxcbiAgICAgIFNDT1JJTkdfRlVOQ1NcbiAgICApXG5cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/query.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,IAAI,YAAY,GAAG;;AAEjB,YAAU,EAAE;AACV,gBAAY,EAAE,aAAa;GAC5B;AACD,WAAS,EAAE;AACT,gBAAY,EAAE,YAAY;GAC3B;AACD,SAAO,EAAE;AACP,gBAAY,EAAE,UAAU;GACzB;AACD,UAAQ,EAAE;AACR,gBAAY,EAAE,WAAW;GAC1B;AACD,WAAS,EAAE;AACT,gBAAY,EAAE,YAAY;GAC3B;AACD,iBAAe,EAAE;AACf,gBAAY,EAAE,kBAAkB;GACjC;AACD,aAAW,EAAE;AACX,gBAAY,EAAE,cAAc;GAC7B;CACF,CAAC;;AAEF,IAAI,eAAe,GAAG;AAClB,YAAU,EAAE;AACV,WAAO,EAAE;AACP,cAAQ,EAAE,EAAE;AACZ,aAAO,EAAE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E,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC;OAC9D;AACD,eAAS,EAAE,GAAG;AACd,YAAM,EAAE,EAAE;AACV,UAAI,EAAE,EAAE;KACT;AACD,WAAO,EAAE;AACP,gBAAU,EAAE;AACV,eAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC7B,aAAK,EAAE,EAAE;OACV;AACD,aAAO,EAAE,CAAC,SAAS,CAAC;AACpB,WAAK,EAAE,EAAE;AACT,oBAAc,EAAE;AACd,oBAAY,EAAE,GAAG;OAClB;KACF;AACD,aAAS,EAAE;AACT,gBAAU,EAAE;AACV,gBAAQ,EAAE,EAAE;AACZ,gBAAQ,EAAE,QAAQ;OACnB;AACD,kBAAY,EAAE,mBAAmB;KAClC;;;AAGD,kBAAc,EAAE,CAAC,CAAC,QAAQ,CAAC;AACvB,gBAAU,EAAE;AACV,aAAK,EAAE,EAAE;AACT,iBAAS,EAAE,CACT,EAAE,CACH;OACF;AACD,WAAK,EAAE,EAAE;AACT,YAAM,EAAE,EAAE;AACV,eAAS,EAAE,CACT,CAAC,CAAC,QAAQ,CACR;AACE,cAAM,EAAE,EAAE;AACV,cAAM,EAAE,GAAG;OACZ,EACD,aAAa,CACd,CACF;AACD,WAAK,EAAE,GAAG;AACV,gBAAU,EAAE,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAC;AAC3E,gBAAU,EAAE,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAC;AACzE,eAAS,EAAE,EAAE;AACb,eAAS,EAAE,GAAG;KACf,EACD,aAAa,CACd;;GAEF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/query.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nvar SPAN_QUERIES = {\n // TODO add one_of for objects\n span_first: {\n __scope_link: '.span_first'\n },\n span_near: {\n __scope_link: '.span_near'\n },\n span_or: {\n __scope_link: '.span_or'\n },\n span_not: {\n __scope_link: '.span_not'\n },\n span_term: {\n __scope_link: '.span_term'\n },\n span_containing: {\n __scope_link: '.span_containing'\n },\n span_within: {\n __scope_link: '.span_within'\n }\n};\n\nvar DECAY_FUNC_DESC = {\n __template: {\n \"FIELD\": {\n \"origin\": \"\",\n \"scale\": \"\"\n }\n },\n \"{field}\": {\n \"origin\": \"\",\n \"scale\": \"\",\n \"offset\": \"\",\n \"decay\": 0.5\n }\n },\n SCORING_FUNCS = {\n \"script_score\": {\n __template: {\n \"script\": \"_score * doc['f'].value\"\n },\n \"script\": {\n //populated by a global rule\n }\n },\n \"boost_factor\": 2.0,\n \"random_score\": {\n \"seed\": 314159265359\n },\n \"linear\": DECAY_FUNC_DESC,\n \"exp\": DECAY_FUNC_DESC,\n \"gauss\": DECAY_FUNC_DESC,\n \"field_value_factor\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"factor\": 1.2,\n \"modifier\": {\n __one_of: [\"none\", \"log\", \"log1p\", \"log2p\", \"ln\", \"ln1p\", \"ln2p\", \"square\", \"sqrt\", \"reciprocal\"]\n }\n }\n };\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('query', {\n match: {\n __template: {\n 'FIELD': 'TEXT'\n },\n '{field}': {\n 'query': '',\n 'operator': {\n __one_of: ['and', 'or']\n },\n 'type': {\n __one_of: ['phrase', 'phrase_prefix', 'boolean']\n },\n 'max_expansions': 10,\n 'analyzer': '',\n 'fuzziness': 1.0,\n 'prefix_length': 1\n }\n },\n match_phrase: {\n __template: {\n 'FIELD': 'PHRASE'\n },\n '{field}': {\n query: '',\n analyzer: ''\n }\n },\n match_phrase_prefix: {\n __template: {\n 'FIELD': 'PREFIX'\n },\n '{field}': {\n query: '',\n analyzer: '',\n max_expansions: 10,\n prefix_length: 1,\n fuzziness: 0.1\n }\n },\n multi_match: {\n __template: {\n 'query': '',\n 'fields': []\n },\n query: '',\n fields: ['{field}'],\n use_dis_max: {\n __template: true,\n __one_of: [true, false]\n },\n tie_breaker: 0.0,\n type: {__one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix']}\n },\n bool: {\n must: [\n {\n __scope_link: '.'\n }\n ],\n must_not: [\n {\n __scope_link: '.'\n }\n ],\n should: [\n {\n __scope_link: '.'\n }\n ],\n filter: {\n __scope_link: 'GLOBAL.filter'\n },\n minimum_number_should_match: 1,\n boost: 1.0\n },\n boosting: {\n positive: {\n __scope_link: '.'\n },\n negative: {\n __scope_link: '.'\n },\n negative_boost: 0.2\n },\n ids: {\n type: '',\n values: []\n },\n constant_score: {\n __template: {\n filter: {},\n boost: 1.2\n },\n query: {},\n filter: {},\n boost: 1.2\n },\n dis_max: {\n __template: {\n tie_breaker: 0.7,\n boost: 1.2,\n queries: []\n },\n tie_breaker: 0.7,\n boost: 1.2,\n queries: [\n {\n __scope_link: '.'\n }\n ]\n },\n field: {\n '{field}': {\n query: '',\n boost: 2.0,\n enable_position_increments: {\n __template: false,\n __one_of: [true, false]\n }\n }\n },\n filtered: {\n __template: {\n query: {},\n filter: {}\n },\n query: {},\n filter: {}\n },\n fuzzy: {\n '{field}': {\n 'value': '',\n 'boost': 1.0,\n 'min_similarity': 0.5,\n 'prefix_length': 0\n }\n },\n has_child: {\n __template: {\n type: 'TYPE',\n query: {}\n },\n 'type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'max', 'sum', 'avg']\n },\n '_scope': '',\n 'query': {},\n 'min_children': 1,\n 'max_children': 10\n },\n has_parent: {\n __template: {\n parent_type: 'TYPE',\n query: {}\n },\n 'parent_type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'score']\n },\n '_scope': '',\n 'query': {}\n },\n match_all: {},\n more_like_this: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n fields: ['{field}'],\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: '',\n docs: [{\n _index: \"{index}\",\n _type: \"{type}\",\n _id: \"\"\n }],\n ids: [\"\"]\n },\n mlt: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n __scope_link: \".more_like_this\"\n },\n prefix: {\n __template: {\n 'FIELD': {\n 'value': ''\n }\n },\n '{field}': {\n value: '',\n boost: 1.0\n }\n },\n query_string: {\n __template: {\n 'default_field': 'FIELD',\n 'query': 'this AND that OR thus'\n },\n query: '',\n default_field: '{field}',\n fields: ['{field}'],\n default_operator: {\n __one_of: ['OR', 'AND']\n },\n analyzer: '',\n allow_leading_wildcard: {\n __one_of: [true, false]\n },\n lowercase_expanded_terms: {\n __one_of: [true, false]\n },\n enable_position_increments: {\n __one_of: [true, false]\n },\n fuzzy_max_expansions: 50,\n fuzzy_min_sim: 0.5,\n fuzzy_prefix_length: 0,\n phrase_slop: 0,\n boost: 1.0,\n analyze_wildcard: {\n __one_of: [false, true]\n },\n auto_generate_phrase_queries: {\n __one_of: [false, true]\n },\n minimum_should_match: '20%',\n lenient: {\n __one_of: [false, true]\n },\n use_dis_max: {\n __one_of: [true, false]\n },\n tie_breaker: 0,\n time_zone: \"+1:00\"\n },\n simple_query_string: {\n __template: {\n query: \"\",\n fields: []\n },\n query: \"\",\n fields: [\"{field}\"],\n default_operator: {__one_of: [\"OR\", \"AND\"]},\n analyzer: \"\",\n flags: \"OR|AND|PREFIX\",\n lowercase_expanded_terms: {__one_of: [true, false]},\n locale: \"ROOT\",\n lenient: {__one_of: [true, false]}\n },\n range: {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n '{field}': {\n __template: {\n gte: 10,\n lte: 20\n },\n gte: 10,\n gt: 10,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n boost: 1.0,\n \"format\": \"dd/MM/yyyy||yyyy\"\n\n }\n },\n span_first: {\n __template: {\n 'match': {\n 'span_term': {\n 'FIELD': 'VALUE'\n }\n },\n 'end': 3\n },\n match: SPAN_QUERIES\n },\n span_near: {\n __template: {\n 'clauses': [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ],\n slop: 12,\n in_order: false\n },\n clauses: [\n SPAN_QUERIES\n ],\n slop: 12,\n in_order: {\n __one_of: [false, true]\n },\n collect_payloads: {\n __one_of: [false, true]\n }\n },\n span_term: {\n __template: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n span_not: {\n __template: {\n include: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n exclude: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n },\n include: SPAN_QUERIES,\n exclude: SPAN_QUERIES\n },\n span_or: {\n __template: {\n clauses: [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ]\n },\n clauses: [\n SPAN_QUERIES\n ]\n },\n span_containing: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n span_within: {\n __template: {\n little: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n big: {\n span_near: {\n 'clauses': [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ],\n \"slop\": 5,\n \"in_order\": false\n }\n }\n },\n little: SPAN_QUERIES,\n big: SPAN_QUERIES\n },\n term: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n terms: {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n '{field}': [''],\n minimum_match: 1\n },\n wildcard: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n nested: {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n path: '',\n query: {},\n filter: {},\n score_mode: {\n __one_of: ['avg', 'total', 'max', 'none']\n }\n },\n custom_filters_score: {\n __template: {\n query: {},\n filters: [\n {\n filter: {}\n }\n ]\n },\n query: {},\n filters: [\n {\n filter: {},\n boost: 2.0,\n script: {\n //populated by a global rule\n }\n }\n ],\n score_mode: {\n __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply']\n },\n max_boost: 2.0,\n params: {},\n lang: ''\n },\n indices: {\n __template: {\n indices: ['INDEX1', 'INDEX2'],\n query: {}\n },\n indices: ['{index}'],\n query: {},\n no_match_query: {\n __scope_link: '.'\n }\n },\n geo_shape: {\n __template: {\n location: {},\n relation: 'within'\n },\n __scope_link: '.filter.geo_shape'\n },\n // js hint gets confused here\n /* jshint -W015 */\n function_score: _.defaults({\n __template: {\n query: {},\n functions: [\n {}\n ]\n },\n query: {},\n filter: {},\n functions: [\n _.defaults(\n {\n filter: {},\n weight: 1.0\n },\n SCORING_FUNCS\n )\n ],\n boost: 1.0,\n boost_mode: {__one_of: [\"multiply\", \"replace\", \"sum\", \"avg\", \"max\", \"min\"]},\n score_mode: {__one_of: [\"multiply\", \"sum\", \"first\", \"avg\", \"max\", \"min\"]},\n max_boost: 10,\n min_score: 1.0\n },\n SCORING_FUNCS\n )\n\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [ + "tagged-template-literal" + ] + }, + "ignored": false, + "code": "'use strict';\n\nvar _templateObject = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']fs'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']fs']),\n _templateObject2 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']url'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']url']),\n _templateObject3 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']s3'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']s3']),\n _templateObject4 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']hdfs'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']hdfs']);\n\nfunction _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nmodule.exports = function (api) {\n api.addEndpointDescription('restore_snapshot', {\n methods: ['POST'],\n patterns: ['_snapshot/{id}/{id}/_restore'],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: { __one_of: [true, false] },\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\"\n }\n });\n\n api.addEndpointDescription('single_snapshot', {\n methods: ['GET', 'DELETE'],\n patterns: ['_snapshot/{id}/{id}']\n });\n\n api.addEndpointDescription('all_snapshots', {\n methods: ['GET'],\n patterns: ['_snapshot/{id}/_all']\n });\n\n api.addEndpointDescription('put_snapshot', {\n methods: ['PUT'],\n patterns: ['_snapshot/{id}/{id}'],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: { __one_of: [true, false] },\n include_global_state: { __one_of: [true, false] },\n partial: { __one_of: [true, false] }\n }\n });\n\n api.addEndpointDescription('_snapshot_status', {\n methods: ['GET'],\n patterns: ['_snapshot/_status', '_snapshot/{id}/_status', '_snapshot/{id}/{ids}/_status']\n });\n\n function getRepositoryType(context, editor) {\n var iter = editor.iterForCurrentLoc();\n // for now just iterate back to the first \"type\" key\n var t = iter.getCurrentToken();\n var type;\n while (t && t.type.indexOf(\"url\") < 0) {\n if (t.type === 'variable' && t.value === '\"type\"') {\n t = editor.parser.nextNonEmptyToken(iter);\n if (!t || t.type !== \"punctuation.colon\") {\n // weird place to be in, but safe choice..\n break;\n }\n t = editor.parser.nextNonEmptyToken(iter);\n if (t && t.type === \"string\") {\n type = t.value.replace(/\"/g, '');\n }\n break;\n }\n t = editor.parser.prevNonEmptyToken(iter);\n }\n return type;\n }\n\n api.addEndpointDescription('put_repository', {\n methods: ['PUT'],\n patterns: ['_snapshot/{id}'],\n data_autocomplete_rules: {\n __template: { \"type\": \"\" },\n\n \"type\": {\n __one_of: [\"fs\", \"url\", \"s3\", \"hdfs\"]\n },\n \"settings\": {\n __one_of: [{\n //fs\n __condition: {\n lines_regex: String.raw(_templateObject)\n },\n __template: {\n location: \"path\"\n },\n location: \"path\",\n compress: { __one_of: [true, false] },\n concurrent_streams: 5,\n chunk_size: \"10m\",\n max_restore_bytes_per_sec: \"20mb\",\n max_snapshot_bytes_per_sec: \"20mb\"\n }, { // url\n __condition: {\n lines_regex: String.raw(_templateObject2)\n },\n __template: {\n url: \"\"\n },\n url: \"\",\n concurrent_streams: 5\n }, { //s3\n __condition: {\n lines_regex: String.raw(_templateObject3)\n },\n __template: {\n bucket: \"\"\n },\n bucket: \"\",\n region: \"\",\n base_path: \"\",\n concurrent_streams: 5,\n chunk_size: \"10m\",\n compress: { __one_of: [true, false] }\n }, { // hdfs\n __condition: {\n lines_regex: String.raw(_templateObject4)\n },\n __template: {\n path: \"\"\n },\n uri: \"\",\n path: \"some/path\",\n load_defaults: { __one_of: [true, false] },\n conf_location: \"cfg.xml\",\n concurrent_streams: 5,\n compress: { __one_of: [true, false] },\n chunk_size: \"10m\"\n }]\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL3NuYXBzaG90X3Jlc3RvcmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsa0JBQWtCLEVBQUU7QUFDN0MsV0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDO0FBQ2pCLFlBQVEsRUFBRSxDQUNSLDhCQUE4QixDQUMvQjtBQUNELGNBQVUsRUFBRTtBQUNWLHlCQUFtQixFQUFFLFVBQVU7S0FDaEM7QUFDRCwyQkFBdUIsRUFBRTtBQUN2QixhQUFPLEVBQUUsR0FBRztBQUNaLHdCQUFrQixFQUFFLEVBQUMsUUFBUSxFQUFFLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQyxFQUFDO0FBQzdDLDBCQUFvQixFQUFFLEtBQUs7QUFDM0Isb0JBQWMsR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ZnNcbiAgICAgICAgICBfX2NvbmRpdGlvbjoge1xuICAgICAgICAgICAgbGluZXNfcmVnZXg6IFN0cmluZy5yYXdgdHlwZVtcIiddXFxzKjpcXHMqW1wiJ11mc2BcbiAgICAgICAgICB9LFxuICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgIGxvY2F0aW9uOiBcInBhdGhcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgbG9jYXRpb246IFwicGF0aFwiLFxuICAgICAgICAgIGNvbXByZXNzOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgICAgIGNvbmN1cnJlbnRfc3RyZWFtczogNSxcbiAgICAgICAgICBjaHVua19zaXplOiBcIjEwbVwiLFxuICAgICAgICAgIG1heF9yZXN0b3JlX2J5dGVzX3Blcl9zZWM6IFwiMjBtYlwiLFxuICAgICAgICAgIG1heF9zbmFwc2hvdF9ieXRlc19wZXJfc2VjOiBcIjIwbWJcIlxuICAgICAgICB9LFxuICAgICAgICAgIHsvLyB1cmxcbiAgICAgICAgICAgIF9fY29uZGl0aW9uOiB7XG4gICAgICAgICAgICAgIGxpbmVzX3JlZ2V4OiBTdHJpbmcucmF3YHR5cGVbXCInXVxccyo6XFxzKltcIidddXJsYFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgdXJsOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdXJsOiBcIlwiLFxuICAgICAgICAgICAgY29uY3VycmVudF9zdHJlYW1zOiA1XG4gICAgICAgICAgfSxcbiAgICAgICAgICB7IC8vczNcbiAgICAgICAgICAgIF9fY29uZGl0aW9uOiB7XG4gICAgICAgICAgICAgIGxpbmVzX3JlZ2V4OiBTdHJpbmcucmF3YHR5cGVbXCInXVxccyo6XFxzKltcIiddczNgXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICBidWNrZXQ6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBidWNrZXQ6IFwiXCIsXG4gICAgICAgICAgICByZWdpb246IFwiXCIsXG4gICAgICAgICAgICBiYXNlX3BhdGg6IFwiXCIsXG4gICAgICAgICAgICBjb25jdXJyZW50X3N0cmVhbXM6IDUsXG4gICAgICAgICAgICBjaHVua19zaXplOiBcIjEwbVwiLFxuICAgICAgICAgICAgY29tcHJlc3M6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHsvLyBoZGZzXG4gICAgICAgICAgICBfX2NvbmRpdGlvbjoge1xuICAgICAgICAgICAgICBsaW5lc19yZWdleDogU3RyaW5nLnJhd2B0eXBlW1wiJ11cXHMqOlxccypbXCInXWhkZnNgXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICBwYXRoOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdXJpOiBcIlwiLFxuICAgICAgICAgICAgcGF0aDogXCJzb21lL3BhdGhcIixcbiAgICAgICAgICAgIGxvYWRfZGVmYXVsdHM6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX0sXG4gICAgICAgICAgICBjb25mX2xvY2F0aW9uOiBcImNmZy54bWxcIixcbiAgICAgICAgICAgIGNvbmN1cnJlbnRfc3RyZWFtczogNSxcbiAgICAgICAgICAgIGNvbXByZXNzOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgICAgICAgY2h1bmtfc2l6ZTogXCIxMG1cIlxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js" + ], + "names": [], + "mappings": ";;;;;;;;;AAAA,MAAM,CA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;AACrB,kBAAQ,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;AACnC,oBAAU,EAAE,KAAK;SAClB,CACF;OACF;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/snapshot_restore.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('restore_snapshot', {\n methods: ['POST'],\n patterns: [\n '_snapshot/{id}/{id}/_restore'\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: {__one_of: [true, false]},\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\"\n }\n });\n\n\n api.addEndpointDescription('single_snapshot', {\n methods: ['GET', 'DELETE'],\n patterns: [\n '_snapshot/{id}/{id}'\n ]\n });\n\n api.addEndpointDescription('all_snapshots', {\n methods: ['GET'],\n patterns: [\n '_snapshot/{id}/_all'\n ]\n });\n\n api.addEndpointDescription('put_snapshot', {\n methods: ['PUT'],\n patterns: [\n '_snapshot/{id}/{id}'\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: {__one_of: [true, false]},\n include_global_state: {__one_of: [true, false]},\n partial: {__one_of: [true, false]}\n }\n });\n\n api.addEndpointDescription('_snapshot_status', {\n methods: ['GET'],\n patterns: [\n '_snapshot/_status',\n '_snapshot/{id}/_status',\n '_snapshot/{id}/{ids}/_status'\n ]\n });\n\n\n function getRepositoryType(context, editor) {\n var iter = editor.iterForCurrentLoc();\n // for now just iterate back to the first \"type\" key\n var t = iter.getCurrentToken();\n var type;\n while (t && t.type.indexOf(\"url\") < 0) {\n if (t.type === 'variable' && t.value === '\"type\"') {\n t = editor.parser.nextNonEmptyToken(iter);\n if (!t || t.type !== \"punctuation.colon\") {\n // weird place to be in, but safe choice..\n break;\n }\n t = editor.parser.nextNonEmptyToken(iter);\n if (t && t.type === \"string\") {\n type = t.value.replace(/\"/g, '');\n }\n break;\n }\n t = editor.parser.prevNonEmptyToken(iter);\n }\n return type;\n }\n\n api.addEndpointDescription('put_repository', {\n methods: ['PUT'],\n patterns: [\n '_snapshot/{id}'\n ],\n data_autocomplete_rules: {\n __template: {\"type\": \"\"},\n\n \"type\": {\n __one_of: [\"fs\", \"url\", \"s3\", \"hdfs\"]\n },\n \"settings\": {\n __one_of: [{\n //fs\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']fs`\n },\n __template: {\n location: \"path\"\n },\n location: \"path\",\n compress: {__one_of: [true, false]},\n concurrent_streams: 5,\n chunk_size: \"10m\",\n max_restore_bytes_per_sec: \"20mb\",\n max_snapshot_bytes_per_sec: \"20mb\"\n },\n {// url\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']url`\n },\n __template: {\n url: \"\"\n },\n url: \"\",\n concurrent_streams: 5\n },\n { //s3\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']s3`\n },\n __template: {\n bucket: \"\"\n },\n bucket: \"\",\n region: \"\",\n base_path: \"\",\n concurrent_streams: 5,\n chunk_size: \"10m\",\n compress: {__one_of: [true, false]}\n },\n {// hdfs\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']hdfs`\n },\n __template: {\n path: \"\"\n },\n uri: \"\",\n path: \"some/path\",\n load_defaults: {__one_of: [true, false]},\n conf_location: \"cfg.xml\",\n concurrent_streams: 5,\n compress: {__one_of: [true, false]},\n chunk_size: \"10m\"\n }\n ]\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/search.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_search', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_search\", \"{indices}/_search\", \"_search\"],\n url_params: {\n q: \"\",\n df: \"\",\n analyzer: \"\",\n default_operator: [\"AND\", \"OR\"],\n explain: \"__flag__\",\n _source: \"\",\n _source_include: \"\",\n _source_exclude: \"\",\n fields: [],\n sort: \"\",\n track_scores: \"__flag__\",\n timeout: 1,\n from: 0,\n size: 10,\n search_type: [\"dfs_query_then_fetch\", \"dfs_query_and_fetch\", \"query_then_fetch\", \"query_and_fetch\", \"count\", \"scan\"],\n terminate_after: 10,\n lowercase_expanded_terms: [\"true\", \"false\"],\n analyze_wildcard: \"__flag__\",\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n scroll: \"5m\",\n scroll_id: \"\",\n routing: \"\",\n request_cache: [\"true\", \"false\"]\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n aggs: {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n\n post_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n size: {\n __template: 20\n },\n from: 0,\n sort: {\n __template: [{\n 'FIELD': {\n 'order': 'desc'\n }\n }],\n __any_of: [{\n '{field}': {\n 'order': {\n __one_of: ['desc', 'asc']\n },\n missing: {\n __one_of: ['_last', '_first']\n },\n mode: {\n __one_of: ['min', 'max', 'avg', 'sum']\n },\n nested_path: \"\",\n nested_filter: {\n __scope_link: \"GLOBAL.filter\"\n }\n }\n }, '{field}', '_score', {\n '_geo_distance': {\n __template: {\n \"FIELD\": {\n lat: 40,\n lon: -70\n },\n order: \"asc\"\n },\n \"{field}\": {\n __one_of: [{\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }, [{\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }], [\"\"], \"\"]\n },\n distance_type: { __one_of: [\"sloppy_arc\", \"arc\", \"plane\"] },\n sort_mode: { __one_of: [\"min\", \"max\", \"avg\"] },\n order: { __one_of: [\"asc\", \"desc\"] },\n unit: \"km\"\n }\n }]\n },\n fields: ['{field}'],\n fielddata_fields: [\"{field}\"],\n script_fields: {\n __template: {\n 'FIELD': {\n 'script': {\n // populated by a global rule\n }\n }\n },\n '*': {\n __scope_link: 'GLOBAL.script'\n }\n },\n partial_fields: {\n __template: {\n 'NAME': {\n include: []\n }\n },\n '*': {\n include: [],\n exclude: []\n }\n },\n highlight: {\n // populated by a global rule\n },\n _source: {\n __one_of: [\"{field}\", [\"{field}\"], {\n \"include\": {\n __one_of: [\"{field}\", [\"{field}\"]]\n },\n \"exclude\": {\n __one_of: [\"{field}\", [\"{field}\"]]\n }\n }]\n },\n explain: {\n __one_of: [true, false]\n },\n stats: [''],\n timeout: \"1s\",\n version: { __one_of: [true, false] }\n }\n });\n\n api.addEndpointDescription('_search_template', {\n methods: ['GET'],\n patterns: [\"{indices}/{types}/_search/template\", \"{indices}/_search/template\", \"_search/template\"],\n data_autocomplete_rules: {\n \"template\": {\n __one_of: [{ __scope_link: \"_search\" }, { __scope_link: \"GLOBAL.script\" }]\n },\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template', {\n methods: ['GET'],\n patterns: [\"_render/template\"],\n data_autocomplete_rules: {\n __one_of: [{ \"inline\": { __scope_link: \"_search\" } }, { __scope_link: \"GLOBAL.script\" }],\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template_with_id', {\n methods: ['GET'],\n patterns: [\"_render/template/{id}\"],\n data_autocomplete_rules: {\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_get_delete_search_template', {\n methods: ['GET', 'DELETE'],\n patterns: [\"_search/template/{id}\"]\n });\n\n api.addEndpointDescription('_put_search_template', {\n methods: ['PUT'],\n patterns: [\"_search/template/{id}\"],\n data_autocomplete_rules: {\n \"template\": {\n __scope_link: \"_search\"\n }\n }\n });\n\n api.addEndpointDescription('_search_shards', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_search_shards\", \"{indices}/_search_shards\", \"_search_shards\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n local: \"__flag__\"\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL3NlYXJjaC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLFNBQVMsRUFBRTtBQUNwQyxXQUFPLEVBQUUsQ0FBQyxLQUFLLEVBQUUsTUFBTSxDQUFDO0FBQ3hCLFlBQVEsRUFBRSxFQUFFO0FBQ1osWUFBUSxFQUFFLENBQ1IsMkJBQTJCLEVBQzNCLG1CQUFtQixFQUNuQixTQUFTLENBQ1Y7QUFDRCxjQUFVLEVBQUU7QUFDVixPQUFDLEVBQUUsRUFBRTtBQUNMLFFBQUUs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wdWxhdGVkIGJ5IGEgZ2xvYmFsIHJ1bGVcbiAgICAgIH0sXG4gICAgICBhZ2dzOiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICBcIk5BTUVcIjoge1xuICAgICAgICAgICAgXCJBR0dfVFlQRVwiOiB7fVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcblxuICAgICAgcG9zdF9maWx0ZXI6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnR0xPQkFMLmZpbHRlcidcbiAgICAgIH0sXG4gICAgICBzaXplOiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IDIwXG4gICAgICB9LFxuICAgICAgZnJvbTogMCxcbiAgICAgIHNvcnQ6IHtcbiAgICAgICAgX190ZW1wbGF0ZTogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgJ29yZGVyJzogJ2Rlc2MnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICBdLFxuICAgICAgICBfX2FueV9vZjogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICAgICAgICAnb3JkZXInOiB7XG4gICAgICAgICAgICAgICAgX19vbmVfb2Y6IFsnZGVzYycsICdhc2MnXVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBtaXNzaW5nOiB7XG4gICAgICAgICAgICAgICAgX19vbmVfb2Y6IFsnX2xhc3QnLCAnX2ZpcnN0J11cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgbW9kZToge1xuICAgICAgICAgICAgICAgIF9fb25lX29mOiBbJ21pbicsICdtYXgnLCAnYXZnJywgJ3N1bSddXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIG5lc3RlZF9wYXRoOiBcIlwiLFxuICAgICAgICAgICAgICBuZXN0ZWRfZmlsdGVyOiB7XG4gICAgICAgICAgICAgICAgX19zY29wZV9saW5rOiBcIkdMT0JBTC5maWx0ZXJcIlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICAne2ZpZWxkfScsXG4gICAgICAgICAgJ19zY29yZScsXG4gICAgICAgICAge1xuICAgICAgICAgICAgJ19nZW9fZGlzdGFuY2UnOiB7XG4gICAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgICBcIkZJRUxEXCI6IHtcbiAgICAgICAgICAgICAgICAgIGxhdDogNDAsXG4gICAgICAgICAgICAgICAgICBsb246IC03MFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgb3JkZXI6IFwiYXNjXCJcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgXCJ7ZmllbGR9XCI6IHtcbiAgICAgICAgICAgICAgICBfX29uZV9vZjogW1xuICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgICAgICAgICAgbGF0OiA0MCxcbiAgICAgICAgICAgICAgICAgICAgICBsb246IC03MFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBsYXQ6IDQwLFxuICAgICAgICAgICAgICAgICAgICBsb246IC03MFxuICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhdDogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICBsb246IC03MFxuICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgbGF0OiA0MCxcbiAgICAgICAgICAgICAgICAgICAgICBsb246IC03MFxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgW1wiXCJdLFxuICAgICAgICAgICAgICAgICAgXCJcIlxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgZGlzdGFuY2VfdHlwZToge19fb25lX29mOiBbXCJzbG9wcHlfYXJjXCIsIFwiYXJjXCIsIFwicGxhbmVcIl19LFxuICAgICAgICAgICAgICBzb3J0X21vZGU6IHtfX29uZV9vZjogW1wibWluXCIsIFwibWF4XCIsIFwiYXZnXCJdfSxcbiAgICAgICAgICAgICAgb3JkZXI6IHtfX29uZV9vZjogW1wiYXNjXCIsIFwiZGVzY1wiXX0sXG4gICAgICAgICAgICAgIHVuaXQ6IFwia21cIlxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGZpZWxkczogWyd7ZmllbGR9J10sXG4gICAgICBmaWVsZGRhdGFfZmllbGRzOiBbXCJ7ZmllbGR9XCJdLFxuICAgICAgc2NyaXB0X2ZpZWxkczoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgJ3NjcmlwdCc6IHtcbiAgICAgICAgICAgICAgLy8gcG9wdWxhdGVkIGJ5IGEgZ2xvYmFsIHJ1bGVcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgICcqJzoge1xuICAgICAgICAgIF9fc2NvcGVfbGluazogJ0dMT0JBTC5zY3JpcHQnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBwYXJ0aWFsX2ZpZWxkczoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgJ05BTUUnOiB7XG4gICAgICAgICAgICBpbmNsdWRlOiBbXVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgJyonOiB7XG4gICAgICAgICAgaW5jbHVkZTogW10sXG4gICAgICAgICAgZXhjbHVkZTogW11cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGhpZ2hsaWdodDoge1xuICAgICAgICAvLyBwb3B1bGF0ZWQgYnkgYSBnbG9iYWwgcnVsZVxuICAgICAgfSxcbiAgICAgIF9zb3VyY2U6IHtcbiAgICAgICAgX19vbmVfb2Y6IFtcbiAgICAgICAgICBcIntmaWVsZH1cIixcbiAgICAgICAgICBbXCJ7ZmllbGR9XCJdLFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIFwiaW5jbHVkZVwiOiB7XG4gICAgICAgICAgICAgIF9fb25lX29mOiBbXG4gICAgICAgICAgICAgICAgXCJ7ZmllbGR9XCIsXG4gICAgICAgICAgICAgICAgW1wie2ZpZWxkfVwiXVxuICAgICAgICAgICAgICBdXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJleGNsdWRlXCI6IHtcbiAgICAgICAgICAgICAgX19vbmVfb2Y6IFtcbiAgICAgICAgICAgICAgICBcIntmaWVsZH1cIixcbiAgICAgICAgICAgICAgICBbXCJ7ZmllbGR9XCJdXG4gICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBleHBsYWluOiB7XG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgc3RhdHM6IFsnJ10sXG4gICAgICB0aW1lb3V0OiBcIjFzXCIsXG4gICAgICB2ZXJzaW9uOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19XG4gICAgfVxuICB9KTtcblxuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3NlYXJjaF90ZW1wbGF0ZScsIHtcbiAgICBtZXRob2RzOiBbJ0dFVCddLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS97dHlwZXN9L19zZWFyY2gvdGVtcGxhdGVcIixcbiAgICAgIFwie2luZGljZXN9L19zZWFyY2gvdGVtcGxhdGVcIixcbiAgICA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19cIlxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/search.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,SAAS,EAAE;AACpC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,2BAA2B,EAC3B,mBAAmB,EACnB,SAAS,CACV;AACD,cAAU,EAAE;AACV,OAAC,EAAE,EAAE;AACL,QAAE,EAAE,EAAE;AACN,cAAQ,EAAE,EAAE;AACZ,sBAAgB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/B,aAAO,EAAE,UAAU;AACnB,aAAO,EAAE,EAAE;AACX,qBAAe,EAAE,EAAE;AACnB,qBAAe,EAAE,EAAE;AACnB,YAAM,EAAE,EAAE;AACV,UAAI,EAAE,EAAE;AACR,kBAAY,EAAE,UAAU;AACxB,aAAO,EAAE,CAAC;AACV,UAAI,EAAE,CAAC;AACP,UAAI,EAAE,EAAE;AACR,iBAAW,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC;AACpH,qBAAe,EAAE,EAAE;AACnB,8BAAwB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AAC3C,sBAAgB,EAAE,UAAU;AAC5B,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,YAAM,EAAE,IAAI;AACZ,eAAS,EAAE,EAAE;AACb,aAAO,EAAE,EAAE;AACX,mBAAa,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;KACjC;AACD,2BAAuB,EAAE;AACvB,WAAK,EAA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KAAK,CAAC;AAChB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,kCAAkC,EAClC,0BAA0B,EAC1B,gBAAgB,CACjB;AACD,cAAU,EAAE;AACV,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,aAAO,EAAE,EAAE;AACX,WAAK,EAAE,UAAU;KAClB;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/search.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_search', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_search\",\n \"{indices}/_search\",\n \"_search\"\n ],\n url_params: {\n q: \"\",\n df: \"\",\n analyzer: \"\",\n default_operator: [\"AND\", \"OR\"],\n explain: \"__flag__\",\n _source: \"\",\n _source_include: \"\",\n _source_exclude: \"\",\n fields: [],\n sort: \"\",\n track_scores: \"__flag__\",\n timeout: 1,\n from: 0,\n size: 10,\n search_type: [\"dfs_query_then_fetch\", \"dfs_query_and_fetch\", \"query_then_fetch\", \"query_and_fetch\", \"count\", \"scan\"],\n terminate_after: 10,\n lowercase_expanded_terms: [\"true\", \"false\"],\n analyze_wildcard: \"__flag__\",\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n scroll: \"5m\",\n scroll_id: \"\",\n routing: \"\",\n request_cache: [\"true\", \"false\"]\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n aggs: {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n\n post_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n size: {\n __template: 20\n },\n from: 0,\n sort: {\n __template: [\n {\n 'FIELD': {\n 'order': 'desc'\n }\n }\n ],\n __any_of: [\n {\n '{field}': {\n 'order': {\n __one_of: ['desc', 'asc']\n },\n missing: {\n __one_of: ['_last', '_first']\n },\n mode: {\n __one_of: ['min', 'max', 'avg', 'sum']\n },\n nested_path: \"\",\n nested_filter: {\n __scope_link: \"GLOBAL.filter\"\n }\n }\n },\n '{field}',\n '_score',\n {\n '_geo_distance': {\n __template: {\n \"FIELD\": {\n lat: 40,\n lon: -70\n },\n order: \"asc\"\n },\n \"{field}\": {\n __one_of: [\n {\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n },\n [\n {\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }\n ],\n [\"\"],\n \"\"\n ]\n },\n distance_type: {__one_of: [\"sloppy_arc\", \"arc\", \"plane\"]},\n sort_mode: {__one_of: [\"min\", \"max\", \"avg\"]},\n order: {__one_of: [\"asc\", \"desc\"]},\n unit: \"km\"\n }\n }\n ]\n },\n fields: ['{field}'],\n fielddata_fields: [\"{field}\"],\n script_fields: {\n __template: {\n 'FIELD': {\n 'script': {\n // populated by a global rule\n }\n }\n },\n '*': {\n __scope_link: 'GLOBAL.script'\n }\n },\n partial_fields: {\n __template: {\n 'NAME': {\n include: []\n }\n },\n '*': {\n include: [],\n exclude: []\n }\n },\n highlight: {\n // populated by a global rule\n },\n _source: {\n __one_of: [\n \"{field}\",\n [\"{field}\"],\n {\n \"include\": {\n __one_of: [\n \"{field}\",\n [\"{field}\"]\n ]\n },\n \"exclude\": {\n __one_of: [\n \"{field}\",\n [\"{field}\"]\n ]\n }\n }\n ]\n },\n explain: {\n __one_of: [true, false]\n },\n stats: [''],\n timeout: \"1s\",\n version: {__one_of: [true, false]}\n }\n });\n\n api.addEndpointDescription('_search_template', {\n methods: ['GET'],\n patterns: [\n \"{indices}/{types}/_search/template\",\n \"{indices}/_search/template\",\n \"_search/template\"\n ],\n data_autocomplete_rules: {\n \"template\": {\n __one_of: [\n {__scope_link: \"_search\"},\n {__scope_link: \"GLOBAL.script\"}\n ]\n },\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template', {\n methods: ['GET'],\n patterns: [\n \"_render/template\"\n ],\n data_autocomplete_rules: {\n __one_of: [\n {\"inline\": {__scope_link: \"_search\"}},\n {__scope_link: \"GLOBAL.script\"}\n ],\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_render_search_template_with_id', {\n methods: ['GET'],\n patterns: [\n \"_render/template/{id}\"\n ],\n data_autocomplete_rules: {\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_get_delete_search_template', {\n methods: ['GET', 'DELETE'],\n patterns: [\n \"_search/template/{id}\"\n ]\n });\n\n api.addEndpointDescription('_put_search_template', {\n methods: ['PUT'],\n patterns: [\n \"_search/template/{id}\"\n ],\n data_autocomplete_rules: {\n \"template\": {\n __scope_link: \"_search\"\n }\n }\n });\n\n api.addEndpointDescription('_search_shards', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_search_shards\",\n \"{indices}/_search_shards\",\n \"_search_shards\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n local: \"__flag__\"\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/settings.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nmodule.exports = function (api) {\n\n api.addEndpointDescription('_get_settings', {\n patterns: [\"{indices}/_settings\", \"_settings\"],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n api.addEndpointDescription('_put_settings', {\n methods: ['PUT'],\n patterns: [\"{indices}/_settings\", \"_settings\"],\n data_autocomplete_rules: {\n refresh_interval: '1s',\n number_of_shards: 5,\n number_of_replicas: 1,\n 'blocks.read_only': {\n __one_of: [false, true]\n },\n 'blocks.read': {\n __one_of: [true, false]\n },\n 'blocks.write': {\n __one_of: [true, false]\n },\n 'blocks.metadata': {\n __one_of: [true, false]\n },\n term_index_interval: 32,\n term_index_divisor: 1,\n 'translog.flush_threshold_ops': 5000,\n 'translog.flush_threshold_size': '200mb',\n 'translog.flush_threshold_period': '30m',\n 'translog.disable_flush': {\n __one_of: [true, false]\n },\n 'cache.filter.max_size': '2gb',\n 'cache.filter.expire': '2h',\n 'gateway.snapshot_interval': '10s',\n routing: {\n allocation: {\n include: {\n tag: ''\n },\n exclude: {\n tag: ''\n },\n require: {\n tag: ''\n },\n total_shards_per_node: -1\n }\n },\n 'recovery.initial_shards': {\n __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1']\n },\n 'ttl.disable_purge': {\n __one_of: [true, false]\n },\n analysis: {\n analyzer: {},\n tokenizer: {},\n filter: {},\n char_filter: {}\n },\n 'cache.query.enable': {\n __one_of: [true, false]\n },\n shadow_replicas: {\n __one_of: [true, false]\n },\n shared_filesystem: {\n __one_of: [true, false]\n },\n data_path: 'path',\n codec: {\n __one_of: ['default', 'best_compression', 'lucene_default']\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVna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AgICAgICAgICB9LFxuICAgICAgICAgIHJlcXVpcmU6IHtcbiAgICAgICAgICAgIHRhZzogJydcbiAgICAgICAgICB9LFxuICAgICAgICAgIHRvdGFsX3NoYXJkc19wZXJfbm9kZTogLTFcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgICdyZWNvdmVyeS5pbml0aWFsX3NoYXJkcyc6IHtcbiAgICAgICAgX19vbmVfb2Y6IFsncXVvcnVtJywgJ3F1b3J1bS0xJywgJ2hhbGYnLCAnZnVsbCcsICdmdWxsLTEnXVxuICAgICAgfSxcbiAgICAgICd0dGwuZGlzYWJsZV9wdXJnZSc6IHtcbiAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgIH0sXG4gICAgICBhbmFseXNpczoge1xuICAgICAgICBhbmFseXplcjoge30sXG4gICAgICAgIHRva2VuaXplcjoge30sXG4gICAgICAgIGZpbHRlcjoge30sXG4gICAgICAgIGNoYXJfZmlsdGVyOiB7fVxuICAgICAgfSxcbiAgICAgICdjYWNoZS5xdWVyeS5lbmFibGUnOiB7XG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgc2hhZG93X3JlcGxpY2FzOiB7XG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgc2hhcmVkX2ZpbGVzeXN0ZW06IHtcbiAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgIH0sXG4gICAgICBkYXRhX3BhdGg6ICdwYXRoJyxcbiAgICAgIGNvZGVjOiB7XG4gICAgICAgIF9fb25lX29mOiBbJ2RlZmF1bHQnLCAnYmVzdF9jb21wcmVzc2lvbicsICdsdWNlbmVfZGVmYXVsdCddXG4gICAgICB9XG4gICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server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E;WACR;AACD,+BAAqB,EAAE,CAAC,CAAC;SAC1B;OACF;AACD,+BAAyB,EAAE;AACzB,gBAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;OAC3D;AACD,yBAAmB,EAAE;AACnB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,cAAQ,EAAE;AACR,gBAAQ,EAAE,EAAE;AACZ,iBAAS,EAAE,EAAE;AACb,cAAM,EAAE,EAAE;AACV,mBAAW,EAAE,EAAE;OAChB;AACD,0BAAoB,EAAE;AACpB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,qBAAe,EAAE;AACf,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,uBAAiB,EAAE;AACjB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,eAAS,EAAE,MAAM;AACjB,WAAK,EAAE;AACL,gBAAQ,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,gBAAgB,CAAC;OAC5D;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/settings.js", + "sourcesContent": [ + "module.exports = function (api) {\n\n api.addEndpointDescription('_get_settings', {\n patterns: [\n \"{indices}/_settings\",\n \"_settings\"\n ],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n api.addEndpointDescription('_put_settings', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_settings\",\n \"_settings\"\n ],\n data_autocomplete_rules: {\n refresh_interval: '1s',\n number_of_shards: 5,\n number_of_replicas: 1,\n 'blocks.read_only': {\n __one_of: [false, true]\n },\n 'blocks.read': {\n __one_of: [true, false]\n },\n 'blocks.write': {\n __one_of: [true, false]\n },\n 'blocks.metadata': {\n __one_of: [true, false]\n },\n term_index_interval: 32,\n term_index_divisor: 1,\n 'translog.flush_threshold_ops': 5000,\n 'translog.flush_threshold_size': '200mb',\n 'translog.flush_threshold_period': '30m',\n 'translog.disable_flush': {\n __one_of: [true, false]\n },\n 'cache.filter.max_size': '2gb',\n 'cache.filter.expire': '2h',\n 'gateway.snapshot_interval': '10s',\n routing: {\n allocation: {\n include: {\n tag: ''\n },\n exclude: {\n tag: ''\n },\n require: {\n tag: ''\n },\n total_shards_per_node: -1\n }\n },\n 'recovery.initial_shards': {\n __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1']\n },\n 'ttl.disable_purge': {\n __one_of: [true, false]\n },\n analysis: {\n analyzer: {},\n tokenizer: {},\n filter: {},\n char_filter: {}\n },\n 'cache.query.enable': {\n __one_of: [true, false]\n },\n shadow_replicas: {\n __one_of: [true, false]\n },\n shared_filesystem: {\n __one_of: [true, false]\n },\n data_path: 'path',\n codec: {\n __one_of: ['default', 'best_compression', 'lucene_default']\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/templates.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_delete_template', {\n methods: ['DELETE'],\n patterns: [\"_template/{id}\"]\n });\n api.addEndpointDescription('_get_template', {\n methods: ['GET'],\n patterns: [\"_template/{id}\", \"_template\"]\n });\n api.addEndpointDescription('_put_template', {\n methods: ['PUT'],\n patterns: [\"_template/{id}\"],\n data_autocomplete_rules: {\n template: 'index*',\n warmers: { __scope_link: '_warmer' },\n mappings: { __scope_link: '_put_mapping' },\n settings: { __scope_link: '_put_settings' }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMl8wL3RlbXBsYXRlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGtCQUFrQixFQUFFO0FBQzdDLFdBQU8sRUFBRSxDQUFDLFFBQVEsQ0FBQztBQUNuQixZQUFRLEVBQUUsQ0FDUixnQkFBZ0IsQ0FDakI7R0FDRixDQUFDLENBQUM7QUFDSCxLQUFHLENBQUMsc0JBQXNCLENBQUMsZUFBZSxFQUFFO0FBQzFDLFdBQU8sRUFBRSxDQUFDLEtBQUssQ0FBQztBQUNoQixZQUFRLEVBQUUsQ0FDUixnQkFBZ0IsRUFDaEIsV0FBVyxDQUNaO0dBQ0YsQ0FBQyxDQUFDO0FBQ0gsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGVBQWUsRUFBRTtBQUMxQyxXQUFPLEVBQUUsQ0FBQyxLQUFLLENBQUM7QUFDaEIsWUFBUSxFQUFFLENBQ1IsZ0JBQWdCLENBQ2pCO0FBQ0QsMkJBQXVCLEVBQUU7QUFDdkIsY0FBUSxFQUFFLFFBQVE7QUFDbEIsYUFBTyxFQUFFLEVBQUMsWUFBWSxFQUFFLFNBQVMsRUFBQztB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YXBwaW5nJ30sXG4gICAgICBzZXR0aW5nczoge19fc2NvcGVfbGluazogJ19wdXRfc2V0dGluZ3MnfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/templates.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,kBAAkB,EAAE;AAC7C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,gBAAgB,CACjB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,gBAAgB,EAChB,WAAW,CACZ;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,gBAAgB,CACjB;AACD,2BAAuB,EAAE;AACvB,cAAQ,EAAE,QAAQ;AAClB,aAAO,EAAE,EAAC,YAAY,EAAE,SAAS,EAAC;AAClC,cAAQ,EAAE,EAAC,YAAY,EAAE,cAAc,EAAC;AACxC,cAAQ,EAAE,EAAC,YAAY,EAAE,eAAe,EAAC;KAC1C;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/templates.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_delete_template', {\n methods: ['DELETE'],\n patterns: [\n \"_template/{id}\",\n ]\n });\n api.addEndpointDescription('_get_template', {\n methods: ['GET'],\n patterns: [\n \"_template/{id}\",\n \"_template\",\n ]\n });\n api.addEndpointDescription('_put_template', {\n methods: ['PUT'],\n patterns: [\n \"_template/{id}\",\n ],\n data_autocomplete_rules: {\n template: 'index*',\n warmers: {__scope_link: '_warmer'},\n mappings: {__scope_link: '_put_mapping'},\n settings: {__scope_link: '_put_settings'}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/warmers.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_warmer', {\n patterns: [\"_warmer\", \"_warmer/{name}\", \"{indices}/_warmer\", \"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_delete_warmer', {\n methods: ['DELETE'],\n patterns: [\"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_put_warmer', {\n methods: ['PUT'],\n patterns: [\"{indices}/_warmer/{name}\", \"{indices}/{types}/_warmer/{name}\"],\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n // populated by a global rule\n },\n aggs: {},\n sort: {\n __scope_link: \"_search.sort\"\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZX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ZXRfd2FybWVyJywge1xuICAgIHBhdHRlcm5zOiBbXCJfd2FybWVyXCIsIFwiX3dhcm1lci97bmFtZX1cIiwgXCJ7aW5kaWNlc30vX3dhcm1lclwiLCBcIntpbmRpY2VzfS9fd2FybWVyL3tuYW1lfVwiXVxuICB9KTtcbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19kZWxldGVfd2FybWVyJywge1xuICAgIG1ldGhvZHM6IFsnREVMRVRFJ10sXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L193YXJtZXIve25hbWV9XCJcbiAgICBdXG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3B1dF93YXJtZXInLCB7XG4gICAgbWV0aG9kczogWydQVVQnXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJ7aW5kaWNlc30vX3dhcm1lci97bmFtZX1cIixcbiAgICAgIFwie2luZGljZXN9L3t0eXBlc30vX3dhcm1lci97bmFtZX1cIlxuICAgIF0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgIHF1ZXJ5OiB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9LFxuICAgICAgZmFjZXRzOiB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9LFxuICAgICAgYWdnczoge30sXG4gICAgICBzb3J0OiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogXCJfc2VhcmNoLnNvcnRcIlxuICAgICAgfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/warmers.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,YAAQ,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,0BAA0B,CAAC;GACzF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;AAC3C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,0BAA0B,CAC3B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,0BAA0B,EAC1B,kCAAkC,CACnC;AACD,2BAAuB,EAAE;AACvB,WAAK,EAAE;;OAEN;AACD,YAAM,EAAE;;OAEP;AACD,UAAI,EAAE,EAAE;AACR,UAAI,EAAE;AACJ,oBAAY,EAAE,cAAc;OAC7B;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_2_0/warmers.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_get_warmer', {\n patterns: [\"_warmer\", \"_warmer/{name}\", \"{indices}/_warmer\", \"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_delete_warmer', {\n methods: ['DELETE'],\n patterns: [\n \"{indices}/_warmer/{name}\"\n ]\n });\n api.addEndpointDescription('_put_warmer', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_warmer/{name}\",\n \"{indices}/{types}/_warmer/{name}\"\n ],\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n // populated by a global rule\n },\n aggs: {},\n sort: {\n __scope_link: \"_search.sort\"\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\nvar Api = require('./api');\n\nvar parts = [require('./es_1_0/aliases'), require('./es_1_0/aggregations'), require('./es_1_0/cat'), require('./es_1_0/cluster'), require('./es_1_0/count'), require('./es_1_0/document'), require('./es_1_0/facets'), require('./es_1_0/filter'), require('./es_1_0/nodes'), require('./es_1_0/globals'), require('./es_1_0/indices'), require('./es_1_0/mappings'), require('./es_1_0/percolator'), require('./es_1_0/query'), require('./es_1_0/snapshot_restore'), require('./es_1_0/search'), require('./es_1_0/settings'), require('./es_1_0/templates'), require('./es_1_0/warmers')];\n\nfunction ES_1_0() {\n Api.call(this, \"es_1_0\");\n _.each(parts, function (apiSection) {\n apiSection(this);\n }, this);\n}\n\nES_1_0.prototype = _.create(Api.prototype, { 'constructor': ES_1_0 });\n\n(function (cls) {\n cls.addEndpointDescription = function (endpoint, description) {\n if (description) {\n var url_params_def = {};\n _.each(description.patterns || [], function (p) {\n if (p.indexOf(\"{indices}\") >= 0) {\n url_params_def[\"ignore_unavailable\"] = \"__flag__\";\n url_params_def[\"allow_no_indices\"] = \"__flag__\";\n url_params_def[\"expand_wildcards\"] = [\"open\", \"closed\"];\n }\n });\n\n if (url_params_def) {\n description.url_params = description.url_params || {};\n _.defaults(description.url_params, url_params_def);\n }\n }\n Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);\n };\n})(ES_1_0.prototype);\n\nmodule.exports = new ES_1_0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A9IFwiX19mbGFnX19cIjtcbiAgICAgICAgICB1cmxfcGFyYW1zX2RlZltcImFsbG93X25vX2luZGljZXNcIl0gPSBcIl9fZmxhZ19fXCI7XG4gICAgICAgICAgdXJsX3BhcmFtc19kZWZbXCJleHBhbmRfd2lsZGNhcmRzXCJdID0gW1wib3BlblwiLCBcImNsb3NlZFwiXTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIGlmICh1cmxfcGFyYW1zX2RlZikge1xuICAgICAgICBkZXNjcmlwdGlvbi51cmxfcGFyYW1zID0gZGVzY3JpcHRpb24udXJsX3BhcmFtcyB8fCB7fTtcbiAgICAgICAgXy5kZWZhdWx0cyhkZXNjcmlwdGlvbi51cmxfcGFyYW1zLCB1cmxfcGFyYW1zX2RlZik7XG4gICAgICB9XG4gICAgfVxuICAgIE9iamVjdC5nZXRQcm90b3R5cGVPZihjbHMpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24uY2FsbCh0aGlzLCBlbmRwb2ludCwgZGVzY3JpcHRpb24pO1xuICB9O1xufSkoRVNfMV8wLnByb3RvdHlwZSk7XG5cbm1vZHVsZS5leHBvcnRzID0gbmV3IEVTXzFfMCgpO1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC1B,IAAI,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;AAE3B,IAAI,KAAK,GAAG,CACV,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,uBAAuB,CAAC,EAChC,OAAO,CAAC,cAAc,CAAC,EACvB,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,gBAAgB,CAAC,EACzB,OAAO,CAAC,mBAAmB,CAAC,EAC5B,OAAO,CAAC,iBAAiB,CAAC,EAC1B,OAAO,CAA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ACF,CAAC,CAAC;;AAEH,UAAI,cAAc,EAAE;AAClB,mBAAW,CAAC,UAAU,GAAG,WAAW,CAAC,UAAU,IAAI,EAAE,CAAC;AACtD,SAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;OACpD;KACF;AACD,UAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;GACrF,CAAC;CACH,CAAA,CAAE,MAAM,CAAC,SAAS,CAAC,CAAC;;AAErB,MAAM,CAAC,OAAO,GAAG,IAAI,MAAM,EAAE,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\nlet Api = require('./api');\n\nlet parts = [\n require('./es_1_0/aliases'),\n require('./es_1_0/aggregations'),\n require('./es_1_0/cat'),\n require('./es_1_0/cluster'),\n require('./es_1_0/count'),\n require('./es_1_0/document'),\n require('./es_1_0/facets'),\n require('./es_1_0/filter'),\n require('./es_1_0/nodes'),\n require('./es_1_0/globals'),\n require('./es_1_0/indices'),\n require('./es_1_0/mappings'),\n require('./es_1_0/percolator'),\n require('./es_1_0/query'),\n require('./es_1_0/snapshot_restore'),\n require('./es_1_0/search'),\n require('./es_1_0/settings'),\n require('./es_1_0/templates'),\n require('./es_1_0/warmers')\n];\n\nfunction ES_1_0() {\n Api.call(this, \"es_1_0\");\n _.each(parts, function (apiSection) {\n apiSection(this);\n }, this);\n}\n\nES_1_0.prototype = _.create(Api.prototype, {'constructor': ES_1_0});\n\n(function (cls) {\n cls.addEndpointDescription = function (endpoint, description) {\n if (description) {\n var url_params_def = {};\n _.each(description.patterns || [], function (p) {\n if (p.indexOf(\"{indices}\") >= 0) {\n url_params_def[\"ignore_unavailable\"] = \"__flag__\";\n url_params_def[\"allow_no_indices\"] = \"__flag__\";\n url_params_def[\"expand_wildcards\"] = [\"open\", \"closed\"];\n }\n });\n\n if (url_params_def) {\n description.url_params = description.url_params || {};\n _.defaults(description.url_params, url_params_def);\n }\n }\n Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);\n };\n})(ES_1_0.prototype);\n\nmodule.exports = new ES_1_0();\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/aliases.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_post_aliases', {\n methods: ['POST'],\n patterns: [\"_aliases\"],\n data_autocomplete_rules: {\n 'actions': {\n __template: [{ 'add': { 'index': 'test1', 'alias': 'alias1' } }],\n __any_of: [{\n add: {\n index: '{index}',\n alias: '',\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n },\n remove: {\n index: '',\n alias: ''\n }\n }]\n }\n }\n });\n api.addEndpointDescription('_get_aliases', {\n methods: ['GET'],\n patterns: [\"_aliases\"]\n });\n\n var aliasRules = {\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n };\n\n api.addEndpointDescription('_post_alias', {\n methods: [\"POST\", \"PUT\"],\n patterns: [\"{indices}/_alias/{name}\"],\n data_autocomplete_rules: aliasRules\n });\n api.addEndpointDescription('_delete_alias', {\n methods: [\"DELETE\"],\n patterns: [\"{indices}/_alias/{name}\"]\n });\n api.addEndpointDescription('_get_alias', {\n methods: [\"GET\"],\n patterns: [\"_alias\", \"{indices}/_alias\", \"{indices}/_alias/{name}\", \"_alias/{name}\"]\n });\n\n api.addGlobalAutocompleteRules('aliases', {\n '*': aliasRules\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2FsaWFzZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxlQUFlLEVBQUU7QUFDMUMsV0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDO0FBQ2pCLFlBQVEsRUFBRSxDQUNSLFVBQVUsQ0FDWDtBQUNELDJCQUF1QixFQUFFO0FBQ3ZCLGVBQVMsRUFBRTtBQUNULGtCQUFVLEVBQUUsQ0FDVixFQUFDLEtBQUssRUFBRSxFQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUUsT0FBTyxFQUFFLFFBQVEsRUFBQyxFQUFDLENBQy9DO0FBQ0QsZ0JBQVEsRUFBRSxDQUNSO0FBQ0UsYUFBRyxFQUFFO0FBQ0gsaUJBQUssRUFBRSxTQUFTO0FBQ2hCLGlCQUFLLEVBQUUsRUFBRTtBQUNULGtCQUFNLEVBQUUsRUFBRTtBQUNWLG1CQUFPLEVBQUUsR0FBRztBQUNaLDBCQUFjLEVBQUUsS0FBSztBQUNyQix5QkFBYSxFQUFFLEdBQUc7V0FDbkI7QUFDRCxnQkFBTSxFQUFFO0FBQ04saUJBQUssRUFBR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O0dBQ2hCLENBQUMsQ0FBQztDQUNKLENBQUMiLCJmaWxlIjoiL1VzZXJzL2dpbGx5Yi9kZXYvc2Vuc2l0aXZlL3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18xXzAvYWxpYXNlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGFwaSkge1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3Bvc3RfYWxpYXNlcycsIHtcbiAgICBtZXRob2RzOiBbJ1BPU1QnXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJfYWxpYXNlc1wiLFxuICAgIF0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgICdhY3Rpb25zJzoge1xuICAgICAgICBfX3RlbXBsYXRlOiBbXG4gICAgICAgICAgeydhZGQnOiB7J2luZGV4JzogJ3Rlc3QxJywgJ2FsaWFzJzogJ2FsaWFzMSd9fVxuICAgICAgICBdLFxuICAgICAgICBfX2FueV9vZjogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFkZDoge1xuICAgICAgICAgICAgICBpbmRleDogJ3tpbmRleH0nLFxuICAgICAgICAgICAgICBhbGlhczogJycsXG4gICAgICAgICAgICAgIGZpbHRlcjoge30sXG4gICAgICAgICAgICAgIHJvdXRpbmc6ICcxJyxcbiAgICAgICAgICAgICAgc2VhcmNoX3JvdXRpbmc6ICcxLDInLFxuICAgICAgICAgICAgICBpbmRleF9yb3V0aW5nOiAnMSdcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZW1vdmU6IHtcbiAgICAgICAgICAgICAgaW5kZXg6ICcnLFxuICAgICAgICAgICAgICBhbGlhczogJydcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZ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lhc1J1bGVzXG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/aliases.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,UAAU,CACX;AACD,2BAAuB,EAAE;AACvB,eAAS,EAAE;AACT,kBAAU,EAAE,CACV,EAAC,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAC,EAAC,CAC/C;AACD,gBAAQ,EAAE,CACR;AACE,aAAG,EAAE;AACH,iBAAK,EAAE,SAAS;AAChB,iBAAK,EAAE,EAAE;AACT,kBAAM,EAAE,EAAE;AACV,mBAAO,EAAE,GAAG;AACZ,0BAAc,EAAE,KAAK;AACrB,yBAAa,EAAE,GAAG;WACnB;AACD,gBAAM,EAAE;AACN,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,EAAE;WACV;SACF,CACF;OACF;KACF;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,UAAU,CACX;GACF,CAAC,CAAC;;AAEH,MAAI,UAAU,GAAG;AACf,UAAM,EAAE,EAAE;AACV,WAAO,EAAE,GAAG;AACZ,kBAAc,EAAE,KAAK;AACrB,iBAAa,EAAE,GAAG;GACnB,CAAC;;AAEF,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,WAAO,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACxB,YAAQ,EAAE,CACR,yBAAyB,CAC1B;AACD,2BAAuB,EAAE,UAAU;GACpC,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,yBAAyB,CAC1B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,YAAY,EAAE;AACvC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,CAChB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,0BAA0B,CAAC,SAAS,EAAE;AACxC,OAAG,EAAE,UAAU;GAChB,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/aliases.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_post_aliases', {\n methods: ['POST'],\n patterns: [\n \"_aliases\",\n ],\n data_autocomplete_rules: {\n 'actions': {\n __template: [\n {'add': {'index': 'test1', 'alias': 'alias1'}}\n ],\n __any_of: [\n {\n add: {\n index: '{index}',\n alias: '',\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n },\n remove: {\n index: '',\n alias: ''\n }\n }\n ]\n }\n }\n });\n api.addEndpointDescription('_get_aliases', {\n methods: ['GET'],\n patterns: [\n \"_aliases\",\n ]\n });\n\n var aliasRules = {\n filter: {},\n routing: '1',\n search_routing: '1,2',\n index_routing: '1'\n };\n\n api.addEndpointDescription('_post_alias', {\n methods: [\"POST\", \"PUT\"],\n patterns: [\n \"{indices}/_alias/{name}\"\n ],\n data_autocomplete_rules: aliasRules\n });\n api.addEndpointDescription('_delete_alias', {\n methods: [\"DELETE\"],\n patterns: [\n \"{indices}/_alias/{name}\"\n ]\n });\n api.addEndpointDescription('_get_alias', {\n methods: [\"GET\"],\n patterns: [\n \"_alias\",\n \"{indices}/_alias\",\n \"{indices}/_alias/{name}\",\n \"_alias/{name}\"\n ]\n });\n\n api.addGlobalAutocompleteRules('aliases', {\n '*': aliasRules\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/aggregations.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar simple_metric = {\n __template: { field: \"\" },\n field: \"{field}\",\n script: \"\",\n params: {},\n lang: \"groovy\"\n},\n field_metric = {\n __template: { field: \"\" },\n field: \"{field}\"\n};\nvar rules = {\n \"*\": {\n \"aggs\": {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n \"min\": simple_metric,\n \"max\": simple_metric,\n \"avg\": simple_metric,\n \"stats\": simple_metric,\n \"extended_stats\": simple_metric,\n \"value_count\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"global\": {},\n \"filter\": {},\n \"missing\": field_metric,\n \"nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"reverse_nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"terms\": {\n __template: {\n \"field\": \"\",\n \"size\": 10\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"order\": {\n __template: {\n \"_term\": \"asc\"\n },\n \"_term\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"min_doc_count\": 10,\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\",\n // TODO: these also support regex - extend!\n \"include\": \"*\",\n \"exclude\": \"*\",\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\", \"global_ordinals_low_cardinality\"] },\n \"show_term_doc_count_error\": { __one_of: [true, false] },\n \"collect_mode\": { __one_of: [\"depth_first\", \"breadth_first\"] }\n },\n \"significant_terms\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"shard_min_doc_count\": 10,\n \"min_doc_count\": 10,\n \"include\": { __one_of: [\"*\", { pattern: \"\", flags: \"\" }] },\n \"exclude\": { __one_of: [\"*\", { pattern: \"\", flags: \"\" }] },\n \"execution_hint\": { __one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\"] },\n \"background_filter\": {\n __scope_link: \"GLOBAL.filter\"\n },\n \"mutual_information\": {\n \"include_negatives\": { __one_of: [true, false] }\n },\n \"chi_square\": {\n \"include_negatives\": { __one_of: [true, false] },\n \"background_is_superset\": { __one_of: [true, false] }\n },\n \"gnd\": {\n \"background_is_superset\": { __one_of: [true, false] }\n }\n },\n \"range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": 50, \"to\": 100 }]\n },\n \"field\": \"{field}\",\n \"ranges\": [{ \"to\": 50, \"from\": 100, \"key\": \"\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"date_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": \"now-10d/d\", \"to\": \"now\" }]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [{ \"to\": \"\", \"from\": \"\", \"key\": \"\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"ip_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [{ \"from\": \"10.0.0.5\", \"to\": \"10.0.0.10\" }]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [{ \"to\": \"\", \"from\": \"\", \"key\": \"\", \"mask\": \"10.0.0.127/25\" }],\n \"keyed\": { __one_of: [true, false] },\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"histogram\": {\n __template: {\n \"field\": \"price\",\n \"interval\": 50\n },\n \"field\": \"{field}\",\n \"interval\": 50,\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"keyed\": { __one_of: [true, false] }\n\n },\n \"date_histogram\": {\n __template: {\n \"field\": \"date\",\n \"interval\": \"month\"\n },\n \"field\": \"{field}\",\n \"interval\": { __one_of: [\"year\", \"quarter\", \"week\", \"day\", \"hour\", \"minute\", \"second\"] },\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": { __one_of: [\"asc\", \"desc\"] },\n \"_count\": { __one_of: [\"asc\", \"desc\"] },\n \"*\": { __one_of: [\"asc\", \"desc\"] }\n },\n \"keyed\": { __one_of: [true, false] },\n \"pre_zone\": \"-01:00\",\n \"post_zone\": \"-01:00\",\n \"pre_zone_adjust_large_interval\": { __one_of: [true, false] },\n \"factor\": 1000,\n \"pre_offset\": \"1d\",\n \"post_offset\": \"1d\",\n \"format\": \"yyyy-MM-dd\",\n \"time_zone\": \"00:00\"\n },\n \"geo_distance\": {\n __template: {\n \"field\": \"location\",\n \"origin\": { \"lat\": 52.3760, \"lon\": 4.894 },\n \"ranges\": [{ \"from\": 100, \"to\": 300 }]\n },\n \"field\": \"{field}\",\n \"origin\": { \"lat\": 0.0, \"lon\": 0.0 },\n \"unit\": { __one_of: [\"mi\", \"km\", \"in\", \"yd\", \"m\", \"cm\", \"mm\"] },\n \"ranges\": [{ \"from\": 50, \"to\": 100 }],\n \"distance_type\": { __one_of: [\"arc\", \"sloppy_arc\", \"plane\"] }\n\n },\n \"geohash_grid\": {\n __template: {\n \"field\": \"\",\n \"precision\": 3\n },\n \"field\": \"{field}\",\n \"precision\": { __one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },\n \"size\": 10,\n \"shard_size\": 10\n },\n \"percentiles\": {\n __template: {\n \"field\": \"\",\n \"percents\": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]\n },\n \"field\": \"{field}\",\n \"percents\": {\n __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],\n // mark type as list\n __any_of: []\n },\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\",\n \"compression\": 100\n },\n \"cardinality\": {\n __template: {\n \"field\": \"\"\n },\n \"precision_threshold\": 100,\n \"rehash\": true,\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"scripted_metric\": {\n __template: {\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\"\n },\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\",\n \"lang\": \"groovy\",\n \"params\": {},\n \"reduce_params\": {},\n \"init_script_file\": \"\",\n \"init_script_id\": \"\",\n \"map_script_file\": \"\",\n \"map_script_id\": \"\",\n \"combine_script_file\": \"\",\n \"combine_script_id\": \"\",\n \"reduce_script_file\": \"\",\n \"reduce_script_id\": \"\"\n },\n \"geo_bounds\": {\n __template: {\n field: \"\"\n },\n field: \"{field}\",\n wrap_longitude: { __one_of: [true, false] }\n },\n \"top_hits\": {\n __template: {\n size: 10\n },\n from: 0,\n size: 10,\n sort: {\n __template: [],\n __scope_link: \"_search.sort\"\n },\n highlight: {},\n explain: { __one_of: [true, false] },\n _source: {\n __template: \"\",\n __scope_link: \"_search._source\"\n },\n script_fields: {\n __scope_link: \"_search.script_fields\"\n },\n fielddata_fields: [\"{field}\"],\n version: { __one_of: [true, false] }\n },\n \"percentile_ranks\": {\n __template: {\n field: \"\",\n values: [10, 15]\n },\n field: \"{field}\",\n values: []\n }\n }\n};\nmodule.exports = function (api) {\n\n api.addGlobalAutocompleteRules('aggregations', rules);\n api.addGlobalAutocompleteRules('aggs', rules);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2FnZ3JlZ2F0aW9ucy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksYUFBYSxHQUFHO0FBQ2xCLFlBQVUsRUFBRSxFQUFDLEtBQUssRUFBRSxFQUFFLEVBQUM7QUFDdkIsT0FBSyxFQUFFLFNBQVM7QUFDaEIsUUFBTSxFQUFFLEVBQUU7QUFDVixRQUFNLEVBQUUsRUFBRTtBQUNWLE1BQUksRUFBRSxRQUFRO0NBQ2Y7SUFBRSxZQUFZLEdBQUc7QUFDaEIsWUFBVSxFQUFFLEVBQUMsS0FBSyxFQUFFLEVBQUUsRUFBQztBQUN2QixPQUFLLEVBQUUsU0FBUztDQUNqQixDQUFDO0FBQ0YsSUFBSSxLQUFLLEdBQUc7QUFDVixLQUFHLEVBQUU7QUFDSCxVQUFNLEVBQUU7QUFDTixnQkFBVSxFQUFFO0FBQ1YsY0F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sXG4gICAgICBcImludGVydmFsXCI6IDUwLFxuICAgICAgXCJtaW5fZG9jX2NvdW50XCI6IDAsXG4gICAgICBcIm9yZGVyXCI6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIFwiX2tleVwiOiBcImFzY1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiX2tleVwiOiB7X19vbmVfb2Y6IFtcImFzY1wiLCBcImRlc2NcIl19LFxuICAgICAgICBcIl9jb3VudFwiOiB7X19vbmVfb2Y6IFtcImFzY1wiLCBcImRlc2NcIl19LFxuICAgICAgICBcIipcIjoge19fb25lX29mOiBbXCJhc2NcIiwgXCJkZXNjXCJdfVxuICAgICAgfSxcbiAgICAgIFwia2V5ZWRcIjoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfVxuXG4gICAgfSxcbiAgICBcImRhdGVfaGlzdG9ncmFtXCI6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgXCJmaWVsZFwiOiBcImRhdGVcIixcbiAgICAgICAgXCJpbnRlcnZhbFwiOiBcIm1vbnRoXCJcbiAgICAgIH0sXG4gICAgICBcImZpZWxkXCI6IFwie2ZpZWxkfVwiLFxuICAgICAgXCJpbnRlcnZhbFwiOiB7X19vbmVfb2Y6IFtcInllYXJcIiwgXCJxdWFydGVyXCIsIFwid2Vla1wiLCBcImRheVwiLCBcImhvdXJcIiwgXCJtaW51dGVcIiwgXCJzZWNvbmRcIl19LFxuICAgICAgXCJtaW5fZG9jX2NvdW50XCI6IDAsXG4gICAgICBcIm9yZGVyXCI6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIFwiX2tleVwiOiBcImFzY1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiX2tleVwiOiB7X19vbmVfb2Y6IFtcImFzY1wiLCBcImRlc2NcIl19LFxuICAgICAgICBcIl9jb3VudFwiOiB7X19vbmVfb2Y6IFtcImFzY1wiLCBcImRlc2NcIl19LFxuICAgICAgICBcIipcIjoge19fb25lX29mOiBbXCJhc2NcIiwgXCJkZXNjXCJdfVxuICAgICAgfSxcbiAgICAgIFwia2V5ZWRcIjoge19fb25lX29mOiBbdHJ1ZSwgZmFsc2VdfSxcbiAgICAgIFwicHJlX3pvbmVcIjogXCItMDE6MDBcIixcbiAgICAgIFwicG9zdF96b25lXCI6IFwiLTAxOjAwXCIsXG4gICAgICBcInByZV96b25lX2FkanVzdF9sYXJnZV9pbnRlcnZhbFwiOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgXCJmYWN0b3JcIjogMTAwMCxcbiAgICAgIFwicHJlX29mZnNldFwiOiBcIjFkXCIsXG4gICAgICBcInBvc3Rfb2Zmc2V0XCI6IFwiMWRcIixcbiAgICAgIFwiZm9ybWF0XCI6IFwieXl5eS1NTS1kZFwiLFxuICAgICAgXCJ0aW1lX3pvbmVcIjogXCIwMDowMFwiXG4gICAgfSxcbiAgICBcImdlb19kaXN0YW5jZVwiOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIFwiZmllbGRcIjogXCJsb2NhdGlvblwiLFxuICAgICAgICBcIm9yaWdpblwiOiB7XCJsYXRcIjogNTIuMzc2MCwgXCJsb25cIjogNC44OTR9LFxuICAgICAgICBcInJhbmdlc1wiOiBbXG4gICAgICAgICAge1wiZnJvbVwiOiAxMDAsIFwidG9cIjogMzAwfSxcbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIFwiZmllbGRcIjogXCJ7ZmllbGR9XCIsXG4gICAgICBcIm9yaWdpblwiOiB7XCJsYXRcIjogMC4wLCBcImxvblwiOiAwLjB9LFxuICAgICAgXCJ1bml0XCI6IHtfX29uZV9vZjogW1wibWlcIiwgXCJrbVwiLCBcImluXCIsIFwieWRcIiwgXCJtXCIsIFwiY21cIiwgXCJtbVwiXX0sXG4gICAgICBcInJhbmdlc1wiOiBbXG4gICAgICAgIHtcImZyb21cIjogNTAsIFwidG9cIjogMTAwfVxuIC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3RlbXBsYXRlOiB7XG4gICAgICAgIGZpZWxkOiBcIlwiLFxuICAgICAgICB2YWx1ZXM6IFsxMCwgMTVdXG4gICAgICB9LFxuICAgICAgZmllbGQ6IFwie2ZpZWxkfVwiLFxuICAgICAgdmFsdWVzOiBbXVxuICAgIH1cbiAgfVxufTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGFwaSkge1xuXG4gIGFwaS5hZGRHbG9iYWxBdXRvY29tcGxldGVSdWxlcygnYWdncmVnYXRpb25zJywgcnVsZXMpO1xuICBhcGkuYWRkR2xvYmFsQXV0b2NvbXBsZXRlUnVsZXMoJ2FnZ3MnLCBydWxlcyk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/aggregations.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,aAAa,GAAG;AAClB,YAAU,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;AACvB,OAAK,EAAE,SAAS;AAChB,QAAM,EAAE,EAAE;AACV,QAAM,EAAE,EAAE;AACV,MAAI,EAAE,QAAQ;CACf;IAAE,YAAY,GAAG;AAChB,YAAU,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;AACvB,OAAK,EAAE,SAAS;CACjB,CAAC;AACF,IAAI,KAAK,GAAG;AACV,KAAG,EAAE;AACH,UAAM,EAAE;AACN,gBAAU,EAAE;AACV,cAAM,EAAE;AACN,oBAAU,EAAE,EAAE;SACf;OACF;KACF;AACD,SAAK,EAAE,aAAa;AACpB,SAAK,EAAE,aAAa;AACpB,SAAK,EAAE,aAAa;AACpB,WAAO,EAAE,aAAa;AACtB,oBAAgB,EAAE,aAAa;AAC/B,iBAAa,EAAE;AACb,gBAAU,EAAE;AACV,eAAO,EAAE,EAAE;OACZ;AACD,aAAO,EAAE,SAAS;AAClB,cAAQ,EAAE,QAAQ;AAClB,iBAAW,EAAE,EAAE;AACf,cAAQ,EAAE,EAAE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AE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;KAC1C;AACD,cAAU,EAAE;AACV,gBAAU,EAAE;AACV,YAAI,EAAE,EAAE;OACT;AACD,UAAI,EAAE,CAAC;AACP,UAAI,EAAE,EAAE;AACR,UAAI,EAAE;AACJ,kBAAU,EAAE,EAAE;AACd,oBAAY,EAAE,cAAc;OAC7B;AACD,eAAS,EAAE,EAAE;AACb,aAAO,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;AAClC,aAAO,EAAE;AACP,kBAAU,EAAE,EAAE;AACd,oBAAY,EAAE,iBAAiB;OAChC;AACD,mBAAa,EAAE;AACb,oBAAY,EAAE,uBAAuB;OACtC;AACD,sBAAgB,EAAE,CAAC,SAAS,CAAC;AAC7B,aAAO,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;KACnC;AACD,sBAAkB,EAAE;AAClB,gBAAU,EAAE;AACV,aAAK,EAAE,EAAE;AACT,cAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;OACjB;AACD,WAAK,EAAE,SAAS;AAChB,YAAM,EAAE,EAAE;KACX;GACF;CACF,CAAC;AACF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;;AAE9B,KAAG,CAAC,0BAA0B,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;AACtD,KAAG,CAAC,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC/C,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/aggregations.js", + "sourcesContent": [ + "var simple_metric = {\n __template: {field: \"\"},\n field: \"{field}\",\n script: \"\",\n params: {},\n lang: \"groovy\"\n}, field_metric = {\n __template: {field: \"\"},\n field: \"{field}\"\n};\nvar rules = {\n \"*\": {\n \"aggs\": {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n \"min\": simple_metric,\n \"max\": simple_metric,\n \"avg\": simple_metric,\n \"stats\": simple_metric,\n \"extended_stats\": simple_metric,\n \"value_count\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"global\": {},\n \"filter\": {},\n \"missing\": field_metric,\n \"nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"reverse_nested\": {\n __template: {\n \"path\": \"\"\n },\n \"path\": \"\"\n },\n \"terms\": {\n __template: {\n \"field\": \"\",\n \"size\": 10\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"order\": {\n __template: {\n \"_term\": \"asc\"\n },\n \"_term\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"min_doc_count\": 10,\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\",\n // TODO: these also support regex - extend!\n \"include\": \"*\",\n \"exclude\": \"*\",\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\", \"global_ordinals_low_cardinality\"]},\n \"show_term_doc_count_error\": {__one_of: [true, false]},\n \"collect_mode\": {__one_of: [\"depth_first\", \"breadth_first\"]}\n },\n \"significant_terms\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"size\": 10,\n \"shard_size\": 10,\n \"shard_min_doc_count\": 10,\n \"min_doc_count\": 10,\n \"include\": {__one_of: [\"*\", {pattern: \"\", flags: \"\"}]},\n \"exclude\": {__one_of: [\"*\", {pattern: \"\", flags: \"\"}]},\n \"execution_hint\": {__one_of: [\"map\", \"global_ordinals\", \"global_ordinals_hash\"]},\n \"background_filter\": {\n __scope_link: \"GLOBAL.filter\"\n },\n \"mutual_information\": {\n \"include_negatives\": {__one_of: [true, false]}\n },\n \"chi_square\": {\n \"include_negatives\": {__one_of: [true, false]},\n \"background_is_superset\": {__one_of: [true, false]}\n },\n \"gnd\": {\n \"background_is_superset\": {__one_of: [true, false]}\n }\n },\n \"range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": 50, \"to\": 100},\n ]\n },\n \"field\": \"{field}\",\n \"ranges\": [\n {\"to\": 50, \"from\": 100, \"key\": \"\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"date_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": \"now-10d/d\", \"to\": \"now\"},\n ]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [\n {\"to\": \"\", \"from\": \"\", \"key\": \"\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"ip_range\": {\n __template: {\n \"field\": \"\",\n \"ranges\": [\n {\"from\": \"10.0.0.5\", \"to\": \"10.0.0.10\"},\n ]\n },\n \"field\": \"{field}\",\n \"format\": \"MM-yyy\",\n \"ranges\": [\n {\"to\": \"\", \"from\": \"\", \"key\": \"\", \"mask\": \"10.0.0.127/25\"}\n ],\n \"keyed\": {__one_of: [true, false]},\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"histogram\": {\n __template: {\n \"field\": \"price\",\n \"interval\": 50\n },\n \"field\": \"{field}\",\n \"interval\": 50,\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"keyed\": {__one_of: [true, false]}\n\n },\n \"date_histogram\": {\n __template: {\n \"field\": \"date\",\n \"interval\": \"month\"\n },\n \"field\": \"{field}\",\n \"interval\": {__one_of: [\"year\", \"quarter\", \"week\", \"day\", \"hour\", \"minute\", \"second\"]},\n \"min_doc_count\": 0,\n \"order\": {\n __template: {\n \"_key\": \"asc\"\n },\n \"_key\": {__one_of: [\"asc\", \"desc\"]},\n \"_count\": {__one_of: [\"asc\", \"desc\"]},\n \"*\": {__one_of: [\"asc\", \"desc\"]}\n },\n \"keyed\": {__one_of: [true, false]},\n \"pre_zone\": \"-01:00\",\n \"post_zone\": \"-01:00\",\n \"pre_zone_adjust_large_interval\": {__one_of: [true, false]},\n \"factor\": 1000,\n \"pre_offset\": \"1d\",\n \"post_offset\": \"1d\",\n \"format\": \"yyyy-MM-dd\",\n \"time_zone\": \"00:00\"\n },\n \"geo_distance\": {\n __template: {\n \"field\": \"location\",\n \"origin\": {\"lat\": 52.3760, \"lon\": 4.894},\n \"ranges\": [\n {\"from\": 100, \"to\": 300},\n ]\n },\n \"field\": \"{field}\",\n \"origin\": {\"lat\": 0.0, \"lon\": 0.0},\n \"unit\": {__one_of: [\"mi\", \"km\", \"in\", \"yd\", \"m\", \"cm\", \"mm\"]},\n \"ranges\": [\n {\"from\": 50, \"to\": 100}\n ],\n \"distance_type\": {__one_of: [\"arc\", \"sloppy_arc\", \"plane\"]}\n\n },\n \"geohash_grid\": {\n __template: {\n \"field\": \"\",\n \"precision\": 3\n },\n \"field\": \"{field}\",\n \"precision\": {__one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},\n \"size\": 10,\n \"shard_size\": 10\n },\n \"percentiles\": {\n __template: {\n \"field\": \"\",\n \"percents\": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]\n },\n \"field\": \"{field}\",\n \"percents\": {\n __template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],\n // mark type as list\n __any_of: []\n },\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\",\n \"compression\": 100\n },\n \"cardinality\": {\n __template: {\n \"field\": \"\"\n },\n \"precision_threshold\": 100,\n \"rehash\": true,\n \"script\": \"_value\",\n \"script_id\": \"\",\n \"params\": {},\n \"lang\": \"groovy\"\n },\n \"scripted_metric\": {\n __template: {\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\"\n },\n \"init_script\": \"\",\n \"map_script\": \"\",\n \"combine_script\": \"\",\n \"reduce_script\": \"\",\n \"lang\": \"groovy\",\n \"params\": {},\n \"reduce_params\": {},\n \"init_script_file\": \"\",\n \"init_script_id\": \"\",\n \"map_script_file\": \"\",\n \"map_script_id\": \"\",\n \"combine_script_file\": \"\",\n \"combine_script_id\": \"\",\n \"reduce_script_file\": \"\",\n \"reduce_script_id\": \"\"\n },\n \"geo_bounds\": {\n __template: {\n field: \"\"\n },\n field: \"{field}\",\n wrap_longitude: {__one_of: [true, false]}\n },\n \"top_hits\": {\n __template: {\n size: 10\n },\n from: 0,\n size: 10,\n sort: {\n __template: [],\n __scope_link: \"_search.sort\"\n },\n highlight: {},\n explain: {__one_of: [true, false]},\n _source: {\n __template: \"\",\n __scope_link: \"_search._source\"\n },\n script_fields: {\n __scope_link: \"_search.script_fields\"\n },\n fielddata_fields: [\"{field}\"],\n version: {__one_of: [true, false]}\n },\n \"percentile_ranks\": {\n __template: {\n field: \"\",\n values: [10, 15]\n },\n field: \"{field}\",\n values: []\n }\n }\n};\nmodule.exports = function (api) {\n\n api.addGlobalAutocompleteRules('aggregations', rules);\n api.addGlobalAutocompleteRules('aggs', rules);\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/cat.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nvar _ = require(\"lodash\");\n\nfunction addSimpleCat(endpoint, api, params, patterns) {\n var url_params = { \"help\": \"__flag__\", \"v\": \"__flag__\", \"bytes\": [\"b\"] };\n _.each(params || [], function (p) {\n if (_.isString(p)) {\n url_params[p] = \"__flag__\";\n } else {\n var k = Object.keys(p)[0];\n url_params[k] = p[k];\n }\n });\n api.addEndpointDescription(endpoint, {\n match: endpoint,\n url_params: url_params,\n patterns: patterns || [endpoint]\n });\n}\n\nmodule.exports = function (api) {\n addSimpleCat('_cat/aliases', api);\n addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);\n addSimpleCat('_cat/count', api);\n addSimpleCat('_cat/health', api, [{ \"ts\": [\"false\", \"true\"] }]);\n addSimpleCat('_cat/indices', api, [{ h: [] }, \"pri\"], ['_cat/indices', '_cat/indices/{indices}']);\n addSimpleCat('_cat/master', api);\n addSimpleCat('_cat/nodes', api);\n addSimpleCat('_cat/pending_tasks', api);\n addSimpleCat('_cat/recovery', api);\n addSimpleCat('_cat/thread_pool', api);\n addSimpleCat('_cat/shards', api);\n addSimpleCat('_cat/plugins', api);\n addSimpleCat('_cat/segments', api);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2NhdC5qcyJdLCJuYW1lcyI6W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ZGRTaW1wbGVDYXQoJ19jYXQvaW5kaWNlcycsIGFwaSwgW1xuICAgICAge2g6IFtdfSxcbiAgICAgIFwicHJpXCIsXG4gICAgXSxcbiAgICBbJ19jYXQvaW5kaWNlcycsICdfY2F0L2luZGljZXMve2luZGljZXN9J10pO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvbWFzdGVyJywgYXBpKTtcbiAgYWRkU2ltcGxlQ2F0KCdfY2F0L25vZGVzJywgYXBpKTtcbiAgYWRkU2ltcGxlQ2F0KCdfY2F0L3BlbmRpbmdfdGFza3MnLCBhcGkpO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvcmVjb3ZlcnknLCBhcGkpO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvdGhyZWFkX3Bvb2wnLCBhcGkpO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvc2hhcmRzJywgYXBpKTtcbiAgYWRkU2ltcGxlQ2F0KCdfY2F0L3BsdWdpbnMnLCBhcGkpO1xuICBhZGRTaW1wbGVDYXQoJ19jYXQvc2VnbWVudHMnLCBhcGkpO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/cat.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,SAAS,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE;AACrD,MAAI,UAAU,GAAG,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAC,CAAC;AACvE,GAAC,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,UAAU,CAAC,EAAE;AAChC,QAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;AACjB,gBAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;KAC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e,EAAE,GAAG,CAAC,CAAC;CACpC,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/cat.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nfunction addSimpleCat(endpoint, api, params, patterns) {\n var url_params = {\"help\": \"__flag__\", \"v\": \"__flag__\", \"bytes\": [\"b\"]};\n _.each(params || [], function (p) {\n if (_.isString(p)) {\n url_params[p] = \"__flag__\";\n }\n else {\n var k = Object.keys(p)[0];\n url_params[k] = p[k];\n }\n });\n api.addEndpointDescription(endpoint, {\n match: endpoint,\n url_params: url_params,\n patterns: patterns || [endpoint]\n });\n}\n\nmodule.exports = function (api) {\n addSimpleCat('_cat/aliases', api);\n addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);\n addSimpleCat('_cat/count', api);\n addSimpleCat('_cat/health', api, [\n {\"ts\": [\"false\", \"true\"]}\n ]);\n addSimpleCat('_cat/indices', api, [\n {h: []},\n \"pri\",\n ],\n ['_cat/indices', '_cat/indices/{indices}']);\n addSimpleCat('_cat/master', api);\n addSimpleCat('_cat/nodes', api);\n addSimpleCat('_cat/pending_tasks', api);\n addSimpleCat('_cat/recovery', api);\n addSimpleCat('_cat/thread_pool', api);\n addSimpleCat('_cat/shards', api);\n addSimpleCat('_cat/plugins', api);\n addSimpleCat('_cat/segments', api);\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/cluster.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_cluster/nodes/stats');\n api.addEndpointDescription('_cluster/state', {\n patterns: [\"_cluster/state\", \"_cluster/state/{metrics}\", \"_cluster/state/{metrics}/{indices}\"],\n url_components: {\n \"metrics\": [\"version\", \"master_node\", \"nodes\", \"routing_table\", \"metadata\", \"blocks\"]\n }\n });\n api.addEndpointDescription('_cluster/health', {\n url_params: {\n \"local\": \"__flag__\",\n \"level\": [\"indices\", \"shards\"],\n \"master_timeout\": \"30s\",\n \"timeout\": \"30s\",\n \"wait_for_status\": [\"yellow\", \"green\"],\n \"wait_for_relocating_shards\": 0,\n \"wait_for_active_shards\": 0,\n \"wait_for_nodes\": 0\n }\n });\n api.addEndpointDescription('_cluster/pending_tasks');\n api.addEndpointDescription('get_cluster/settings', {\n patterns: ['_cluster/settings']\n });\n\n api.addEndpointDescription('put_cluster/settings', {\n methods: ['PUT'],\n patterns: ['_cluster/settings'],\n data_autocomplete_rules: {\n persistent: {\n cluster: {\n routing: {\n 'allocation.enable': { __one_of: [\"all\", \"primaries\", \"new_primaries\", \"none\"] },\n 'allocation.disk.threshold_enabled': { __one_of: [false, true] },\n 'allocation.disk.watermark.low': '85%',\n 'allocation.disk.watermark.high': '90%',\n 'allocation.disk.include_relocations': { __one_of: [true, false] },\n 'allocation.disk.reroute_interval': '60s',\n 'allocation.exclude': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.include': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.require': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.awareness.attributes': [],\n 'allocation.awareness.force': {\n '*': {\n 'values': []\n }\n },\n 'allocation.allow_rebalance': { __one_of: ['always', 'indices_primaries_active', 'indices_all_active'] },\n 'allocation.cluster_concurrent_rebalance': 2,\n 'allocation.node_initial_primaries_recoveries': 4,\n 'allocation.node_concurrent_recoveries': 2,\n 'allocation.same_shard.host': { __one_of: [false, true] }\n }\n },\n indices: {\n breaker: {\n \"total.limit\": \"70%\",\n \"fielddata.limit\": \"60%\",\n \"fielddata.overhead\": 1.03,\n \"request.limit\": \"40%\",\n \"request.overhead\": 1.0\n }\n }\n },\n transient: {\n __scope_link: '.persistent'\n }\n }\n });\n\n api.addEndpointDescription('_cluster/reroute', {\n methods: ['POST'],\n url_params: {\n explain: \"__flag__\",\n dry_run: \"__flag__\"\n },\n data_autocomplete_rules: {\n commands: [{\n move: {\n __template: {\n index: \"\",\n shard: 0,\n from_node: \"\",\n to_node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n from_node: \"{node}\",\n to_node: \"{node}\"\n },\n cancel: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: { __one_of: [true, false] }\n },\n allocate: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: { __one_of: [true, false] }\n }\n }],\n dry_run: { __one_of: [true, false] }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2NsdXN0ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQyxzQkFBc0Is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sXG4gICAgICAgICAgICAgICdfaG9zdCc6IFwiXCIsXG4gICAgICAgICAgICAgICdfaWQnOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uaW5jbHVkZSc6IHtcbiAgICAgICAgICAgICAgJ19pcCc6IFwiXCIsXG4gICAgICAgICAgICAgICdfbmFtZSc6IFwiXCIsXG4gICAgICAgICAgICAgICdfaG9zdCc6IFwiXCIsXG4gICAgICAgICAgICAgICdfaWQnOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24ucmVxdWlyZSc6IHtcbiAgICAgICAgICAgICAgJ19pcCc6IFwiXCIsXG4gICAgICAgICAgICAgICdfbmFtZSc6IFwiXCIsXG4gICAgICAgICAgICAgICdfaG9zdCc6IFwiXCIsXG4gICAgICAgICAgICAgICdfaWQnOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FsbG9jYXRpb24uYXdhcmVuZXNzLmF0dHJpYnV0ZXMnOiBbXSxcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLmF3YXJlbmVzcy5mb3JjZSc6IHtcbiAgICAgICAgICAgICAgJyonOiB7XG4gICAgICAgICAgICAgICAgJ3ZhbHVlcyc6IFtdXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5hbGxvd19yZWJhbGFuY2UnOiB7X19vbmVfb2Y6IFsnYWx3YXlzJywgJ2luZGljZXNfcHJpbWFyaWVzX2FjdGl2ZScsICdpbmRpY2VzX2FsbF9hY3RpdmUnXX0sXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5jbHVzdGVyX2NvbmN1cnJlbnRfcmViYWxhbmNlJzogMixcbiAgICAgICAgICAgICdhbGxvY2F0aW9uLm5vZGVfaW5pdGlhbF9wcmltYXJpZXNfcmVjb3Zlcmllcyc6IDQsXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5ub2RlX2NvbmN1cnJlbnRfcmVjb3Zlcmllcyc6IDIsXG4gICAgICAgICAgICAnYWxsb2NhdGlvbi5zYW1lX3NoYXJkLmhvc3QnOiB7X19vbmVfb2Y6IFtmYWxzZSwgdHJ1ZV19XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpbmRpY2VzOiB7XG4gICAgICAgICAgYnJlYWtlcjoge1xuICAgICAgICAgICAgXCJ0b3RhbC5saW1pdFwiOiBcIjcwJVwiLFxuICAgICAgICAgICAgXCJmaWVsZGRhdGEubGltaXRcIjogXCI2MCVcIixcbiAgICAgICAgICAgIFwiZmllbGRkYXRhLm92ZXJoZWFkXCI6IDEuMDMsXG4gICAgICAgICAgICBcInJlcXVlc3QubGltaXRcIjogXCI0MCVcIixcbiAgICAgICAgICAgIFwicmVxdWVzdC5vdmVyaGVhZFwiOiAxLjBcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICB0cmFuc2llbnQ6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnLnBlcnNpc3RlbnQnXG4gICAgICB9XG4gICAgfVxuICB9KTtcblxuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX2NsdXN0ZXIvcmVyb3V0ZScsIHtcbiAgICBtZXRob2RzOiBbJ1BPU1QnXSxcbiAgICB1cmxfcGFyYW1zOiB7XG4gICAgICBleHBsYWluOiBcIl9fZmxhZ19fXCIsXG4gICAgICBkcnlfcnVuOiBcIl9fZmxhZ19fXCJcbiAgICB9LFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBjb21tYW5kczogW1xuICAgICAgICB7XG4gICAgICAgICAgbW92ZToge1xuICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICBpbmRleDogXCJcIixcbiAgICAgICAgICAgICAgc2hhcmQ6IDAsXG4gICAgICAgICAgICAgIGZyb21fbm9kZTogXCJcIixcbiAgICAgICAgICAgICAgdG9fbm9kZTogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGluZGV4OiBcIntpbmRleH1cIixcbiAgICAgICAgICAgIHNoYXJkOiAwLFxuICAgICAgICAgICAgZnJvbV9ub2RlOiBcIntub2RlfVwiLFxuICAgICAgICAgICAgdG9fbm9kZTogXCJ7bm9kZX1cIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgY2FuY2VsOiB7XG4gICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgIGluZGV4OiBcIlwiLFxuICAgICAgICAgICAgICBzaGFyZDogMCxcbiAgICAgICAgICAgICAgbm9kZTogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGluZGV4OiBcIntpbmRleH1cIixcbiAgICAgICAgICAgIHNoYXJkOiAwLFxuICAgICAgICAgICAgbm9kZTogXCJ7bm9kZX1cIixcbiAgICAgICAgICAgIGFsbG93X3ByaW1hcnk6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGFsbG9jYXRlOiB7XG4gICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgIGluZGV4OiBcIlwiLFxuICAgICAgICAgICAgICBzaGFyZDogMCxcbiAgICAgICAgICAgICAgbm9kZTogXCJcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGluZGV4OiBcIntpbmRleH1cIixcbiAgICAgICAgICAgIHNoYXJkOiAwLFxuICAgICAgICAgICAgbm9kZTogXCJ7bm9kZX1cIixcbiAgICAgICAgICAgIGFsbG93X3ByaW1hcnk6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBkcnlfcnVuOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19XG4gICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3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CAAC,sBAAsB,CAAC,kBAAkB,EAAE;AAC7C,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,cAAU,EAAE;AACV,aAAO,EAAE,UAAU;AACnB,aAAO,EAAE,UAAU;KACpB;AACD,2BAAuB,EAAE;AACvB,cAAQ,EAAE,CACR;AACE,YAAI,EAAE;AACJ,oBAAU,EAAE;AACV,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,CAAC;AACR,qBAAS,EAAE,EAAE;AACb,mBAAO,EAAE,EAAE;WACZ;AACD,eAAK,EAAE,SAAS;AAChB,eAAK,EAAE,CAAC;AACR,mBAAS,EAAE,QAAQ;AACnB,iBAAO,EAAE,QAAQ;SAClB;AACD,cAAM,EAAE;AACN,oBAAU,EAAE;AACV,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,CAAC;AACR,gBAAI,EAAE,EAAE;WACT;AACD,eAAK,EAAE,SAAS;AAChB,eAAK,EAAE,CAAC;AACR,cAAI,EAAE,QAAQ;AACd,uBAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;SACzC;AACD,gBAAQ,EAAE;AACR,oBAAU,EAAE;AACV,iBAAK,EAAE,EAAE;AACT,iBAAK,EAAE,CAAC;AACR,gBAAI,EAAE,EAAE;WACT;AACD,eAAK,EAAE,SAAS;AAChB,eAAK,EAAE,CAAC;AACR,cAAI,EAAE,QAAQ;AACd,uBAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;SACzC;OACF,CACF;AACD,aAAO,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;KACnC;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/cluster.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_cluster/nodes/stats');\n api.addEndpointDescription('_cluster/state', {\n patterns: [\n \"_cluster/state\",\n \"_cluster/state/{metrics}\",\n \"_cluster/state/{metrics}/{indices}\"\n ],\n url_components: {\n \"metrics\": [\"version\", \"master_node\", \"nodes\", \"routing_table\", \"metadata\", \"blocks\"]\n }\n });\n api.addEndpointDescription('_cluster/health', {\n url_params: {\n \"local\": \"__flag__\",\n \"level\": [\"indices\", \"shards\"],\n \"master_timeout\": \"30s\",\n \"timeout\": \"30s\",\n \"wait_for_status\": [\"yellow\", \"green\"],\n \"wait_for_relocating_shards\": 0,\n \"wait_for_active_shards\": 0,\n \"wait_for_nodes\": 0\n }\n });\n api.addEndpointDescription('_cluster/pending_tasks');\n api.addEndpointDescription('get_cluster/settings', {\n patterns: [\n '_cluster/settings'\n ]\n });\n\n api.addEndpointDescription('put_cluster/settings', {\n methods: ['PUT'],\n patterns: [\n '_cluster/settings'\n ],\n data_autocomplete_rules: {\n persistent: {\n cluster: {\n routing: {\n 'allocation.enable': {__one_of: [\"all\", \"primaries\", \"new_primaries\", \"none\"]},\n 'allocation.disk.threshold_enabled': {__one_of: [false, true]},\n 'allocation.disk.watermark.low': '85%',\n 'allocation.disk.watermark.high': '90%',\n 'allocation.disk.include_relocations': {__one_of: [true, false]},\n 'allocation.disk.reroute_interval': '60s',\n 'allocation.exclude': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.include': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.require': {\n '_ip': \"\",\n '_name': \"\",\n '_host': \"\",\n '_id': \"\"\n },\n 'allocation.awareness.attributes': [],\n 'allocation.awareness.force': {\n '*': {\n 'values': []\n }\n },\n 'allocation.allow_rebalance': {__one_of: ['always', 'indices_primaries_active', 'indices_all_active']},\n 'allocation.cluster_concurrent_rebalance': 2,\n 'allocation.node_initial_primaries_recoveries': 4,\n 'allocation.node_concurrent_recoveries': 2,\n 'allocation.same_shard.host': {__one_of: [false, true]}\n }\n },\n indices: {\n breaker: {\n \"total.limit\": \"70%\",\n \"fielddata.limit\": \"60%\",\n \"fielddata.overhead\": 1.03,\n \"request.limit\": \"40%\",\n \"request.overhead\": 1.0\n }\n }\n },\n transient: {\n __scope_link: '.persistent'\n }\n }\n });\n\n api.addEndpointDescription('_cluster/reroute', {\n methods: ['POST'],\n url_params: {\n explain: \"__flag__\",\n dry_run: \"__flag__\"\n },\n data_autocomplete_rules: {\n commands: [\n {\n move: {\n __template: {\n index: \"\",\n shard: 0,\n from_node: \"\",\n to_node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n from_node: \"{node}\",\n to_node: \"{node}\"\n },\n cancel: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: {__one_of: [true, false]}\n },\n allocate: {\n __template: {\n index: \"\",\n shard: 0,\n node: \"\"\n },\n index: \"{index}\",\n shard: 0,\n node: \"{node}\",\n allow_primary: {__one_of: [true, false]}\n }\n }\n ],\n dry_run: {__one_of: [true, false]}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/count.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_count', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_count\", \"{indices}/_count\", \"_count\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n min_score: 1.0,\n terminate_after: 10\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2NvdW50LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsUUFBUSxFQUFFO0FBQ25DLFdBQU8sRUFBRSxDQUFDLEtBQUssRUFBRSxNQUFNLENBQUM7QUFDeEIsWUFBUSxFQUFFLEVBQUU7QUFDWixZQUFRLEVBQUUsQ0FDUiwwQkFBMEIsRUFDMUIsa0JBQWtCLEVBQ2xCLFFBQVEsQ0FDVDtBQUNELGNBQVUsRUFBRTtBQUNWLGdCQUFVLEVBQUUsQ0FBQyxVQUFVLEVBQUUsZ0JBQWdCLEVBQUUsUUFBUSxFQUFFLGdCQUFnQixFQUFFLGtCQUFrQixFQUFFLGFBQWEsQ0FBQztBQUN6RyxhQUFPLEVBQUUsRUFBRTtBQUNYLGVBQVMsRUFBRSxHQUFHO0FBQ2QscUJBQWUsRUFBRSxFQUFFO0tBQ3BCO0FBQ0QsMkJBQXVCLEVBQUU7QUFDdkIsV0FBSyxFQUFFOztPQUVOO0tBQ0Y7R0FDRixDQUFDLENBQUE7Q0FDSCxDQUFDIiwiZmlsZSI6Ii9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2NvdW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoYXBpKSB7XG4gIGFwaS5hZGRFbmRwb2ludERlc2NyaXB0aW9uKCdfY291bnQnLCB7XG4gICAgbWV0aG9kczogWydHRVQnLCAnUE9TVCddLFxuICAgIHByaW9yaXR5OiAxMCwgLy8gY29sbGlkZXMgd2l0aCBnZXQgZG9jIGJ5IGlkXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L3t0eXBlc30vX2NvdW50XCIsXG4gICAgICBcIntpbmRpY2VzfS9fY291bnRcIixcbiAgICAgIFwiX2NvdW50XCJcbiAgICBdLFxuICAgIHVybF9wYXJhbXM6IHtcbiAgICAgIHByZWZlcmVuY2U6IFtcIl9wcmltYXJ5XCIsIFwiX3ByaW1hcnlfZmlyc3RcIiwgXCJfbG9jYWxcIiwgXCJfb25seV9ub2RlOnh5elwiLCBcIl9wcmVmZXJfbm9kZTp4eXpcIiwgXCJfc2hhcmRzOjIsM1wiXSxcbiAgICAgIHJvdXRpbmc6IFwiXCIsXG4gICAgICBtaW5fc2NvcmU6IDEuMCxcbiAgICAgIHRlcm1pbmF0ZV9hZnRlcjogMTAsXG4gICAgfSxcbiAgICBkYXRhX2F1dG9jb21wbGV0ZV9ydWxlczoge1xuICAgICAgcXVlcnk6IHtcbiAgICAgICAgLy8gcG9wdWxhdGVkIGJ5IGEgZ2xvYmFsIHJ1bGVcbiAgICAgIH0sXG4gICAgfVxuICB9KVxufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/count.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACnC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,0BAA0B,EAC1B,kBAAkB,EAClB,QAAQ,CACT;AACD,cAAU,EAAE;AACV,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,aAAO,EAAE,EAAE;AACX,eAAS,EAAE,GAAG;AACd,qBAAe,EAAE,EAAE;KACpB;AACD,2BAAuB,EAAE;AACvB,WAAK,EAAE;;OAEN;KACF;GACF,CAAC,CAAA;CACH,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/count.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_count', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_count\",\n \"{indices}/_count\",\n \"_count\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n min_score: 1.0,\n terminate_after: 10,\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n }\n })\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/document.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_doc', {\n methods: ['GET'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_get_doc_source', {\n methods: ['GET'],\n patterns: [\"{index}/{type}/{id}/_source\"],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_delete_doc', {\n methods: ['DELETE'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\"\n }\n });\n api.addEndpointDescription('index_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/{type}/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('create_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/{type}/{id}/_create\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('index_doc_no_id', {\n methods: ['POST'],\n patterns: [\"{index}/{type}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n\n api.addEndpointDescription('_update', {\n methods: ['POST'],\n patterns: [\"{index}/{type}/{id}/_update\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"force\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\",\n \"retry_on_conflict\": 3,\n \"fields\": \"\"\n },\n data_autocomplete_rules: {\n \"script\": \"\",\n \"script_id\": \"\",\n \"lang\": \"groovy\",\n \"params\": {},\n \"doc\": {},\n \"upsert\": {},\n \"scripted_upsert\": { __one_of: [true, false] }\n }\n\n });\n\n api.addEndpointDescription('_put_script', {\n methods: ['POST', 'PUT'],\n patterns: [\"_scripts/{lang}/{id}\", \"_scripts/{lang}/{id}/_create\"],\n url_components: {\n \"lang\": [\"groovy\", \"expressions\"]\n },\n data_autocomplete_rules: {\n \"script\": \"\"\n }\n });\n\n api.addEndpointDescription('_termvectors', {\n methods: ['GET', 'POST'],\n patterns: [\"{index}/{type}/_termvectors\"],\n priority: 10, // collides with get doc by id\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\"\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n offsets: { __one_of: [false, true] },\n payloads: { __one_of: [false, true] },\n positions: { __one_of: [false, true] },\n term_statistics: { __one_of: [true, false] },\n field_statistics: { __one_of: [false, true] },\n per_field_analyzer: {\n __template: { \"FIELD\": \"\" },\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n doc: {}\n }\n });\n\n api.addEndpointDescription('_termvectors_id', {\n methods: ['GET', 'POST'],\n patterns: [\"{index}/{type}/{id}/_termvectors\"],\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\"\n },\n data_autocomplete_rules: {\n fields: [\"{field}\"],\n \"offsets\": { __one_of: [false, true] },\n \"payloads\": { __one_of: [false, true] },\n \"positions\": { __one_of: [false, true] },\n \"term_statistics\": { __one_of: [true, false] },\n \"field_statistics\": { __one_of: [false, true] },\n \"dfs\": { __one_of: [true, false] },\n \"per_field_analyzer\": {\n __template: { \"FIELD\": \"\" },\n \"{field}\": \"\"\n },\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"]\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2RvY3VtZW50LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiO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iXCIsXG4gICAgICBcInZlcnNpb25cIjogMSxcbiAgICAgIFwidmVyc2lvbl90eXBlXCI6IFtcImV4dGVybmFsXCIsIFwiZXh0ZXJuYWxfZ3RcIiwgXCJleHRlcm5hbF9ndGVcIiwgXCJmb3JjZVwiLCBcImludGVybmFsXCJdXG4gICAgfVxuICB9KTtcblxufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/document.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,UAAU,EAAE;AACrC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,qBAAqB,CACtB;AACD,cAAU,EAAE;AACV,eAAS,EAAE,CAAC;AACZ,eAAS,EAAE,EAAE;AACb,cAAQ,EAAE,EAAE;AACZ,eAAS,EAAE,EAAE;AACb,uBAAiB,EAAE,EAAE;AACrB,uBAAiB,EAAE,EAAE;KACtB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,6BAA6B,CAC9B;AACD,cAAU,EAAE;AACV,eAAS,EAAE,CAAC;AACZ,eAAS,EAAE,EAAE;AACb,cAAQ,EAAE,EAAE;AACZ,uBAAiB,EAAE,EAAE;AACrB,uBAAiB,EAAE,EAAE;KACtB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,qBAAqB,CACtB;AACD,cAAU,EAAE;AACV,eAAS,EAAE,CAAC;AACZ,oBAAc,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AACxC,eAAS,EAAE,EAAE;AACb,cAAQ,EAAE,EAAE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;AACb,eAAS,EAAE,CAAC;AACZ,oBAAc,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,CAAC;KACjF;GACF,CAAC,CAAC;CAEJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/document.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_get_doc', {\n methods: ['GET'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_get_doc_source', {\n methods: ['GET'],\n patterns: [\n \"{index}/{type}/{id}/_source\"\n ],\n url_params: {\n \"version\": 1,\n \"routing\": \"\",\n \"parent\": \"\",\n \"_source_exclude\": \"\",\n \"_source_include\": \"\"\n }\n });\n api.addEndpointDescription('_delete_doc', {\n methods: ['DELETE'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\"\n }\n });\n api.addEndpointDescription('index_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/{type}/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('create_doc', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/{type}/{id}/_create\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n api.addEndpointDescription('index_doc_no_id', {\n methods: ['POST'],\n patterns: [\n \"{index}/{type}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n }\n });\n\n api.addEndpointDescription('_update', {\n methods: ['POST'],\n patterns: [\n \"{index}/{type}/{id}/_update\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"force\", \"internal\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\",\n \"retry_on_conflict\": 3,\n \"fields\": \"\"\n },\n data_autocomplete_rules: {\n \"script\": \"\",\n \"script_id\": \"\",\n \"lang\": \"groovy\",\n \"params\": {},\n \"doc\": {},\n \"upsert\": {},\n \"scripted_upsert\": {__one_of: [true, false]}\n }\n\n });\n\n api.addEndpointDescription('_put_script', {\n methods: ['POST', 'PUT'],\n patterns: [\n \"_scripts/{lang}/{id}\",\n \"_scripts/{lang}/{id}/_create\"\n ],\n url_components: {\n \"lang\": [\n \"groovy\",\n \"expressions\"\n ]\n },\n data_autocomplete_rules: {\n \"script\": \"\"\n }\n });\n\n api.addEndpointDescription('_termvectors', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{index}/{type}/_termvectors\"\n ],\n priority: 10, // collides with get doc by id\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\"\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\"\n ],\n offsets: {__one_of: [false, true]},\n payloads: {__one_of: [false, true]},\n positions: {__one_of: [false, true]},\n term_statistics: {__one_of: [true, false]},\n field_statistics: {__one_of: [false, true]},\n per_field_analyzer: {\n __template: {\"FIELD\": \"\"},\n \"{field}\": \"\"\n },\n routing: \"\",\n version: 1,\n version_type: [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n doc: {}\n }\n });\n\n api.addEndpointDescription('_termvectors_id', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{index}/{type}/{id}/_termvectors\"\n ],\n url_params: {\n \"fields\": \"\",\n \"offsets\": \"__flag__\",\n \"payloads\": \"__flag__\",\n \"positions\": \"__flag__\",\n \"term_statistics\": \"__flag__\",\n \"field_statistics\": \"__flag__\",\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"],\n \"parent\": \"\",\n \"preference\": \"\"\n },\n data_autocomplete_rules: {\n fields: [\n \"{field}\"\n ],\n \"offsets\": {__one_of: [false, true]},\n \"payloads\": {__one_of: [false, true]},\n \"positions\": {__one_of: [false, true]},\n \"term_statistics\": {__one_of: [true, false]},\n \"field_statistics\": {__one_of: [false, true]},\n \"dfs\": {__one_of: [true, false]},\n \"per_field_analyzer\": {\n __template: {\"FIELD\": \"\"},\n \"{field}\": \"\"\n },\n \"routing\": \"\",\n \"version\": 1,\n \"version_type\": [\"external\", \"external_gt\", \"external_gte\", \"force\", \"internal\"]\n }\n });\n\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/facets.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('facets', {\n '*': {\n terms: {\n __template: {\n field: 'FIELD',\n size: 10\n },\n field: '{field}',\n fields: ['{field}'],\n size: 10,\n script: '',\n script_field: '',\n order: {\n __one_of: ['count', 'term', 'reverse_count', 'reverse_term']\n },\n all_terms: {\n __one_of: [false, true]\n },\n exclude: ['TERM'],\n regex: '',\n regex_flags: ''\n },\n range: {\n __template: {\n field: 'FIELD',\n ranges: [{\n 'to': 50\n }, {\n 'from': 20,\n 'to': 70\n }, {\n 'from': 70,\n 'to': 120\n }, {\n 'from': 150\n }]\n },\n field: '{field}',\n ranges: [{\n to: 10,\n from: 20\n }]\n },\n histogram: {\n __template: {\n field: 'FIELD',\n interval: 100\n },\n field: '{field}',\n interval: 100,\n time_interval: '1.5h',\n key_field: '{field}',\n value_field: '{field}',\n key_script: '',\n value_script: '',\n params: {}\n },\n date_histogram: {\n __template: {\n field: 'FIELD',\n 'interval': 'day'\n },\n field: '{field}',\n interval: {\n __one_of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', '1h', '1d', '1w']\n },\n post_zone: -1,\n pre_zone: -1,\n factor: 1000,\n pre_offset: '1d',\n post_offset: '1d',\n key_field: '{field}',\n value_field: '{field}',\n value_script: ''\n },\n filter: {},\n query: {},\n facet_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n statistical: {\n __template: {\n field: 'FIELD'\n },\n field: '{field}',\n fields: ['{field}'],\n script: ''\n },\n terms_stats: {\n __template: {\n key_field: 'FIELD',\n value_field: 'FIELD'\n },\n key_field: '{field}',\n value_field: '{field}',\n value_script: '',\n size: 10,\n order: {\n __one_of: ['count', 'term', 'reverse_term', 'reverse_count', 'total', 'reverse_total', 'min', 'reverse_min', 'max', 'reverse_max', 'mean', 'reverse_mean']\n }\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2ZhY2V0cy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLDBCQUEwQixDQUFDLFFBQVEsRUFBRTtBQUN2QyxPQUFHLEVBQUU7QUFDSCxXQUFLLEVBQUU7QUFDTCxrQkFBVSxFQUFFO0FBQ1YsZUFBSyxFQUFFLE9BQU87QUFDZCxjQUFJLEVBQUUsRUFBRTtTQUNUO0FBQ0QsYUFBSyxFQUFFLFNBQVM7QUFDaEIsY0FBTSxFQUFFLENBQUMsU0FBUyxDQUFDO0FBQ25CLFlBQUksRUFBRSxFQUFFO0FBQ1IsY0FBTSxFQUFFLEVBQUU7QUFDVixvQkFBWSxFQUFFLEVBQUU7QUFDaEIsYUFBSyxFQUFFO0FBQ0wsa0JBQVEsRUFBRSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsZUFBZSxFQUFFLGNBQWMsQ0FBQztTQUM3RDtBQUNELGlCQUFTLEVBQUU7QUFDVCxrQkFBUSxFQUFFLENBQUMsS0FB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ICAgICAgcmVnZXhfZmxhZ3M6ICcnXG4gICAgICB9LFxuICAgICAgcmFuZ2U6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIGZpZWxkOiAnRklFTEQnLFxuICAgICAgICAgIHJhbmdlczogW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAndG8nOiA1MFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgJ2Zyb20nOiAyMCxcbiAgICAgICAgICAgICAgJ3RvJzogNzBcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICdmcm9tJzogNzAsXG4gICAgICAgICAgICAgICd0byc6IDEyMFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgJ2Zyb20nOiAxNTBcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIGZpZWxkOiAne2ZpZWxkfScsXG4gICAgICAgIHJhbmdlczogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIHRvOiAxMCxcbiAgICAgICAgICAgIGZyb206IDIwXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgaGlzdG9ncmFtOiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICBmaWVsZDogJ0ZJRUxEJyxcbiAgICAgICAgICBpbnRlcnZhbDogMTAwXG4gICAgICAgIH0sXG4gICAgICAgIGZpZWxkOiAne2ZpZWxkfScsXG4gICAgICAgIGludGVydmFsOiAxMDAsXG4gICAgICAgIHRpbWVfaW50ZXJ2YWw6ICcxLjVoJyxcbiAgICAgICAga2V5X2ZpZWxkOiAne2ZpZWxkfScsXG4gICAgICAgIHZhbHVlX2ZpZWxkOiAne2ZpZWxkfScsXG4gICAgICAgIGtleV9zY3JpcHQ6ICcnLFxuICAgICAgICB2YWx1ZV9zY3JpcHQ6ICcnLFxuICAgICAgICBwYXJhbXM6IHt9XG4gICAgICB9LFxuICAgICAgZGF0ZV9oaXN0b2dyYW06IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgIGZpZWxkOiAnRklFTEQnLFxuICAgICAgICAgICdpbnRlcnZhbCc6ICdkYXknXG4gICAgICAgIH0sXG4gICAgICAgIGZpZWxkOiAne2ZpZWxkfScsXG4gICAgICAgIGludGVydmFsOiB7XG4gICAgICAgICAgX19vbmVfb2Y6IFsneWVhcicsICdxdWFydGVyJywgJ21vbnRoJywgJ3dlZWsnLCAnZGF5JywgJ2hvdXInLCAnbWludXRlJywgJzFoJywgJzFkJywgJzF3J11cbiAgICAgICAgfSxcbiAgICAgICAgcG9zdF96b25lOiAtMSxcbiAgICAgICAgcHJlX3pvbmU6IC0xLFxuICAgICAgICBmYWN0b3I6IDEwMDAsXG4gICAgICAgIHByZV9vZmZzZXQ6ICcxZCcsXG4gICAgICAgIHBvc3Rfb2Zmc2V0OiAnMWQnLFxuICAgICAgICBrZXlfZmllbGQ6ICd7ZmllbGR9JyxcbiAgICAgICAgdmFsdWVfZmllbGQ6ICd7ZmllbGR9JyxcbiAgICAgICAgdmFsdWVfc2NyaXB0OiAnJ1xuICAgICAgfSxcbiAgICAgIGZpbHRlcjoge30sXG4gICAgICBxdWVyeToge30sXG4gICAgICBmYWNldF9maWx0ZXI6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnR0xPQkFMLmZpbHRlcidcbiAgICAgIH0sXG4gICAgICBzdGF0aXN0aWNhbDoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgZmllbGQ6ICdGSUVMRCdcbiAgICAgICAgfSxcbiAgICAgICAgZmllbGQ6ICd7ZmllbGR9JyxcbiAgICAgICAgZmllbGRzOiBbJ3tmaWVsZH0nXSxcbiAgICAgICAgc2NyaXB0OiAnJ1xuICAgICAgfSxcbiAgICAgIHRlcm1zX3N0YXRzOiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICBrZXlfZmllbGQ6ICdGSUVMRCcsXG4gICAgICAgICAgdmFsdWVfZmllbGQ6ICdGSUVMRCdcbiAgICAgICAgfSxcbiAgICAgICAga2V5X2ZpZWxkOiAne2ZpZWxkfScsXG4gICAgICAgIHZhbHVlX2ZpZWxkOiAne2ZpZWxkfScsXG4gICAgICAgIHZhbHVlX3NjcmlwdDogJycsXG4gICAgICAgIHNpemU6IDEwLFxuICAgICAgICBvcmRlcjoge1xuICAgICAgICAgIF9fb25lX29mOiBbJ2NvdW50JywgJ3Rlcm0nLCAncmV2ZXJzZV90ZXJtJywgJ3JldmVyc2VfY291bnQnLCAndG90YWwnLCAncmV2ZXJzZV90b3RhbCcsXG4gICAgICAgICAgICAnbWluJywgJ3JldmVyc2VfbWluJywgJ21heCcsICdyZXZlcnNlX21heCcsICdtZWFuJywgJ3JldmVyc2VfbWVhbidcbiAgICAgICAgICBdXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/facets.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,0BAA0B,CAAC,QAAQ,EAAE;AACvC,OAAG,EAAE;AACH,WAAK,EAAE;AACL,kBAAU,EAAE;AACV,eAAK,EAAE,OAAO;AACd,cAAI,EAAE,EAAE;SACT;AACD,aAAK,EAAE,SAAS;AAChB,cAAM,EAAE,CAAC,SAAS,CAAC;AACnB,YAAI,EAAE,EAAE;AACR,cAAM,EAAE,EAAE;AACV,oBAAY,EAAE,EAAE;AAChB,aAAK,EAAE;AACL,kBAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,CAAC;SAC7D;AACD,iBAAS,EAAE;AACT,kBAAQ,EAAE,CAAC,KAAK,EAAE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W,EAAE,SAAS;AACtB,oBAAY,EAAE,EAAE;OACjB;AACD,YAAM,EAAE,EAAE;AACV,WAAK,EAAE,EAAE;AACT,kBAAY,EAAE;AACZ,oBAAY,EAAE,eAAe;OAC9B;AACD,iBAAW,EAAE;AACX,kBAAU,EAAE;AACV,eAAK,EAAE,OAAO;SACf;AACD,aAAK,EAAE,SAAS;AAChB,cAAM,EAAE,CAAC,SAAS,CAAC;AACnB,cAAM,EAAE,EAAE;OACX;AACD,iBAAW,EAAE;AACX,kBAAU,EAAE;AACV,mBAAS,EAAE,OAAO;AAClB,qBAAW,EAAE,OAAO;SACrB;AACD,iBAAS,EAAE,SAAS;AACpB,mBAAW,EAAE,SAAS;AACtB,oBAAY,EAAE,EAAE;AAChB,YAAI,EAAE,EAAE;AACR,aAAK,EAAE;AACL,kBAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EACnF,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,CACnE;SACF;OACF;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/facets.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addGlobalAutocompleteRules('facets', {\n '*': {\n terms: {\n __template: {\n field: 'FIELD',\n size: 10\n },\n field: '{field}',\n fields: ['{field}'],\n size: 10,\n script: '',\n script_field: '',\n order: {\n __one_of: ['count', 'term', 'reverse_count', 'reverse_term']\n },\n all_terms: {\n __one_of: [false, true]\n },\n exclude: ['TERM'],\n regex: '',\n regex_flags: ''\n },\n range: {\n __template: {\n field: 'FIELD',\n ranges: [\n {\n 'to': 50\n },\n {\n 'from': 20,\n 'to': 70\n },\n {\n 'from': 70,\n 'to': 120\n },\n {\n 'from': 150\n }\n ]\n },\n field: '{field}',\n ranges: [\n {\n to: 10,\n from: 20\n }\n ]\n },\n histogram: {\n __template: {\n field: 'FIELD',\n interval: 100\n },\n field: '{field}',\n interval: 100,\n time_interval: '1.5h',\n key_field: '{field}',\n value_field: '{field}',\n key_script: '',\n value_script: '',\n params: {}\n },\n date_histogram: {\n __template: {\n field: 'FIELD',\n 'interval': 'day'\n },\n field: '{field}',\n interval: {\n __one_of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', '1h', '1d', '1w']\n },\n post_zone: -1,\n pre_zone: -1,\n factor: 1000,\n pre_offset: '1d',\n post_offset: '1d',\n key_field: '{field}',\n value_field: '{field}',\n value_script: ''\n },\n filter: {},\n query: {},\n facet_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n statistical: {\n __template: {\n field: 'FIELD'\n },\n field: '{field}',\n fields: ['{field}'],\n script: ''\n },\n terms_stats: {\n __template: {\n key_field: 'FIELD',\n value_field: 'FIELD'\n },\n key_field: '{field}',\n value_field: '{field}',\n value_script: '',\n size: 10,\n order: {\n __one_of: ['count', 'term', 'reverse_term', 'reverse_count', 'total', 'reverse_total',\n 'min', 'reverse_min', 'max', 'reverse_max', 'mean', 'reverse_mean'\n ]\n }\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/filter.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar filters = {};\n\nfilters.and = {\n __template: {\n filters: [{}]\n },\n filters: [{\n __scope_link: '.'\n }],\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.bool = {\n must: [{\n __scope_link: '.'\n }],\n must_not: [{\n __scope_link: '.'\n }],\n should: [{\n __scope_link: '.'\n }],\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.exists = {\n __template: {\n 'field': 'FIELD_NAME'\n },\n 'field': '{field}'\n};\n\nfilters.ids = {\n __template: {\n 'values': ['ID']\n },\n 'type': '{type}',\n 'values': ['']\n};\n\nfilters.limit = {\n __template: {\n value: 100\n },\n value: 100\n};\n\nfilters.type = {\n __template: {\n value: 'TYPE'\n },\n value: '{type}'\n};\n\nfilters.geo_bounding_box = {\n __template: {\n 'FIELD': {\n 'top_left': {\n 'lat': 40.73,\n 'lon': -74.1\n },\n 'bottom_right': {\n 'lat': 40.717,\n 'lon': -73.99\n }\n }\n },\n\n '{field}': {\n top_left: {\n lat: 40.73,\n lon: -74.1\n },\n bottom_right: {\n lat: 40.73,\n lon: -74.1\n }\n },\n type: {\n __one_of: ['memory', 'indexed']\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.geo_distance = {\n __template: {\n distance: 100,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n distance: 100,\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n optimize_bbox: {\n __one_of: ['memory', 'indexed', 'none']\n },\n '{field}': {\n lat: 40.73,\n lon: -74.1\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.geo_distance_range = {\n __template: {\n from: 100,\n to: 200,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n from: 100,\n to: 200,\n\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n include_lower: {\n __one_of: [true, false]\n },\n include_upper: {\n __one_of: [true, false]\n },\n\n '{field}': {\n lat: 40.73,\n lon: -74.1\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.geo_polygon = {\n __template: {\n 'FIELD': {\n 'points': [{\n lat: 40.73,\n lon: -74.1\n }, {\n lat: 40.83,\n lon: -75.1\n }]\n }\n },\n '{field}': {\n points: [{\n lat: 40.73,\n lon: -74.1\n }]\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.geo_shape = {\n __template: {\n 'FIELD': {\n shape: {\n type: 'envelope',\n coordinates: [[-45, 45], [45, -45]]\n },\n 'relation': 'within'\n }\n },\n '{field}': {\n shape: {\n type: '',\n coordinates: []\n },\n indexed_shape: {\n id: '',\n index: '{index}',\n type: '{type}',\n shape_field_name: 'shape'\n },\n relation: {\n __one_of: ['within', 'intersects', 'disjoint']\n }\n }\n};\n\nfilters.has_child = {\n __template: {\n type: 'TYPE',\n filter: {}\n },\n type: '{type}',\n query: {},\n filter: {},\n _scope: '',\n min_children: 1,\n max_children: 10\n};\n\nfilters.has_parent = {\n __template: {\n parent_type: 'TYPE',\n filter: {}\n },\n parent_type: '{type}',\n query: {},\n filter: {},\n _scope: ''\n};\n\nfilters.m = filters.missing = {\n __template: {\n field: 'FIELD'\n },\n existence: {\n __one_of: [true, false]\n },\n null_value: {\n __one_of: [true, false]\n },\n field: '{field}'\n};\n\nfilters.not = {\n __template: {\n filter: {}\n },\n filter: {},\n _cache: {\n __one_of: [true, false]\n }\n};\n\nfilters.range = {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n \"{field}\": {\n gte: 1,\n gt: 1,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n execution: { __one_of: [\"index\", \"fielddata\"] }\n },\n _cache: {\n __one_of: [false, true]\n },\n _cache_key: \"\"\n};\n\nfilters.or = {\n __template: {\n filters: [{}]\n },\n filters: [{\n __scope_link: '.'\n }],\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.prefix = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': '',\n _cache: {\n __one_of: [true, false]\n }\n};\n\nfilters.query = {\n // global query\n};\n\nfilters.fquery = {\n __template: {\n query: {},\n _cache: true\n },\n query: {\n //global query\n },\n _cache: {\n __one_of: [true, false]\n }\n};\n\nfilters.script = {\n __template: {\n script: 'SCRIPT',\n params: {}\n },\n script: '',\n params: {},\n _cache: {\n __one_of: [true, false]\n }\n};\n\nfilters.term = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': '',\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.terms = {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n field: ['{field}'],\n execution: {\n __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\nfilters.nested = {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n query: {},\n path: '',\n _cache: {\n __one_of: [true, false]\n },\n _name: ''\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('filter', filters);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2ZpbHRlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksT0FBTyxHQUFHLEVBQUUsQ0FBQzs7QUFFakIsT0FBTyxDQUFDLEdBQUcsR0FBRztBQUNaLFlBQVUsRUFBRTtBQUNWLFdBQU8sRUFBRSxDQUNQLEVBQUUsQ0FDSDtHQUNGO0FBQ0QsU0FBTyxFQUFFLENBQ1A7QUFDRSxnQkFBWSxFQUFFLEdBQUc7R0FDbEIsQ0FDRjtBQUNELFFBQU0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cbn07XG5cblxuZmlsdGVycy50ZXJtcyA9IHtcbiAgX190ZW1wbGF0ZToge1xuICAgICdGSUVMRCc6IFsnVkFMVUUxJywgJ1ZBTFVFMiddXG4gIH0sXG4gIGZpZWxkOiBbJ3tmaWVsZH0nXSxcbiAgZXhlY3V0aW9uOiB7XG4gICAgX19vbmVfb2Y6IFsncGxhaW4nLCAnYm9vbCcsICdhbmQnLCAnb3InLCAnYm9vbF9ub2NhY2hlJywgJ2FuZF9ub2NhY2hlJywgJ29yX25vY2FjaGUnXVxuICB9LFxuICBfY2FjaGU6IHtcbiAgICBfX29uZV9vZjogW2ZhbHNlLCB0cnVlXVxuICB9XG59O1xuXG5cbmZpbHRlcnMubmVzdGVkID0ge1xuICBfX3RlbXBsYXRlOiB7XG4gICAgcGF0aDogJ3BhdGhfdG9fbmVzdGVkX2RvYycsXG4gICAgcXVlcnk6IHt9XG4gIH0sXG4gIHF1ZXJ5OiB7fSxcbiAgcGF0aDogJycsXG4gIF9jYWNoZToge1xuICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gIH0sXG4gIF9uYW1lOiAnJ1xufTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoYXBpKSB7XG4gIGFwaS5hZGRHbG9iYWxBdXRvY29tcGxldGVSdWxlcygnZmlsdGVyJywgZmlsdGVycyk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/filter.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,OAAO,GAAG,EAAE,CAAC;;AAEjB,OAAO,CAAC,GAAG,GAAG;AACZ,YAAU,EAAE;AACV,WAAO,EAAE,CACP,EAAE,CACH;GACF;AACD,SAAO,EAAE,CACP;AACE,gBAAY,EAAE,GAAG;GAClB,CACF;AACD,QAAM,EAAE;AACN,YAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;GACxB;CACF,CAAC;;AAGF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ACT,YAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,CAAC;GACtF;AACD,QAAM,EAAE;AACN,YAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;GACxB;CACF,CAAC;;AAGF,OAAO,CAAC,MAAM,GAAG;AACf,YAAU,EAAE;AACV,QAAI,EAAE,oBAAoB;AAC1B,SAAK,EAAE,EAAE;GACV;AACD,OAAK,EAAE,EAAE;AACT,MAAI,EAAE,EAAE;AACR,QAAM,EAAE;AACN,YAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;GACxB;AACD,OAAK,EAAE,EAAE;CACV,CAAC;;AAEF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,0BAA0B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;CACnD,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/filter.js", + "sourcesContent": [ + "var filters = {};\n\nfilters.and = {\n __template: {\n filters: [\n {}\n ]\n },\n filters: [\n {\n __scope_link: '.'\n }\n ],\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.bool = {\n must: [\n {\n __scope_link: '.'\n }\n ],\n must_not: [\n {\n __scope_link: '.'\n }\n ],\n should: [\n {\n __scope_link: '.'\n }\n ],\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.exists = {\n __template: {\n 'field': 'FIELD_NAME'\n },\n 'field': '{field}'\n};\n\n\nfilters.ids = {\n __template: {\n 'values': ['ID']\n },\n 'type': '{type}',\n 'values': ['']\n};\n\n\nfilters.limit = {\n __template: {\n value: 100\n },\n value: 100\n};\n\n\nfilters.type = {\n __template: {\n value: 'TYPE'\n },\n value: '{type}'\n};\n\n\nfilters.geo_bounding_box = {\n __template: {\n 'FIELD': {\n 'top_left': {\n 'lat': 40.73,\n 'lon': -74.1\n },\n 'bottom_right': {\n 'lat': 40.717,\n 'lon': -73.99\n }\n }\n },\n\n '{field}': {\n top_left: {\n lat: 40.73,\n lon: -74.1\n },\n bottom_right: {\n lat: 40.73,\n lon: -74.1\n }\n },\n type: {\n __one_of: ['memory', 'indexed']\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.geo_distance = {\n __template: {\n distance: 100,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n distance: 100,\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n optimize_bbox: {\n __one_of: ['memory', 'indexed', 'none']\n },\n '{field}': {\n lat: 40.73,\n lon: -74.1\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.geo_distance_range = {\n __template: {\n from: 100,\n to: 200,\n distance_unit: 'km',\n 'FIELD': {\n lat: 40.73,\n lon: -74.1\n }\n },\n from: 100,\n to: 200,\n\n distance_unit: {\n __one_of: ['km', 'miles']\n },\n distance_type: {\n __one_of: ['arc', 'plane']\n },\n include_lower: {\n __one_of: [true, false]\n },\n include_upper: {\n __one_of: [true, false]\n },\n\n '{field}': {\n lat: 40.73,\n lon: -74.1\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.geo_polygon = {\n __template: {\n 'FIELD': {\n 'points': [\n {\n lat: 40.73,\n lon: -74.1\n },\n {\n lat: 40.83,\n lon: -75.1\n }\n ]\n }\n },\n '{field}': {\n points: [\n {\n lat: 40.73,\n lon: -74.1\n }\n ]\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.geo_shape = {\n __template: {\n 'FIELD': {\n shape: {\n type: 'envelope',\n coordinates: [\n [-45, 45],\n [45, -45]\n ]\n },\n 'relation': 'within'\n }\n },\n '{field}': {\n shape: {\n type: '',\n coordinates: []\n },\n indexed_shape: {\n id: '',\n index: '{index}',\n type: '{type}',\n shape_field_name: 'shape'\n },\n relation: {\n __one_of: ['within', 'intersects', 'disjoint']\n }\n }\n};\n\n\nfilters.has_child = {\n __template: {\n type: 'TYPE',\n filter: {}\n },\n type: '{type}',\n query: {},\n filter: {},\n _scope: '',\n min_children: 1,\n max_children: 10\n};\n\n\nfilters.has_parent = {\n __template: {\n parent_type: 'TYPE',\n filter: {}\n },\n parent_type: '{type}',\n query: {},\n filter: {},\n _scope: ''\n};\n\n\nfilters.m = filters.missing = {\n __template: {\n field: 'FIELD'\n },\n existence: {\n __one_of: [true, false]\n },\n null_value: {\n __one_of: [true, false]\n },\n field: '{field}'\n};\n\n\nfilters.not = {\n __template: {\n filter: {}\n },\n filter: {},\n _cache: {\n __one_of: [true, false]\n }\n};\n\n\nfilters.range = {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n \"{field}\": {\n gte: 1,\n gt: 1,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n execution: {__one_of: [\"index\", \"fielddata\"]}\n },\n _cache: {\n __one_of: [false, true]\n },\n _cache_key: \"\"\n};\n\n\nfilters.or = {\n __template: {\n filters: [\n {}\n ]\n },\n filters: [\n {\n __scope_link: '.'\n }\n ],\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.prefix = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': '',\n _cache: {\n __one_of: [true, false]\n }\n};\n\n\nfilters.query = {\n // global query\n};\n\n\nfilters.fquery = {\n __template: {\n query: {},\n _cache: true\n },\n query: {\n //global query\n },\n _cache: {\n __one_of: [true, false]\n }\n};\n\nfilters.script = {\n __template: {\n script: 'SCRIPT',\n params: {}\n },\n script: '',\n params: {},\n _cache: {\n __one_of: [true, false]\n }\n};\n\n\nfilters.term = {\n __template: {\n 'FIELD': 'VALUE'\n },\n '{field}': '',\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.terms = {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n field: ['{field}'],\n execution: {\n __one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']\n },\n _cache: {\n __one_of: [false, true]\n }\n};\n\n\nfilters.nested = {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n query: {},\n path: '',\n _cache: {\n __one_of: [true, false]\n },\n _name: ''\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('filter', filters);\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/nodes.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_nodes/hot_threads', {\n methods: ['GET'],\n patterns: [\"_nodes/hot_threads\", \"_nodes/{nodes}/hot_threads\"]\n });\n api.addEndpointDescription('_nodes/info', {\n patterns: [\"_nodes\", \"_nodes/{metrics}\", \"_nodes/{nodes}\", \"_nodes/{nodes}/{metrics}\", \"_nodes/{nodes}/info/{metrics}\"],\n url_components: {\n \"metrics\": [\"settings\", \"os\", \"process\", \"jvm\", \"thread_pool\", \"network\", \"transport\", \"http\", \"plugins\", \"_all\"]\n }\n });\n api.addEndpointDescription('_nodes/stats', {\n patterns: [\"_nodes/stats\", \"_nodes/stats/{metrics}\", \"_nodes/stats/{metrics}/{index_metric}\", \"_nodes/{nodes}/stats\", \"_nodes/{nodes}/stats/{metrics}\", \"_nodes/{nodes}/stats/{metrics}/{index_metric}\"],\n url_components: {\n \"metrics\": [\"os\", \"jvm\", \"thread_pool\", \"network\", \"fs\", \"transport\", \"http\", \"indices\", \"process\", \"breaker\", \"_all\"],\n \"index_metric\": [\"store\", \"indexing\", \"get\", \"search\", \"merge\", \"flush\", \"refresh\", \"filter_cache\", \"id_cache\", \"fielddata\", \"docs\", \"warmer\", \"percolate\", \"completion\", \"segments\", \"translog\", \"query_cache\", \"_all\"]\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL25vZGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsb0JBQW9CLEVBQUU7QUFDL0MsV0FBTyxFQUFFLENBQUMsS0FBSyxDQUFDO0FBQ2hCLFlBQVEsRUFBRSxDQUNSLG9CQUFvQixFQUNwQiw0QkFBNEIsQ0FDN0I7R0FDRixDQUFDLENBQUM7QUFDSCxLQUFHLENBQUMsc0JBQXNCLENBQUMsYUFBYSxFQUFFO0FBQ3hDLFlBQVEsRUFBRSxDQUNSLFFBQVEsRUFDUixrQkFBa0IsRUFDbEIsZ0JBQWdCLEVBQ2hCLDBCQUEwQixFQUMxQiwrQkFBK0IsQ0FDaEM7QUFDRCxrQkFBYyxFQUFFO0FBQ2QsZUFBUyxFQUFFLENBQ1QsVUFBVSxFQUNWLElBQUksRUFDSixTQUFTLEVBQ1QsS0FBSyxFQUNMLGFBQWEsRUFDYixTQUFTLEVBQ1QsV0FBVyxFQUNYLE1BQU0sRUFD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3N0YXRzL3ttZXRyaWNzfVwiLFxuICAgICAgXCJfbm9kZXMve25vZGVzfS9zdGF0cy97bWV0cmljc30ve2luZGV4X21ldHJpY31cIlxuICAgIF0sXG4gICAgdXJsX2NvbXBvbmVudHM6IHtcbiAgICAgIFwibWV0cmljc1wiOiBbXG4gICAgICAgIFwib3NcIixcbiAgICAgICAgXCJqdm1cIixcbiAgICAgICAgXCJ0aHJlYWRfcG9vbFwiLFxuICAgICAgICBcIm5ldHdvcmtcIixcbiAgICAgICAgXCJmc1wiLFxuICAgICAgICBcInRyYW5zcG9ydFwiLFxuICAgICAgICBcImh0dHBcIixcbiAgICAgICAgXCJpbmRpY2VzXCIsXG4gICAgICAgIFwicHJvY2Vzc1wiLFxuICAgICAgICBcImJyZWFrZXJcIixcbiAgICAgICAgXCJfYWxsXCJcbiAgICAgIF0sXG4gICAgICBcImluZGV4X21ldHJpY1wiOiBbXG4gICAgICAgIFwic3RvcmVcIixcbiAgICAgICAgXCJpbmRleGluZ1wiLFxuICAgICAgICBcImdldFwiLFxuICAgICAgICBcInNlYXJjaFwiLFxuICAgICAgICBcIm1lcmdlXCIsXG4gICAgICAgIFwiZmx1c2hcIixcbiAgICAgICAgXCJyZWZyZXNoXCIsXG4gICAgICAgIFwiZmlsdGVyX2NhY2hlXCIsXG4gICAgICAgIFwiaWRfY2FjaGVcIixcbiAgICAgICAgXCJmaWVsZGRhdGFcIixcbiAgICAgICAgXCJkb2NzXCIsXG4gICAgICAgIFwid2FybWVyXCIsXG4gICAgICAgIFwicGVyY29sYXRlXCIsXG4gICAgICAgIFwiY29tcGxldGlvblwiLFxuICAgICAgICBcInNlZ21lbnRzXCIsXG4gICAgICAgIFwidHJhbnNsb2dcIixcbiAgICAgICAgXCJxdWVyeV9jYWNoZVwiLFxuICAgICAgICBcIl9hbGxcIlxuICAgICAgXVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/nodes.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,oBAAoB,EAAE;AAC/C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,oBAAoB,EACpB,4BAA4B,CAC7B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,+BAA+B,CAChC;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,UAAU,EACV,IAAI,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,CACP;KACF;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,YAAQ,EAAE,CACR,cAAc,EACd,wBAAwB,EACxB,uCAAuC,EACvC,sBAAsB,EACtB,gCAAgC,EAChC,+CAA+C,CAChD;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,IAAI,EACJ,KAAK,EACL,aAAa,EACb,SAAS,EACT,IAAI,EACJ,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,CACP;AACD,oBAAc,EAAE,CACd,OAAO,EACP,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,MAAM,CACP;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/nodes.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_nodes/hot_threads', {\n methods: ['GET'],\n patterns: [\n \"_nodes/hot_threads\",\n \"_nodes/{nodes}/hot_threads\"\n ]\n });\n api.addEndpointDescription('_nodes/info', {\n patterns: [\n \"_nodes\",\n \"_nodes/{metrics}\",\n \"_nodes/{nodes}\",\n \"_nodes/{nodes}/{metrics}\",\n \"_nodes/{nodes}/info/{metrics}\"\n ],\n url_components: {\n \"metrics\": [\n \"settings\",\n \"os\",\n \"process\",\n \"jvm\",\n \"thread_pool\",\n \"network\",\n \"transport\",\n \"http\",\n \"plugins\",\n \"_all\"\n ]\n }\n });\n api.addEndpointDescription('_nodes/stats', {\n patterns: [\n \"_nodes/stats\",\n \"_nodes/stats/{metrics}\",\n \"_nodes/stats/{metrics}/{index_metric}\",\n \"_nodes/{nodes}/stats\",\n \"_nodes/{nodes}/stats/{metrics}\",\n \"_nodes/{nodes}/stats/{metrics}/{index_metric}\"\n ],\n url_components: {\n \"metrics\": [\n \"os\",\n \"jvm\",\n \"thread_pool\",\n \"network\",\n \"fs\",\n \"transport\",\n \"http\",\n \"indices\",\n \"process\",\n \"breaker\",\n \"_all\"\n ],\n \"index_metric\": [\n \"store\",\n \"indexing\",\n \"get\",\n \"search\",\n \"merge\",\n \"flush\",\n \"refresh\",\n \"filter_cache\",\n \"id_cache\",\n \"fielddata\",\n \"docs\",\n \"warmer\",\n \"percolate\",\n \"completion\",\n \"segments\",\n \"translog\",\n \"query_cache\",\n \"_all\"\n ]\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/globals.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('highlight', {\n pre_tags: {},\n post_tags: {},\n tags_schema: {},\n fields: {\n '{field}': {\n fragment_size: 20,\n number_of_fragments: 3\n }\n }\n });\n\n // only used with scope links as there is no common name for scripts\n api.addGlobalAutocompleteRules('SCRIPT_ENV', {\n __template: { 'script': '' },\n script: '',\n lang: '',\n params: {}\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2dsb2JhbHMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFO0FBQzlCLEtBQUcsQ0FBQywwQkFBMEIsQ0FBQyxXQUFXLEVBQUU7QUFDMUMsWUFBUSxFQUFFLEVBQUU7QUFDWixhQUFTLEVBQUUsRUFBRTtBQUNiLGVBQVcsRUFBRSxFQUFFO0FBQ2YsVUFBTSxFQUFFO0FBQ04sZUFBUyxFQUFFO0FBQ1QscUJBQWEsRUFBRSxFQUFFO0FBQ2pCLDJCQUFtQixFQUFFLENBQUM7T0FDdkI7S0FDRjtHQUNGLENBQUMsQ0FBQzs7O0FBR0gsS0FBRyxDQUFDLDBCQUEwQixDQUFDLFlBQVksRUFBRTtBQUMzQyxjQUFVLEVBQUUsRUFBQyxRQUFRLEVBQUUsRUFBRSxFQUFDO0FBQzFCLFVBQU0sRUFBRSxFQUFFO0FBQ1YsUUFBSSxFQUFFLEVBQUU7QUFDUixVQUFNLEVBQUUsRUFBRTtHQUNYLENBQUMsQ0FBQztDQUNKLENBQUMiLCJmaWxlIjoiL1VzZXJzL2dpbGx5Yi9kZXYvc2Vuc2l0aXZlL3NlbnNlL2luc3RhbGxlZFBsdWdpbnMvc2Vuc2UvYXBpX3NlcnZlci9lc18xXzAvZ2xvYmFscy5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGFwaSkge1xuICBhcGkuYWRkR2xvYmFsQXV0b2NvbXBsZXRlUnVsZXMoJ2hpZ2hsaWdodCcsIHtcbiAgICBwcmVfdGFnczoge30sXG4gICAgcG9zdF90YWdzOiB7fSxcbiAgICB0YWdzX3NjaGVtYToge30sXG4gICAgZmllbGRzOiB7XG4gICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgZnJhZ21lbnRfc2l6ZTogMjAsXG4gICAgICAgIG51bWJlcl9vZl9mcmFnbWVudHM6IDNcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuXG4gIC8vIG9ubHkgdXNlZCB3aXRoIHNjb3BlIGxpbmtzIGFzIHRoZXJlIGlzIG5vIGNvbW1vbiBuYW1lIGZvciBzY3JpcHRzXG4gIGFwaS5hZGRHbG9iYWxBdXRvY29tcGxldGVSdWxlcygnU0NSSVBUX0VOVicsIHtcbiAgICBfX3RlbXBsYXRlOiB7J3NjcmlwdCc6ICcnfSxcbiAgICBzY3JpcHQ6ICcnLFxuICAgIGxhbmc6ICcnLFxuICAgIHBhcmFtczoge31cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/globals.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,0BAA0B,CAAC,WAAW,EAAE;AAC1C,YAAQ,EAAE,EAAE;AACZ,aAAS,EAAE,EAAE;AACb,eAAW,EAAE,EAAE;AACf,UAAM,EAAE;AACN,eAAS,EAAE;AACT,qBAAa,EAAE,EAAE;AACjB,2BAAmB,EAAE,CAAC;OACvB;KACF;GACF,CAAC,CAAC;;;AAGH,KAAG,CAAC,0BAA0B,CAAC,YAAY,EAAE;AAC3C,cAAU,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAC;AAC1B,UAAM,EAAE,EAAE;AACV,QAAI,EAAE,EAAE;AACR,UAAM,EAAE,EAAE;GACX,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/globals.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addGlobalAutocompleteRules('highlight', {\n pre_tags: {},\n post_tags: {},\n tags_schema: {},\n fields: {\n '{field}': {\n fragment_size: 20,\n number_of_fragments: 3\n }\n }\n });\n\n // only used with scope links as there is no common name for scripts\n api.addGlobalAutocompleteRules('SCRIPT_ENV', {\n __template: {'script': ''},\n script: '',\n lang: '',\n params: {}\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/indices.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n\n api.addEndpointDescription('_refresh', {\n methods: ['POST'],\n patterns: [\"_refresh\", \"{indices}/_refresh\"]\n });\n\n api.addEndpointDescription('_flush', {\n methods: ['POST'],\n patterns: [\"_flush\", \"{indices}/_flush\"],\n url_params: {\n wait_if_ongoing: [true, false],\n force: [true, false]\n }\n });\n\n api.addEndpointDescription('_flush_synced', {\n methods: ['POST'],\n patterns: [\"_flush/synced\", \"{indices}/_flush/synced\"]\n });\n\n api.addEndpointDescription('_stats', {\n patterns: [\"_stats\", \"_stats/{metrics}\", \"{indices}/_stats\", \"{indices}/_stats/{metrics}\"],\n url_components: {\n \"metrics\": [\"docs\", \"store\", \"indexing\", \"search\", \"get\", \"merge\", \"refresh\", \"flush\", \"warmer\", \"filter_cache\", \"id_cache\", \"percolate\", \"segments\", \"fielddata\", \"completion\", \"translog\", \"query_cache\", \"commit\", \"_all\"]\n },\n url_params: {\n \"fields\": [],\n \"types\": [],\n \"completion_fields\": [],\n \"fielddata_fields\": [],\n \"level\": [\"cluster\", \"indices\", \"shards\"]\n }\n\n });\n\n api.addEndpointDescription('_segments', {\n patterns: [\"{indices}/_segments\", \"_segments\"]\n });\n\n api.addEndpointDescription('_recovery', {\n patterns: [\"{indices}/_recovery\", \"_recovery\"],\n url_params: {\n detailed: \"__flag__\",\n active_only: \"__flag__\",\n human: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_analyze', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/_analyze\", \"_analyze\"],\n url_params: {\n \"analyzer\": \"\",\n \"char_filters\": [],\n \"field\": \"\",\n \"filters\": [],\n \"text\": \"\",\n \"tokenizer\": \"\"\n }\n });\n\n api.addEndpointDescription('_validate_query', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/_validate/query\", \"_validate/query\"],\n url_params: {\n explain: \"__flag__\",\n rewrite: \"__flag__\"\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n\n api.addEndpointDescription('__create_index__', {\n methods: ['PUT'],\n patterns: [\"{index}\"],\n data_autocomplete_rules: {\n mappings: {\n __scope_link: '_put_mapping'\n },\n settings: {\n __scope_link: '_put_settings'\n },\n aliases: {\n __template: {\n \"NAME\": {}\n }\n }\n }\n });\n\n api.addEndpointDescription('__delete_indices__', {\n methods: ['DELETE'],\n patterns: [\"{indices}\"]\n });\n\n api.addEndpointDescription('_get_index_settings', {\n methods: ['GET'],\n patterns: [\"{indices}/_settings\"],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_get_index', {\n methods: ['GET'],\n patterns: [\"{indices}\", \"{indices}/{feature}\"],\n url_components: {\n \"feature\": [\"_mappings\", \"_warmers\", \"_aliases\"]\n }\n });\n\n api.addEndpointDescription('_cache/clear', {\n patterns: [\"_cache/clear\", \"{indices}/_cache/clear\"]\n });\n\n api.addEndpointDescription('_status', {\n patterns: [\"_status\", \"{indices}/_status\"]\n });\n\n api.addEndpointDescription('_upgrade', {\n methods: [\"POST\"],\n patterns: [\"_upgrade\", \"{indices}/_upgrade\"],\n url_params: {\n wait_for_completion: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_upgrade_status', {\n methods: [\"GET\"],\n patterns: [\"_upgrade\", \"{indices}/_upgrade\"]\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL2luZGljZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFOztBQUU5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsVUFBVSxFQUFFO0FBQ3JDLFdBQU8sRUFBRSxD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uICAgIHVybF9jb21wb25lbnRzOiB7XG4gICAgICBcIm1ldHJpY3NcIjogW1xuICAgICAgICBcImRvY3NcIixcbiAgICAgICAgXCJzdG9yZVwiLFxuICAgICAgICBcImluZGV4aW5nXCIsXG4gICAgICAgIFwic2VhcmNoXCIsXG4gICAgICAgIFwiZ2V0XCIsXG4gICAgICAgIFwibWVyZ2VcIixcbiAgICAgICAgXCJyZWZyZXNoXCIsXG4gICAgICAgIFwiZmx1c2hcIixcbiAgICAgICAgXCJ3YXJtZXJcIixcbiAgICAgICAgXCJmaWx0ZXJfY2FjaGVcIixcbiAgICAgICAgXCJpZF9jYWNoZVwiLFxuICAgICAgICBcInBlcmNvbGF0ZVwiLFxuICAgICAgICBcInNlZ21lbnRzXCIsXG4gICAgICAgIFwiZmllbGRkYXRhXCIsXG4gICAgICAgIFwiY29tcGxldGlvblwiLFxuICAgICAgICBcInRyYW5zbG9nXCIsXG4gICAgICAgIFwicXVlcnlfY2FjaGVcIixcbiAgICAgICAgXCJjb21taXRcIixcbiAgICAgICAgXCJfYWxsXCJcbiAgICAgIF1cbiAgICB9LFxuICAgIHVybF9wYXJhbXM6IHtcbiAgICAgIFwiZmllbGRzXCI6IFtdLFxuICAgICAgXCJ0eXBlc1wiOiBbXSxcbiAgICAgIFwiY29tcGxldGlvbl9maWVsZHNcIjogW10sXG4gICAgICBcImZpZWxkZGF0YV9maWVsZHNcIjogW10sXG4gICAgICBcImxldmVsXCI6IFtcImNsdXN0ZXJcIiwgXCJpbmRpY2VzXCIsIFwic2hhcmRzXCJdXG4gICAgfVxuXG4gIH0pO1xuXG4gIGFwaS5hZGRFbmRwb2ludERlc2NyaXB0aW9uKCdfc2VnbWVudHMnLCB7XG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L19zZWdtZW50c1wiLFxuICAgICAgXCJfc2VnbWVudHNcIlxuICAgIF1cbiAgfSk7XG5cbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19y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aG9kczogW1wiR0VUXCJdLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIl91cGdyYWRlXCIsXG4gICAgICBcIntpbmRpY2VzfS9fdXBncmFkZVwiXG4gICAgXVxuICB9KTtcblxufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/indices.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;;AAE9B,KAAG,CAAC,sBAAsB,CAAC,UAAU,EAAE;AACrC,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,UAAU,EACV,oBAAoB,CACrB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACnC,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,CACnB;AACD,cAAU,EAAE;AACV,qBAAe,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;AAC9B,WAAK,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;KACrB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,eAAe,EACf,yBAAyB,CAC1B;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE;AACnC,YAAQ,EAAE,CACR,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,CAC7B;AACD,kBAAc,EAAE;AACd,eAAS,EAAE,CACT,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EAC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;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,UAAU,EACV,oBAAoB,CACrB;GACF,CAAC,CAAC;CAEJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/indices.js", + "sourcesContent": [ + "module.exports = function (api) {\n\n api.addEndpointDescription('_refresh', {\n methods: ['POST'],\n patterns: [\n \"_refresh\",\n \"{indices}/_refresh\"\n ],\n });\n\n api.addEndpointDescription('_flush', {\n methods: ['POST'],\n patterns: [\n \"_flush\",\n \"{indices}/_flush\"\n ],\n url_params: {\n wait_if_ongoing: [true, false],\n force: [true, false]\n }\n });\n\n api.addEndpointDescription('_flush_synced', {\n methods: ['POST'],\n patterns: [\n \"_flush/synced\",\n \"{indices}/_flush/synced\"\n ]\n });\n\n api.addEndpointDescription('_stats', {\n patterns: [\n \"_stats\",\n \"_stats/{metrics}\",\n \"{indices}/_stats\",\n \"{indices}/_stats/{metrics}\",\n ],\n url_components: {\n \"metrics\": [\n \"docs\",\n \"store\",\n \"indexing\",\n \"search\",\n \"get\",\n \"merge\",\n \"refresh\",\n \"flush\",\n \"warmer\",\n \"filter_cache\",\n \"id_cache\",\n \"percolate\",\n \"segments\",\n \"fielddata\",\n \"completion\",\n \"translog\",\n \"query_cache\",\n \"commit\",\n \"_all\"\n ]\n },\n url_params: {\n \"fields\": [],\n \"types\": [],\n \"completion_fields\": [],\n \"fielddata_fields\": [],\n \"level\": [\"cluster\", \"indices\", \"shards\"]\n }\n\n });\n\n api.addEndpointDescription('_segments', {\n patterns: [\n \"{indices}/_segments\",\n \"_segments\"\n ]\n });\n\n api.addEndpointDescription('_recovery', {\n patterns: [\n \"{indices}/_recovery\",\n \"_recovery\"\n ],\n url_params: {\n detailed: \"__flag__\",\n active_only: \"__flag__\",\n human: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_analyze', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/_analyze\",\n \"_analyze\"\n ],\n url_params: {\n \"analyzer\": \"\",\n \"char_filters\": [],\n \"field\": \"\",\n \"filters\": [],\n \"text\": \"\",\n \"tokenizer\": \"\"\n }\n });\n\n api.addEndpointDescription('_validate_query', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/_validate/query\",\n \"_validate/query\"\n ],\n url_params: {\n explain: \"__flag__\",\n rewrite: \"__flag__\"\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n }\n }\n });\n\n api.addEndpointDescription('__create_index__', {\n methods: ['PUT'],\n patterns: [\n \"{index}\"\n ],\n data_autocomplete_rules: {\n mappings: {\n __scope_link: '_put_mapping'\n },\n settings: {\n __scope_link: '_put_settings'\n },\n aliases: {\n __template: {\n \"NAME\": {}\n }\n }\n }\n });\n\n api.addEndpointDescription('__delete_indices__', {\n methods: ['DELETE'],\n patterns: [\n \"{indices}\"\n ]\n });\n\n api.addEndpointDescription('_get_index_settings', {\n methods: ['GET',],\n patterns: [\n \"{indices}/_settings\",\n ],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_get_index', {\n methods: ['GET',],\n patterns: [\n \"{indices}\",\n \"{indices}/{feature}\"\n ],\n url_components: {\n \"feature\": [\n \"_mappings\",\n \"_warmers\",\n \"_aliases\"\n ]\n }\n });\n\n api.addEndpointDescription('_cache/clear', {\n patterns: [\n \"_cache/clear\",\n \"{indices}/_cache/clear\"\n ]\n });\n\n api.addEndpointDescription('_status', {\n patterns: [\n \"_status\",\n \"{indices}/_status\"\n ]\n });\n\n api.addEndpointDescription('_upgrade', {\n methods: [\"POST\"],\n patterns: [\n \"_upgrade\",\n \"{indices}/_upgrade\"\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n }\n });\n\n api.addEndpointDescription('_upgrade_status', {\n methods: [\"GET\"],\n patterns: [\n \"_upgrade\",\n \"{indices}/_upgrade\"\n ]\n });\n\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/mappings.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar INDEX_SETTING = {\n __one_of: ['analyzed', 'not_analyzed', 'no']\n},\n BOOLEAN = {\n __one_of: [true, false]\n};\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping\", \"{indices}/_mapping/{types}\", \"{indices}/{types}/_mapping\", \"_mapping\"]\n });\n api.addEndpointDescription('_get_field_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping/field/{fields}\", \"{indices}/_mapping/{type}/field/{fields}\"],\n url_params: {\n \"include_defaults\": \"__flag__\"\n }\n });\n api.addEndpointDescription('_delete_mapping', {\n methods: ['DELETE'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/_mapping\", \"{indices}/_mapping/{types}\", \"{indices}/{types}/_mapping\", \"_mapping\"]\n });\n api.addEndpointDescription('_put_type_mapping', {\n methods: ['PUT', 'POST'],\n patterns: [\"{indices}/{type}/_mapping\", \"{indices}/_mapping/{type}\"],\n priority: 10, // collides with put doc by id\n data_autocomplete_rules: {\n __template: {\n properties: {\n 'FIELD': {}\n }\n },\n '_id': {\n 'index': INDEX_SETTING,\n 'store': BOOLEAN,\n 'path': \"\"\n },\n '_type': {\n 'index': INDEX_SETTING,\n 'store': BOOLEAN\n },\n '_source': {\n 'enabled': BOOLEAN\n },\n '_all': {\n 'enabled': BOOLEAN\n },\n '_analyzer': {\n 'path': \"\"\n },\n '_field_names': {\n 'index': INDEX_SETTING\n },\n '_routing': {\n 'required': BOOLEAN,\n 'path': \"\"\n },\n '_index': {\n 'enabled': BOOLEAN\n },\n '_size': {\n 'enabled': BOOLEAN,\n 'store': BOOLEAN\n },\n '_parent': {\n __template: {\n 'type': ''\n },\n 'type': '{type}'\n },\n '_timestamp': {\n 'enabled': BOOLEAN,\n 'path': '',\n 'format': 'YYYY-MM-dd',\n 'default': \"\"\n },\n 'index_analyzer': 'standard',\n 'search_analyzer': 'standard',\n 'analyzer': 'standard',\n 'dynamic_date_formats': ['yyyy-MM-dd'],\n 'date_detection': BOOLEAN,\n 'numeric_detection': BOOLEAN,\n 'transform': {\n __template: {\n script: \"\"\n },\n __one_of: [{\n script: \"\",\n params: {},\n lang: \"groovy\"\n }, [{\n script: \"\",\n params: {},\n lang: \"groovy\"\n }]]\n\n },\n 'properties': {\n '*': {\n type: {\n __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean', 'binary', 'object', 'nested', \"geo_point\", \"geo_shape\"]\n },\n\n // strings\n index_name: '',\n store: BOOLEAN,\n index: INDEX_SETTING,\n term_vector: {\n __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']\n },\n boost: 1.0,\n null_value: '',\n omit_norms: {\n __one_of: [true, false]\n },\n index_options: {\n __one_of: ['docs', 'freqs', 'positions']\n },\n analyzer: 'standard',\n index_analyzer: 'standard',\n search_analyzer: 'standard',\n include_in_all: {\n __one_of: [false, true]\n },\n ignore_above: 10,\n position_offset_gap: 0,\n\n // numeric\n precision_step: 4,\n ignore_malformed: BOOLEAN,\n\n // geo_point\n lat_lon: {\n __one_of: [true, false]\n },\n geohash: {\n __one_of: [true, false]\n },\n geohash_precision: '1m',\n geohash_prefix: {\n __one_of: [true, false]\n },\n validate: {\n __one_of: [true, false]\n },\n validate_lat: {\n __one_of: [true, false]\n },\n validate_lon: {\n __one_of: [true, false]\n },\n normalize: {\n __one_of: [true, false]\n },\n normalize_lat: {\n __one_of: [true, false]\n },\n normalize_lon: {\n __one_of: [true, false]\n },\n\n // geo_shape\n tree: {\n __one_of: ['geohash', 'quadtree']\n },\n precision: '5km',\n tree_levels: 12,\n distance_error_pct: 0.025,\n orientation: 'ccw',\n\n // dates\n format: {\n __one_of: ['basic_date', 'basic_date_time', 'basic_date_time_no_millis', 'basic_ordinal_date', 'basic_ordinal_date_time', 'basic_ordinal_date_time_no_millis', 'basic_time', 'basic_time_no_millis', 'basic_t_time', 'basic_t_time_no_millis', 'basic_week_date', 'basic_week_date_time', 'basic_week_date_time_no_millis', 'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction', 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis', 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis', 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis', 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year', 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day']\n },\n\n fielddata: {\n filter: {\n regex: '',\n frequency: {\n min: 0.001,\n max: 0.1,\n min_segment_size: 500\n }\n }\n },\n postings_format: {\n __one_of: ['direct', 'memory', 'pulsing', 'bloom_default', 'bloom_pulsing', 'default']\n },\n similarity: {\n __one_of: ['default', 'BM25']\n },\n\n // objects\n properties: {\n __scope_link: '_put_mapping.{type}.properties'\n },\n\n // multi_field\n path: {\n __one_of: ['just_name', 'full']\n },\n fields: {\n '*': {\n __scope_link: '_put_mapping.type.properties.field'\n }\n },\n copy_to: { __one_of: ['{field}', ['{field}']] },\n\n // nested\n include_in_parent: BOOLEAN,\n include_in_root: BOOLEAN\n }\n }\n }\n\n });\n api.addEndpointDescription('_put_mapping', {\n methods: ['PUT'],\n patterns: [\"{indices}/_mapping\"],\n data_autocomplete_rules: {\n '{type}': {\n __scope_link: '_put_type_mapping'\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL21hcHBpbmdzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxhQUFhLEdBQUc7QUFDbEIsVUFBUSxFQUFFLENBQUMsVUFBVSxFQUFFLGNBQWMsRUFBRSxJQUFJLENBQUM7Q0FDN0M7SUFBRSxPQUFPLEdBQUc7QUFDWCxVQUFRLEVBQUUsQ0FBQyxJQUFJLEVBQUUsS0FBSyxDQUFDO0NBQ3hCLENBQUM7O0FBRUYsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsY0FBYyxFQUFFO0FBQ3pDLFdBQU8sRUFBRSxDQUFDLEtBQUssQ0FBQztBQUNoQixZQUFRLEVBQUUsRUFBRTtBQUNaLFlBQVEsRUFBRSxDQUNSLG9CQUFvQixFQUNwQiw0QkFBNEIsRUFDNUIsNEJBQTRCLEVBQzVCLFVBQVUsQ0FDWDtHQUNGLENBQUMsQ0FBQztBQUNILEtBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxvQkFBb0IsRUFBRTtBQUMvQyxXQUFPLEVBQUUsQ0FBQyxLQUFLLENBQUM7QUFDaEIsWUFBUSxFQUFFLEVBQU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AgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L19tYXBwaW5nXCIsXG4gICAgICBcIntpbmRpY2VzfS9fbWFwcGluZy97dHlwZXN9XCIsXG4gICAgICBcIntpbmRpY2VzfS97dHlwZXN9L19tYXBwaW5nXCIsXG4gICAgICBcIl9tYXBwaW5nXCJcbiAgICBdXG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3B1dF90eXBlX21hcHBpbmcnLCB7XG4gICAgbWV0aG9kczogWydQVVQnLCAnUE9TVCddLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS97dHlwZX0vX21hcHBpbmdcIixcbiAgICAgIFwie2luZGljZXN9L19tYXBwaW5nL3t0eXBlfVwiXG4gICAgXSxcbiAgICBwcmlvcml0eTogMTAsIC8vIGNvbGxpZGVzIHdpdGggcHV0IGRvYyBieSBpZFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAnRklFTEQnOiB7fVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ19pZCc6IHtcbiAgICAgICAgJ2luZGV4JzogSU5ERVhfU0VUVElORyxcbiAgICAgICAgJ3N0b3JlJzogQk9PTEVBTixcbiAgICAgICAgJ3BhdGgnOiBcIlwiXG4gICAgICB9LFxuICAgICAgJ190eXBlJzoge1xuICAgICAgICAnaW5kZXgnOiBJTkRFWF9TRVRUSU5HLFxuICAgICAgICAnc3RvcmUnOiBCT09MRUFOXG4gICAgICB9LFxuICAgICAgJ19zb3VyY2UnOiB7XG4gICAgICAgICdlbmFibGVkJzogQk9PTEVBTlxuICAgICAgfSxcbiAgICAgICdfYWxsJzoge1xuICAgICAgICAnZW5hYmxlZCc6IEJPT0xFQU5cbiAgICAgIH0sXG4gICAgICAnX2FuYWx5emVyJzoge1xuICAgICAgICAncGF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c2NyaXB0OiBcIlwiXG4gICAgICAgIH0sXG4gICAgICAgIF9fb25lX29mOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgc2NyaXB0OiBcIlwiLFxuICAgICAgICAgICAgcGFyYW1zOiB7fSxcbiAgICAgICAgICAgIGxhbmc6IFwiZ3Jvb3Z5XCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgc2NyaXB0OiBcIlwiLFxuICAgICAgICAgICAgICBwYXJhbXM6IHt9LFxuICAgICAgICAgICAgICBsYW5nOiBcImdyb292eVwiXG4gICAgICAgICAgICB9XG4gICAgICAgICAgXVxuICAgICAgICBdXG5cblxuICAgICAgfSxcbiAgICAgICdwcm9wZXJ0aWVzJzoge1xuICAgICAgICAnKic6IHtcbiAgICAgICAgICB0eXBlOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydzdHJpbmcnLCAnZmxvYXQnLCAnZG91YmxlJywgJ2J5dGUnLCAnc2hvcnQnLCAnaW50ZWdlcicsICdsb25nJywgJ2RhdGUnLCAnYm9vbGVhbicsXG4gICAgICAgICAgICAgICdiaW5hcnknLCAnb2JqZWN0JywgJ25lc3RlZCcsIFwiZ2VvX3BvaW50XCIsIFwiZ2VvX3NoYXBlXCJcbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgLy8gc3RyaW5nc1xuICAgICAgICAgIGluZGV4X25hbWU6ICcnLFxuICAgICAgICAgIHN0b3JlOiBCT09MRUFOLFxuICAgICAgICAgIGluZGV4OiBJTkRFWF9TRVRUSU5HLFxuICAgICAgICAgIHRlcm1fdmVjdG9yOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydubycsICd5ZXMnLCAnd2l0aF9vZmZzZXRzJywgJ3dpdGhfcG9zaXRpb25zJywgJ3dpdGhfcG9zaXRpb25zX29mZnNldHMnXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgYm9vc3Q6IDEuMCxcbiAgICAgICAgICBudWxsX3ZhbHVlOiAnJyxcbiAgICAgICAgICBvbWl0X25vcm1zOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgaW5kZXhfb3B0aW9uczoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFsnZG9jcycsICdmcmVxcycsICdwb3NpdGlvbnMnXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgYW5hbHl6ZXI6ICdzdGFuZGFyZCcsXG4gICAgICAgICAgaW5kZXhfYW5hbHl6ZXI6ICdzdGFuZGFyZCcsXG4gICAgICAgICAgc2VhcmNoX2FuYWx5emVyOiAnc3RhbmRhcmQnLFxuICAgICAgICAgIGluY2x1ZGVfaW5fYWxsOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW2ZhbHNlLCB0cnVlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgaWdub3JlX2Fib3ZlOiAxMCxcbiAgICAgICAgICBwb3NpdGlvbl9vZmZzZXRfZ2FwOiAwLFxuXG4gICAgICAgICAgLy8gbnVtZXJpY1xuICAgICAgICAgIHByZWNpc2lvbl9zdGVwOiA0LFxuICAgICAgICAgIGlnbm9yZV9tYWxmb3JtZWQ6IEJPT0xFQU4sXG5cbiAgICAgICAgICAvLyBnZW9fcG9pbnRcbiAgICAgICAgICBsYXRfbG9uOiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2VvaGFzaDoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGdlb2hhc2hfcHJlY2lzaW9uOiAnMW0nLFxuICAgICAgICAgIGdlb2hhc2hfcHJlZml4OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgdmFsaWRhdGU6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB2YWxpZGF0ZV9sYXQ6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICB2YWxpZGF0ZV9sb246IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBub3JtYWxpemU6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICAgICAgfSxcbiAgICAgICAgICBub3JtYWxpemVfbGF0OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgICAgIH0sXG4gICAgICAgICAgbm9ybWFsaXplX2xvbjoge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgLy8gZ2VvX3NoYXBlXG4gICAgICAgICAgdHJlZToge1xuICAgICAgICAgICAgX19vbmVfb2Y6IFsnZ2VvaGFzaCcsICdxdWFkdHJlZSddXG4gICAgICAgICAgfSxcbiAgICAgICAgICBwcmVjaXNpb246ICc1a20nLFxuICAgICAgICAgIHRyZWVfbGV2ZWxzOiAxMixcbiAgICAgICAgICBkaXN0YW5jZV9lcnJvcl9wY3Q6IDAuMDI1LFxuICAgICAgICAgIG9yaWVudGF0aW9uOiAnY2N3JyxcblxuICAgICAgICAgIC8vIGRhdGVzXG4gICAgICAgICAgZm9ybWF0OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydiYXNpY19kYXRlJywgJ2Jhc2ljX2RhdGVfdGltZScsICdiYXNpY19kYXRlX3RpbWVfbm9fbWlsbGlzJyxcbiAgICAgICAgICAgICAgJ2Jhc2ljX29yZGluYWxfZGF0ZScsICdiYXNpY19vcm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LCAnd2Vla3llYXJXZWVrRGF5JywgJ3llYXInLCAneWVhcl9tb250aCcsICd5ZWFyX21vbnRoX2RheSdcbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgZmllbGRkYXRhOiB7XG4gICAgICAgICAgICBmaWx0ZXI6IHtcbiAgICAgICAgICAgICAgcmVnZXg6ICcnLFxuICAgICAgICAgICAgICBmcmVxdWVuY3k6IHtcbiAgICAgICAgICAgICAgICBtaW46IDAuMDAxLFxuICAgICAgICAgICAgICAgIG1heDogMC4xLFxuICAgICAgICAgICAgICAgIG1pbl9zZWdtZW50X3NpemU6IDUwMFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBwb3N0aW5nc19mb3JtYXQ6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbJ2RpcmVjdCcsICdtZW1vcnknLCAncHVsc2luZycsICdibG9vbV9kZWZhdWx0JywgJ2Jsb29tX3B1bHNpbmcnLCAnZGVmYXVsdCddXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzaW1pbGFyaXR5OiB7XG4gICAgICAgICAgICBfX29uZV9vZjogWydkZWZhdWx0JywgJ0JNMjUnXVxuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvLyBvYmplY3RzXG4gICAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgICAgX19zY29wZV9saW5rOiAnX3B1dF9tYXBwaW5nLnt0eXBlfS5wcm9wZXJ0aWVzJ1xuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvLyBtdWx0aV9maWVsZFxuICAgICAgICAgIHBhdGg6IHtcbiAgICAgICAgICAgIF9fb25lX29mOiBbJ2p1c3RfbmFtZScsICdmdWxsJ11cbiAgICAgICAgICB9LFxuICAgICAgICAgIGZpZWxkczoge1xuICAgICAgICAgICAgJyonOiB7XG4gICAgICAgICAgICAgIF9fc2NvcGVfbGluazogJ19wdXRfbWFwcGluZy50eXBlLnByb3BlcnRpZXMuZmllbGQnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjb3B5X3RvOiB7X19vbmVfb2Y6IFsne2ZpZWxkfScsIFsne2ZpZWxkfSddXX0sXG5cbiAgICAgICAgICAvLyBuZXN0ZWRcbiAgICAgICAgICBpbmNsdWRlX2luX3BhcmVudDogQk9PTEVBTixcbiAgICAgICAgICBpbmNsdWRlX2luX3Jvb3Q6IEJPT0xFQU5cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICB9KTtcbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19wdXRfbWFwcGluZycsIHtcbiAgICBtZXRob2RzOiBbJ1BVVCddLFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS9fbWFwcGluZ1wiXG4gICAgXSxcbiAgICBkYXRhX2F1dG9jb21wbGV0ZV9ydWxlczoge1xuICAgICAgJ3t0eXBlfSc6IHtcbiAgICAgICAgX19zY29wZV9saW5rOiAnX3B1dF90eXBlX21hcHBpbmcnXG4gICAgICB9XG4gICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/mappings.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,aAAa,GAAG;AAClB,UAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,IAAI,CAAC;CAC7C;IAAE,OAAO,GAAG;AACX,UAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;CACxB,CAAC;;AAEF,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC5B,UAAU,CAC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AO,EAAE,EAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,EAAC;;;AAG7C,2BAAiB,EAAE,OAAO;AAC1B,yBAAe,EAAE,OAAO;SACzB;OACF;KACF;;GAEF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,cAAc,EAAE;AACzC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,oBAAoB,CACrB;AACD,2BAAuB,EAAE;AACvB,cAAQ,EAAE;AACR,oBAAY,EAAE,mBAAmB;OAClC;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/mappings.js", + "sourcesContent": [ + "var INDEX_SETTING = {\n __one_of: ['analyzed', 'not_analyzed', 'no']\n}, BOOLEAN = {\n __one_of: [true, false]\n};\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping\",\n \"{indices}/_mapping/{types}\",\n \"{indices}/{types}/_mapping\",\n \"_mapping\"\n ]\n });\n api.addEndpointDescription('_get_field_mapping', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping/field/{fields}\",\n \"{indices}/_mapping/{type}/field/{fields}\"\n ],\n url_params: {\n \"include_defaults\": \"__flag__\"\n }\n });\n api.addEndpointDescription('_delete_mapping', {\n methods: ['DELETE'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/_mapping\",\n \"{indices}/_mapping/{types}\",\n \"{indices}/{types}/_mapping\",\n \"_mapping\"\n ]\n });\n api.addEndpointDescription('_put_type_mapping', {\n methods: ['PUT', 'POST'],\n patterns: [\n \"{indices}/{type}/_mapping\",\n \"{indices}/_mapping/{type}\"\n ],\n priority: 10, // collides with put doc by id\n data_autocomplete_rules: {\n __template: {\n properties: {\n 'FIELD': {}\n }\n },\n '_id': {\n 'index': INDEX_SETTING,\n 'store': BOOLEAN,\n 'path': \"\"\n },\n '_type': {\n 'index': INDEX_SETTING,\n 'store': BOOLEAN\n },\n '_source': {\n 'enabled': BOOLEAN\n },\n '_all': {\n 'enabled': BOOLEAN\n },\n '_analyzer': {\n 'path': \"\"\n },\n '_field_names': {\n 'index': INDEX_SETTING\n },\n '_routing': {\n 'required': BOOLEAN,\n 'path': \"\"\n },\n '_index': {\n 'enabled': BOOLEAN\n },\n '_size': {\n 'enabled': BOOLEAN,\n 'store': BOOLEAN\n },\n '_parent': {\n __template: {\n 'type': ''\n },\n 'type': '{type}'\n },\n '_timestamp': {\n 'enabled': BOOLEAN,\n 'path': '',\n 'format': 'YYYY-MM-dd',\n 'default': \"\"\n },\n 'index_analyzer': 'standard',\n 'search_analyzer': 'standard',\n 'analyzer': 'standard',\n 'dynamic_date_formats': ['yyyy-MM-dd'],\n 'date_detection': BOOLEAN,\n 'numeric_detection': BOOLEAN,\n 'transform': {\n __template: {\n script: \"\"\n },\n __one_of: [\n {\n script: \"\",\n params: {},\n lang: \"groovy\"\n },\n [\n {\n script: \"\",\n params: {},\n lang: \"groovy\"\n }\n ]\n ]\n\n\n },\n 'properties': {\n '*': {\n type: {\n __one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',\n 'binary', 'object', 'nested', \"geo_point\", \"geo_shape\"\n ]\n },\n\n // strings\n index_name: '',\n store: BOOLEAN,\n index: INDEX_SETTING,\n term_vector: {\n __one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']\n },\n boost: 1.0,\n null_value: '',\n omit_norms: {\n __one_of: [true, false]\n },\n index_options: {\n __one_of: ['docs', 'freqs', 'positions']\n },\n analyzer: 'standard',\n index_analyzer: 'standard',\n search_analyzer: 'standard',\n include_in_all: {\n __one_of: [false, true]\n },\n ignore_above: 10,\n position_offset_gap: 0,\n\n // numeric\n precision_step: 4,\n ignore_malformed: BOOLEAN,\n\n // geo_point\n lat_lon: {\n __one_of: [true, false]\n },\n geohash: {\n __one_of: [true, false]\n },\n geohash_precision: '1m',\n geohash_prefix: {\n __one_of: [true, false]\n },\n validate: {\n __one_of: [true, false]\n },\n validate_lat: {\n __one_of: [true, false]\n },\n validate_lon: {\n __one_of: [true, false]\n },\n normalize: {\n __one_of: [true, false]\n },\n normalize_lat: {\n __one_of: [true, false]\n },\n normalize_lon: {\n __one_of: [true, false]\n },\n\n // geo_shape\n tree: {\n __one_of: ['geohash', 'quadtree']\n },\n precision: '5km',\n tree_levels: 12,\n distance_error_pct: 0.025,\n orientation: 'ccw',\n\n // dates\n format: {\n __one_of: ['basic_date', 'basic_date_time', 'basic_date_time_no_millis',\n 'basic_ordinal_date', 'basic_ordinal_date_time', 'basic_ordinal_date_time_no_millis',\n 'basic_time', 'basic_time_no_millis', 'basic_t_time', 'basic_t_time_no_millis',\n 'basic_week_date', 'basic_week_date_time', 'basic_week_date_time_no_millis',\n 'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction',\n 'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis',\n 'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis',\n 'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis',\n 't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year',\n 'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day'\n ]\n },\n\n fielddata: {\n filter: {\n regex: '',\n frequency: {\n min: 0.001,\n max: 0.1,\n min_segment_size: 500\n }\n }\n },\n postings_format: {\n __one_of: ['direct', 'memory', 'pulsing', 'bloom_default', 'bloom_pulsing', 'default']\n },\n similarity: {\n __one_of: ['default', 'BM25']\n },\n\n // objects\n properties: {\n __scope_link: '_put_mapping.{type}.properties'\n },\n\n // multi_field\n path: {\n __one_of: ['just_name', 'full']\n },\n fields: {\n '*': {\n __scope_link: '_put_mapping.type.properties.field'\n }\n },\n copy_to: {__one_of: ['{field}', ['{field}']]},\n\n // nested\n include_in_parent: BOOLEAN,\n include_in_root: BOOLEAN\n }\n }\n }\n\n });\n api.addEndpointDescription('_put_mapping', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_mapping\"\n ],\n data_autocomplete_rules: {\n '{type}': {\n __scope_link: '_put_type_mapping'\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/percolator.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_put_percolator', {\n priority: 10, // to override doc\n methods: ['PUT', 'POST'],\n patterns: [\"{index}/.percolator/{id}\"],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n },\n data_autocomplete_rules: {\n query: {}\n }\n });\n api.addEndpointDescription('_percolate', {\n methods: ['GET', 'POST'],\n priority: 10, // to override doc\n patterns: [\"{indices}/{type}/_percolate\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {},\n size: 10,\n track_scores: { __one_of: [true, false] },\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_id', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/{type}/{id}/_percolate\"],\n url_params: {\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"],\n percolate_index: \"{index}\",\n percolate_type: \"{type}\",\n percolate_routing: \"\",\n percolate_preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n version: 1,\n version_type: [\"external\", \"internal\"]\n },\n data_autocomplete_rules: {\n query: {},\n filter: {},\n size: 10,\n track_scores: { __one_of: [true, false] },\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_count', {\n methods: ['GET', 'POST'],\n patterns: [\"{indices}/{type}/_percolate/count\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {}\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL3BlcmNvbGF0b3IuanMiXSwibmFtZXMiOlt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mVmZXJfbm9kZTp4eXpcIiwgXCJfc2hhcmRzOjIsM1wiXSxcbiAgICAgIHJvdXRpbmc6IFwiXCIsXG4gICAgICBpZ25vcmVfdW5hdmFpbGFibGU6IFtcInRydWVcIiwgXCJmYWxzZVwiXSxcbiAgICAgIHBlcmNvbGF0ZV9mb3JtYXQ6IFtcImlkc1wiXVxuICAgIH0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgIGRvYzoge30sXG4gICAgICBxdWVyeToge30sXG4gICAgICBmaWx0ZXI6IHt9XG4gICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/percolator.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,iBAAiB,EAAE;AAC5C,YAAQ,EAAE,EAAE;AACZ,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,CACR,0BAA0B,CAC3B;AACD,cAAU,EAAE;AACV,eAAS,EAAE,CAAC;AACZ,oBAAc,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AACxC,eAAS,EAAE,CAAC,QAAQ,CAAC;AACrB,eAAS,EAAE,EAAE;AACb,cAAQ,EAAE,EAAE;AACZ,iBAAW,EAAE,EAAE;AACf,WAAK,EAAE,IAAI;AACX,mBAAa,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC;AACtC,mBAAa,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AAChC,eAAS,EAAE,UAAU;AACrB,eAAS,EAAE,IAAI;KAChB;AACD,2BAAuB,EAAE;AACvB,WAAK,EAAE,EAAE;KACV;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,YAAY,EAAE;AACvC,WAAO,EAAE,CAAC,KAAK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,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAC;AACvC,UAAI,EAAE,QAAQ;AACd,UAAI,EAAE,EAAE;AACR,eAAS,EAAE,EAAE;KACd;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,kBAAkB,EAAE;AAC7C,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,CACR,mCAAmC,CACpC;AACD,cAAU,EAAE;AACV,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,aAAO,EAAE,EAAE;AACX,wBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AACrC,sBAAgB,EAAE,CAAC,KAAK,CAAC;KAC1B;AACD,2BAAuB,EAAE;AACvB,SAAG,EAAE,EAAE;AACP,WAAK,EAAE,EAAE;AACT,YAAM,EAAE,EAAE;KACX;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/percolator.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_put_percolator', {\n priority: 10, // to override doc\n methods: ['PUT', 'POST'],\n patterns: [\n \"{index}/.percolator/{id}\"\n ],\n url_params: {\n \"version\": 1,\n \"version_type\": [\"external\", \"internal\"],\n \"op_type\": [\"create\"],\n \"routing\": \"\",\n \"parent\": \"\",\n \"timestamp\": \"\",\n \"ttl\": \"5m\",\n \"consistency\": [\"qurom\", \"one\", \"all\"],\n \"replication\": [\"sync\", \"async\"],\n \"refresh\": \"__flag__\",\n \"timeout\": \"1m\"\n },\n data_autocomplete_rules: {\n query: {}\n }\n });\n api.addEndpointDescription('_percolate', {\n methods: ['GET', 'POST'],\n priority: 10, // to override doc\n patterns: [\n \"{indices}/{type}/_percolate\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {},\n size: 10,\n track_scores: {__one_of: [true, false]},\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_id', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/{type}/{id}/_percolate\"\n ],\n url_params: {\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"],\n percolate_index: \"{index}\",\n percolate_type: \"{type}\",\n percolate_routing: \"\",\n percolate_preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n version: 1,\n version_type: [\"external\", \"internal\"]\n },\n data_autocomplete_rules: {\n query: {},\n filter: {},\n size: 10,\n track_scores: {__one_of: [true, false]},\n sort: \"_score\",\n aggs: {},\n highlight: {}\n }\n });\n api.addEndpointDescription('_percolate_count', {\n methods: ['GET', 'POST'],\n patterns: [\n \"{indices}/{type}/_percolate/count\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n ignore_unavailable: [\"true\", \"false\"],\n percolate_format: [\"ids\"]\n },\n data_autocomplete_rules: {\n doc: {},\n query: {},\n filter: {}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/query.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nvar _ = require(\"lodash\");\n\nvar SPAN_QUERIES = {\n // TODO add one_of for objects\n span_first: {\n __scope_link: '.span_first'\n },\n span_near: {\n __scope_link: '.span_near'\n },\n span_or: {\n __scope_link: '.span_or'\n },\n span_not: {\n __scope_link: '.span_not'\n },\n span_term: {\n __scope_link: '.span_term'\n }\n};\n\nvar DECAY_FUNC_DESC = {\n __template: {\n \"FIELD\": {\n \"origin\": \"\",\n \"scale\": \"\"\n }\n },\n \"{field}\": {\n \"origin\": \"\",\n \"scale\": \"\",\n \"offset\": \"\",\n \"decay\": 0.5\n }\n},\n SCORING_FUNCS = {\n \"script_score\": {\n __template: {\n \"script\": \"_score * doc['f'].value\"\n },\n \"script\": \"\",\n \"script_id\": \"\",\n \"lang\": \"groovy\",\n \"params\": {}\n },\n \"boost_factor\": 2.0,\n \"random_score\": {\n \"seed\": 314159265359\n },\n \"linear\": DECAY_FUNC_DESC,\n \"exp\": DECAY_FUNC_DESC,\n \"gauss\": DECAY_FUNC_DESC,\n \"field_value_factor\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"factor\": 1.2,\n \"modifier\": {\n __one_of: [\"none\", \"log\", \"log1p\", \"log2p\", \"ln\", \"ln1p\", \"ln2p\", \"square\", \"sqrt\", \"reciprocal\"]\n }\n }\n};\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('query', {\n match: {\n __template: {\n 'FIELD': 'TEXT'\n },\n '{field}': {\n 'query': '',\n 'operator': {\n __one_of: ['and', 'or']\n },\n 'type': {\n __one_of: ['phrase', 'phrase_prefix', 'boolean']\n },\n 'max_expansions': 10,\n 'analyzer': '',\n 'fuzziness': 1.0,\n 'prefix_length': 1\n }\n },\n match_phrase: {\n __template: {\n 'FIELD': 'PHRASE'\n },\n '{field}': {\n query: '',\n analyzer: ''\n }\n },\n match_phrase_prefix: {\n __template: {\n 'FIELD': 'PREFIX'\n },\n '{field}': {\n query: '',\n analyzer: '',\n max_expansions: 10,\n prefix_length: 1,\n fuzziness: 0.1\n }\n },\n multi_match: {\n __template: {\n 'query': '',\n 'fields': []\n },\n query: '',\n fields: ['{field}'],\n use_dis_max: {\n __template: true,\n __one_of: [true, false]\n },\n tie_breaker: 0.0,\n type: { __one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix'] }\n },\n bool: {\n must: [{\n __scope_link: '.'\n }],\n must_not: [{\n __scope_link: '.'\n }],\n should: [{\n __scope_link: '.'\n }],\n minimum_number_should_match: 1,\n boost: 1.0\n },\n boosting: {\n positive: {\n __scope_link: '.'\n },\n negative: {\n __scope_link: '.'\n },\n negative_boost: 0.2\n },\n ids: {\n type: '',\n values: []\n },\n constant_score: {\n __template: {\n filter: {},\n boost: 1.2\n },\n query: {},\n filter: {},\n boost: 1.2\n },\n dis_max: {\n __template: {\n tie_breaker: 0.7,\n boost: 1.2,\n queries: []\n },\n tie_breaker: 0.7,\n boost: 1.2,\n queries: [{\n __scope_link: '.'\n }]\n },\n field: {\n '{field}': {\n query: '',\n boost: 2.0,\n enable_position_increments: {\n __template: false,\n __one_of: [true, false]\n }\n }\n },\n filtered: {\n __template: {\n query: {},\n filter: {}\n },\n query: {},\n filter: {}\n },\n fuzzy_like_this: {\n fields: [],\n like_text: '',\n max_query_terms: 12\n },\n flt: {\n __scope_link: '.fuzzy_like_this'\n },\n fuzzy: {\n '{field}': {\n 'value': '',\n 'boost': 1.0,\n 'min_similarity': 0.5,\n 'prefix_length': 0\n }\n },\n has_child: {\n __template: {\n type: 'TYPE',\n query: {}\n },\n 'type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'max', 'sum', 'avg']\n },\n '_scope': '',\n 'query': {},\n 'min_children': 1,\n 'max_children': 10\n },\n has_parent: {\n __template: {\n parent_type: 'TYPE',\n query: {}\n },\n 'parent_type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'score']\n },\n '_scope': '',\n 'query': {}\n },\n match_all: {},\n more_like_this: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n fields: ['{field}'],\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: '',\n docs: [{\n _index: \"{index}\",\n _type: \"{type}\",\n _id: \"\"\n }],\n ids: [\"\"]\n },\n mlt: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n __scope_link: \".more_like_this\"\n },\n more_like_this_field: {\n __template: {\n 'FIELD': {\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n }\n },\n '{field}': {\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: ''\n }\n },\n prefix: {\n __template: {\n 'FIELD': {\n 'value': ''\n }\n },\n '{field}': {\n value: '',\n boost: 1.0\n }\n },\n query_string: {\n __template: {\n 'default_field': 'FIELD',\n 'query': 'this AND that OR thus'\n },\n query: '',\n default_field: '{field}',\n fields: ['{field}'],\n default_operator: {\n __one_of: ['OR', 'AND']\n },\n analyzer: '',\n allow_leading_wildcard: {\n __one_of: [true, false]\n },\n lowercase_expanded_terms: {\n __one_of: [true, false]\n },\n enable_position_increments: {\n __one_of: [true, false]\n },\n fuzzy_max_expansions: 50,\n fuzzy_min_sim: 0.5,\n fuzzy_prefix_length: 0,\n phrase_slop: 0,\n boost: 1.0,\n analyze_wildcard: {\n __one_of: [false, true]\n },\n auto_generate_phrase_queries: {\n __one_of: [false, true]\n },\n minimum_should_match: '20%',\n lenient: {\n __one_of: [false, true]\n },\n use_dis_max: {\n __one_of: [true, false]\n },\n tie_breaker: 0\n },\n simple_query_string: {\n __template: {\n query: \"\",\n fields: []\n },\n query: \"\",\n fields: [\"{field}\"],\n default_operator: { __one_of: [\"OR\", \"AND\"] },\n analyzer: \"\",\n flags: \"OR|AND|PREFIX\",\n lowercase_expanded_terms: { __one_of: [true, false] },\n locale: \"ROOT\",\n lenient: { __one_of: [true, false] }\n },\n range: {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n '{field}': {\n __template: {\n gte: 10,\n lte: 20\n },\n gte: 10,\n gt: 10,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n boost: 1.0\n }\n },\n span_first: {\n __template: {\n 'match': {\n 'span_term': {\n 'FIELD': 'VALUE'\n }\n },\n 'end': 3\n },\n match: SPAN_QUERIES\n },\n span_near: {\n __template: {\n 'clauses': [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }],\n slop: 12,\n in_order: false\n },\n clauses: [SPAN_QUERIES],\n slop: 12,\n in_order: {\n __one_of: [false, true]\n },\n collect_payloads: {\n __one_of: [false, true]\n }\n },\n span_term: {\n __template: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n span_not: {\n __template: {\n include: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n exclude: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n },\n include: SPAN_QUERIES,\n exclude: SPAN_QUERIES\n },\n span_or: {\n __template: {\n clauses: [{\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }]\n },\n clauses: [SPAN_QUERIES]\n },\n term: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n terms: {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n '{field}': [''],\n minimum_match: 1\n },\n top_children: {\n __template: {\n type: 'CHILD_TYPE',\n query: {}\n },\n type: '$CHILD_TYPE$',\n query: {},\n score: {\n __one_of: ['max', 'sum', 'avg']\n },\n factor: 5,\n incremental_factor: 2\n },\n wildcard: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n nested: {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n path: '',\n query: {},\n filter: {},\n score_mode: {\n __one_of: ['avg', 'total', 'max', 'none']\n }\n },\n custom_filters_score: {\n __template: {\n query: {},\n filters: [{\n filter: {}\n }]\n },\n query: {},\n filters: [{\n filter: {},\n boost: 2.0,\n script: ''\n }],\n score_mode: {\n __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply']\n },\n max_boost: 2.0,\n params: {},\n lang: ''\n },\n indices: {\n __template: {\n indices: ['INDEX1', 'INDEX2'],\n query: {}\n },\n indices: ['{index}'],\n query: {},\n no_match_query: {\n __scope_link: '.'\n }\n },\n geo_shape: {\n __template: {\n location: {},\n relation: 'within'\n },\n __scope_link: '.filter.geo_shape'\n },\n // js hint gets confused here\n /* jshint -W015 */\n function_score: _.defaults({\n __template: {\n query: {},\n functions: [{}]\n },\n query: {},\n filter: {},\n functions: [_.defaults({\n filter: {},\n weight: 1.0\n }, SCORING_FUNCS)],\n boost: 1.0,\n boost_mode: { __one_of: [\"multiply\", \"replace\", \"sum\", \"avg\", \"max\", \"min\"] },\n score_mode: { __one_of: [\"multiply\", \"sum\", \"first\", \"avg\", \"max\", \"min\"] },\n max_boost: 10\n }, SCORING_FUNCS)\n\n });\n};\n//# sourceMappingURL=data:application/json;base64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HVzZV9kaXNfbWF4OiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IHRydWUsXG4gICAgICAgIF9fb25lX29mOiBbdHJ1ZSwgZmFsc2VdXG4gICAgICB9LFxuICAgICAgdGllX2JyZWFrZXI6IDAuMCxcbiAgICAgIHR5cGU6IHtfX29uZV9vZjogWydiZXN0X2ZpZWxkcycsICdtb3N0X2ZpZWxkcycsICdjcm9zc19maWVsZHMnLCAncGhyYXNlJywgJ3BocmFzZV9wcmVmaXgnXX1cbiAgICB9LFxuICAgIGJvb2w6IHtcbiAgICAgIG11c3Q6IFtcbiAgICAgICAge1xuICAgICAgICAgIF9fc2NvcGVfbGluazogJy4nXG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBtdXN0X25vdDogW1xuICAgICAgICB7XG4gICAgICAgICAgX19zY29wZV9saW5rOiAnLidcbiAgICAgICAgfVxuICAgICAgXSxcbiAgICAgIHNob3VsZDogW1xuICAgICAgICB7XG4gICAgICAgICAgX19zY29wZV9saW5rOiAnLidcbiAgICAgICAgfVxuICAgICAgXSxcbiAgICAgIG1pbmltdW1fbnVtYmVyX3Nob3VsZF9tYXRjaDogMSxcbiAgICAgIGJvb3N0OiAxLjBcbiAgICB9LFxuICAgIGJvb3N0aW5nOiB7XG4gICAgICBwb3NpdGl2ZToge1xuICAgICAgICBfX3Njb3BlX2xpbms6ICcuJ1xuICAgICAgfSxcbiAgICAgIG5lZ2F0aXZlOiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogJy4nXG4gICAgICB9LFxuICAgICAgbmVnYXRpdmVfYm9vc3Q6IDAuMlxuICAgIH0sXG4gICAgaWRzOiB7XG4gICAgICB0eXBlOiAnJyxcbiAgICAgIHZhbHVlczogW11cbiAgICB9LFxuICAgIGNvbnN0YW50X3Njb3JlOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIGZpbHRlcjoge30sXG4gICAgICAgIGJvb3N0OiAxLjJcbiAgICAgIH0sXG4gICAgICBxdWVyeToge30sXG4gICAgICBmaWx0ZXI6IHt9LFxuICAgICAgYm9vc3Q6IDEuMlxuICAgIH0sXG4gICAgZGlzX21heDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICB0aWVfYnJlYWtlcjogMC43LFxuICAgICAgICBib29zdDogMS4yLFxuICAgICAgICBxdWVyaWVzOiBbXVxuICAgICAgfSxcbiAgICAgIHRpZV9icmVha2VyOiAwLjcsXG4gICAgICBib29zdDogMS4yLFxuICAgICAgcXVlcmllczogW1xuICAgICAgICB7XG4gICAgICAgICAgX19zY29wZV9saW5rOiAnLidcbiAgICAgICAgfVxuICAgICAgXVxuICAgIH0sXG4gICAgZmllbGQ6IHtcbiAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICBxdWVyeTogJycsXG4gICAgICAgIGJvb3N0OiAyLjAsXG4gICAgICAgIGVuYWJsZV9wb3NpdGlvbl9pbmNyZW1lbnRzOiB7XG4gICAgICAgICAgX190ZW1wbGF0ZTogZmFsc2UsXG4gICAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgZmlsdGVyZWQ6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgcXVlcnk6IHt9LFxuICAgICAgICBmaWx0ZXI6IHt9XG4gICAgICB9LFxuICAgICAgcXVlcnk6IHt9LFxuICAgICAgZmlsdGVyOiB7fVxuICAgIH0sXG4gICAgZnV6enlfbGlrZV90aGlzOiB7XG4gICAgICBmaWVsZHM6IFtdLFxuICAgICAgbGlrZV90ZXh0OiAnJyxcbiAgICAgIG1heF9xdWVyeV90ZXJtczogMTJcbiAgICB9LFxuICAgIGZsdDoge1xuICAgICAgX19zY29wZV9saW5rOiAnLmZ1enp5X2xpa2VfdGhpcydcbiAgICB9LFxuICAgIGZ1enp5OiB7XG4gICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgJ3ZhbHVlJzogJycsXG4gICAgICAgICdib29zdCc6IDEuMCxcbiAgICAgICAgJ21pbl9zaW1pbGFyaXR5JzogMC41LFxuICAgICAgICAncHJlZml4X2xlbmd0aCc6IDBcbiAgICAgIH1cbiAgICB9LFxuICAgIGhhc19jaGlsZDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICB0eXBlOiAnVFlQRScsXG4gICAgICAgIHF1ZXJ5OiB7fVxuICAgICAgfSxcbiAgICAgICd0eXBlJzogJ3t0eXBlfScsXG4gICAgICAnc2NvcmVfbW9kZSc6IHtcbiAgICAgICAgX19vbmVfb2Y6IFsnbm9uZScsICdtYXgnLCAnc3VtJywgJ2F2ZyddXG4gICAgICB9LFxuICAgICAgJ19zY29wZSc6ICcnLFxuICAgICAgJ3F1ZXJ5Jzoge30sXG4gICAgICAnbWluX2NoaWxkcmVuJzogMSxcbiAgICAgICdtYXhfY2hpbGRyZW4nOiAxMFxuICAgIH0sXG4gICAgaGFzX3BhcmVudDoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBwYXJlbnRfdHlwZTogJ1RZUEUnLFxuICAgICAgICBxdWVyeToge31cbiAgICAgIH0sXG4gICAgICAncGFyZW50X3R5cGUnOiAne3R5cGV9JyxcbiAgICAgICdzY29yZV9tb2RlJzoge1xuICAgICAgICBfX29uZV9vZjogWydub25lJywgJ3Njb3JlJ11cbiAgICAgIH0sXG4gICAgICAnX3Njb3BlJzogJycsXG4gICAgICAncXVlcnknOiB7fVxuICAgIH0sXG4gICAgbWF0Y2hfYWxsOiB7fSxcbiAgICBtb3JlX2xpa2VfdGhpczoge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAnZmllbGRzJzogWydGSUVMRCddLFxuICAgICAgICAnbGlrZV90ZXh0JzogJ3RleHQgbGlrZSB0aGlzIG9uZScsXG4gICAgICAgICdtaW5fdGVybV9mcmVxJzogMSxcbiAgICAgICAgJ21heF9xdWVyeV90ZXJtcyc6IDEyXG4gICAgICB9LFxuICAgICAgZmllb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VUVSSUVTXG4gICAgfSxcbiAgICBzcGFuX25lYXI6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ2NsYXVzZXMnOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgc3Bhbl90ZXJtOiB7XG4gICAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIF0sXG4gICAgICAgIHNsb3A6IDEyLFxuICAgICAgICBpbl9vcmRlcjogZmFsc2VcbiAgICAgIH0sXG4gICAgICBjbGF1c2VzOiBbXG4gICAgICAgIFNQQU5fUVVFUklFU1xuICAgICAgXSxcbiAgICAgIHNsb3A6IDEyLFxuICAgICAgaW5fb3JkZXI6IHtcbiAgICAgICAgX19vbmVfb2Y6IFtmYWxzZSwgdHJ1ZV1cbiAgICAgIH0sXG4gICAgICBjb2xsZWN0X3BheWxvYWRzOiB7XG4gICAgICAgIF9fb25lX29mOiBbZmFsc2UsIHRydWVdXG4gICAgICB9XG4gICAgfSxcbiAgICBzcGFuX3Rlcm06IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgICd7ZmllbGR9Jzoge1xuICAgICAgICB2YWx1ZTogJycsXG4gICAgICAgIGJvb3N0OiAyLjBcbiAgICAgIH1cbiAgICB9LFxuICAgIHNwYW5fbm90OiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIGluY2x1ZGU6IHtcbiAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICAgJ3ZhbHVlJzogJ1ZBTFVFJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZXhjbHVkZToge1xuICAgICAgICAgIHNwYW5fdGVybToge1xuICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAndmFsdWUnOiAnVkFMVUUnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgaW5jbHVkZTogU1BBTl9RVUVSSUVTLFxuICAgICAgZXhjbHVkZTogU1BBTl9RVUVSSUVTXG4gICAgfSxcbiAgICBzcGFuX29yOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIGNsYXVzZXM6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBzcGFuX3Rlcm06IHtcbiAgICAgICAgICAgICAgJ0ZJRUxEJzoge1xuICAgICAgICAgICAgICAgICd2YWx1ZSc6ICdWQUxVRSdcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGNsYXVzZXM6IFtcbiAgICAgICAgU1BBTl9RVUVSSUVTXG4gICAgICBdXG4gICAgfSxcbiAgICB0ZXJtOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICB2YWx1ZTogJ1ZBTFVFJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ3tmaWVsZH0nOiB7XG4gICAgICAgIHZhbHVlOiAnJyxcbiAgICAgICAgYm9vc3Q6IDIuMFxuICAgICAgfVxuICAgIH0sXG4gICAgdGVybXM6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgJ0ZJRUxEJzogWydWQUxVRTEnLCAnVkFMVUUyJ11cbiAgICAgIH0sXG4gICAgICAne2ZpZWxkfSc6IFsnJ10sXG4gICAgICBtaW5pbXVtX21hdGNoOiAxXG4gICAgfSxcbiAgICB0b3BfY2hpbGRyZW46IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgdHlwZTogJ0NISUxEX1RZUEUnLFxuICAgICAgICBxdWVyeToge31cbiAgICAgIH0sXG4gICAgICB0eXBlOiAnJENISUxEX1RZUEUkJyxcbiAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgIHNjb3JlOiB7XG4gICAgICAgIF9fb25lX29mOiBbJ21heCcsICdzdW0nLCAnYXZnJ11cbiAgICAgIH0sXG4gICAgICBmYWN0b3I6IDUsXG4gICAgICBpbmNyZW1lbnRhbF9mYWN0b3I6IDJcbiAgICB9LFxuICAgIHdpbGRjYXJkOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICB2YWx1ZTogJ1ZBTFVFJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ3tmaWVsZH0nOiB7XG4gICAgICAgIHZhbHVlOiAnJyxcbiAgICAgICAgYm9vc3Q6IDIuMFxuICAgICAgfVxuICAgIH0sXG4gICAgbmVzdGVkOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIHBhdGg6ICdwYXRoX3RvX25lc3RlZF9kb2MnLFxuICAgICAgICBxdWVyeToge31cbiAgICAgIH0sXG4gICAgICBwYXRoOiAnJyxcbiAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgIGZpbHRlcjoge30sXG4gICAgICBzY29yZV9tb2RlOiB7XG4gICAgICAgIF9fb25lX29mOiBbJ2F2ZycsICd0b3RhbCcsICdtYXgnLCAnbm9uZSddXG4gICAgICB9XG4gICAgfSxcbiAgICBjdXN0b21fZmlsdGVyc19zY29yZToge1xuICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICBxdWVyeToge30sXG4gICAgICAgIGZpbHRlcnM6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmaWx0ZXI6IHt9XG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgcXVlcnk6IHt9LFxuICAgICAgZmlsdGVyczogW1xuICAgICAgICB7XG4gICAgICAgICAgZmlsdGVyOiB7fSxcbiAgICAgICAgICBib29zdDogMi4wLFxuICAgICAgICAgIHNjcmlwdDogJydcbiAgICAgICAgfVxuICAgICAgXSxcbiAgICAgIHNjb3JlX21vZGU6IHtcbiAgICAgICAgX19vbmVfb2Y6IFsnZmlyc3QnLCAnbWluJywgJ21heCcsICd0b3RhbCcsICdhdmcnLCAnbXVsdGlwbHknXVxuICAgICAgfSxcbiAgICAgIG1heF9ib29zdDogMi4wLFxuICAgICAgcGFyYW1zOiB7fSxcbiAgICAgIGxhbmc6ICcnXG4gICAgfSxcbiAgICBpbmRpY2VzOiB7XG4gICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgIGluZGljZXM6IFsnSU5ERVgxJywgJ0lOREVYMiddLFxuICAgICAgICBxdWVyeToge31cbiAgICAgIH0sXG4gICAgICBpbmRpY2VzOiBbJ3tpbmRleH0nXSxcbiAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgIG5vX21hdGNoX3F1ZXJ5OiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogJy4nXG4gICAgICB9XG4gICAgfSxcbiAgICBnZW9fc2hhcGU6IHtcbiAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgbG9jYXRpb246IHt9LFxuICAgICAgICByZWxhdGlvbjogJ3dpdGhpbidcbiAgICAgIH0sXG4gICAgICBfX3Njb3BlX2xpbms6ICcuZmlsdGVyLmdlb19zaGFwZSdcbiAgICB9LFxuICAgIC8vIGpzIGhpbnQgZ2V0cyBjb25mdXNlZCBoZXJlXG4gICAgLyoganNoaW50IC1XMDE1ICovXG4gICAgZnVuY3Rpb25fc2NvcmU6IF8uZGVmYXVsdHMoe1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgcXVlcnk6IHt9LFxuICAgICAgICAgIGZ1bmN0aW9uczogW1xuICAgICAgICAgICAge31cbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIHF1ZXJ5OiB7fSxcbiAgICAgICAgZmlsdGVyOiB7fSxcbiAgICAgICAgZnVuY3Rpb25zOiBbXG4gICAgICAgICAgXy5kZWZhdWx0cyhcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgZmlsdGVyOiB7fSxcbiAgICAgICAgICAgICAgd2VpZ2h0OiAxLjBcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBTQ09SSU5HX0ZVTkNTXG4gICAgICAgICAgKVxuICAgICAgICBdLFxuICAgICAgICBib29zdDogMS4wLFxuICAgICAgICBib29zdF9tb2RlOiB7X19vbmVfb2Y6IFtcIm11bHRpcGx5XCIsIFwicmVwbGFjZVwiLCBcInN1bVwiLCBcImF2Z1wiLCBcIm1heFwiLCBcIm1pblwiXX0sXG4gICAgICAgIHNjb3JlX21vZGU6IHtfX29uZV9vZjogW1wibXVsdGlwbHlcIiwgXCJzdW1cIiwgXCJmaXJzdFwiLCBcImF2Z1wiLCBcIm1heFwiLCBcIm1pblwiXX0sXG4gICAgICAgIG1heF9ib29zdDogMTBcbiAgICAgIH0sXG4gICAgICBTQ09SSU5HX0ZVTkNTXG4gICAgKVxuXG4gIH0pO1xufTtcbiJdfQ==", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/query.js" + ], + "names": [], + "mappings": ";;AAAA,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAE1B,IAAI,YAAY,GAAG;;AAEjB,YAAU,EAAE;AACV,gBAAY,EAAE,aAAa;GAC5B;AACD,WAAS,EAAE;AACT,gBAAY,EAAE,YAAY;GAC3B;AACD,SAAO,EAAE;AACP,gBAAY,EAAE,UAAU;GACzB;AACD,UAAQ,EAAE;AACR,gBAAY,EAAE,WAAW;GAC1B;AACD,WAAS,EAAE;AACT,gBAAY,EAAE,YAAY;GAC3B;CACF,CAAC;;AAEF,IAAI,eAAe,GAAG;AA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AK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC;OAC9D;AACD,eAAS,EAAE,GAAG;AACd,YAAM,EAAE,EAAE;AACV,UAAI,EAAE,EAAE;KACT;AACD,WAAO,EAAE;AACP,gBAAU,EAAE;AACV,eAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC7B,aAAK,EAAE,EAAE;OACV;AACD,aAAO,EAAE,CAAC,SAAS,CAAC;AACpB,WAAK,EAAE,EAAE;AACT,oBAAc,EAAE;AACd,oBAAY,EAAE,GAAG;OAClB;KACF;AACD,aAAS,EAAE;AACT,gBAAU,EAAE;AACV,gBAAQ,EAAE,EAAE;AACZ,gBAAQ,EAAE,QAAQ;OACnB;AACD,kBAAY,EAAE,mBAAmB;KAClC;;;AAGD,kBAAc,EAAE,CAAC,CAAC,QAAQ,CAAC;AACvB,gBAAU,EAAE;AACV,aAAK,EAAE,EAAE;AACT,iBAAS,EAAE,CACT,EAAE,CACH;OACF;AACD,WAAK,EAAE,EAAE;AACT,YAAM,EAAE,EAAE;AACV,eAAS,EAAE,CACT,CAAC,CAAC,QAAQ,CACR;AACE,cAAM,EAAE,EAAE;AACV,cAAM,EAAE,GAAG;OACZ,EACD,aAAa,CACd,CACF;AACD,WAAK,EAAE,GAAG;AACV,gBAAU,EAAE,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAC;AAC3E,gBAAU,EAAE,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAC;AACzE,eAAS,EAAE,EAAE;KACd,EACD,aAAa,CACd;;GAEF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/query.js", + "sourcesContent": [ + "let _ = require(\"lodash\");\n\nvar SPAN_QUERIES = {\n // TODO add one_of for objects\n span_first: {\n __scope_link: '.span_first'\n },\n span_near: {\n __scope_link: '.span_near'\n },\n span_or: {\n __scope_link: '.span_or'\n },\n span_not: {\n __scope_link: '.span_not'\n },\n span_term: {\n __scope_link: '.span_term'\n }\n};\n\nvar DECAY_FUNC_DESC = {\n __template: {\n \"FIELD\": {\n \"origin\": \"\",\n \"scale\": \"\"\n }\n },\n \"{field}\": {\n \"origin\": \"\",\n \"scale\": \"\",\n \"offset\": \"\",\n \"decay\": 0.5\n }\n },\n SCORING_FUNCS = {\n \"script_score\": {\n __template: {\n \"script\": \"_score * doc['f'].value\"\n },\n \"script\": \"\",\n \"script_id\": \"\",\n \"lang\": \"groovy\",\n \"params\": {}\n },\n \"boost_factor\": 2.0,\n \"random_score\": {\n \"seed\": 314159265359\n },\n \"linear\": DECAY_FUNC_DESC,\n \"exp\": DECAY_FUNC_DESC,\n \"gauss\": DECAY_FUNC_DESC,\n \"field_value_factor\": {\n __template: {\n \"field\": \"\"\n },\n \"field\": \"{field}\",\n \"factor\": 1.2,\n \"modifier\": {\n __one_of: [\"none\", \"log\", \"log1p\", \"log2p\", \"ln\", \"ln1p\", \"ln2p\", \"square\", \"sqrt\", \"reciprocal\"]\n }\n }\n };\n\nmodule.exports = function (api) {\n api.addGlobalAutocompleteRules('query', {\n match: {\n __template: {\n 'FIELD': 'TEXT'\n },\n '{field}': {\n 'query': '',\n 'operator': {\n __one_of: ['and', 'or']\n },\n 'type': {\n __one_of: ['phrase', 'phrase_prefix', 'boolean']\n },\n 'max_expansions': 10,\n 'analyzer': '',\n 'fuzziness': 1.0,\n 'prefix_length': 1\n }\n },\n match_phrase: {\n __template: {\n 'FIELD': 'PHRASE'\n },\n '{field}': {\n query: '',\n analyzer: ''\n }\n },\n match_phrase_prefix: {\n __template: {\n 'FIELD': 'PREFIX'\n },\n '{field}': {\n query: '',\n analyzer: '',\n max_expansions: 10,\n prefix_length: 1,\n fuzziness: 0.1\n }\n },\n multi_match: {\n __template: {\n 'query': '',\n 'fields': []\n },\n query: '',\n fields: ['{field}'],\n use_dis_max: {\n __template: true,\n __one_of: [true, false]\n },\n tie_breaker: 0.0,\n type: {__one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix']}\n },\n bool: {\n must: [\n {\n __scope_link: '.'\n }\n ],\n must_not: [\n {\n __scope_link: '.'\n }\n ],\n should: [\n {\n __scope_link: '.'\n }\n ],\n minimum_number_should_match: 1,\n boost: 1.0\n },\n boosting: {\n positive: {\n __scope_link: '.'\n },\n negative: {\n __scope_link: '.'\n },\n negative_boost: 0.2\n },\n ids: {\n type: '',\n values: []\n },\n constant_score: {\n __template: {\n filter: {},\n boost: 1.2\n },\n query: {},\n filter: {},\n boost: 1.2\n },\n dis_max: {\n __template: {\n tie_breaker: 0.7,\n boost: 1.2,\n queries: []\n },\n tie_breaker: 0.7,\n boost: 1.2,\n queries: [\n {\n __scope_link: '.'\n }\n ]\n },\n field: {\n '{field}': {\n query: '',\n boost: 2.0,\n enable_position_increments: {\n __template: false,\n __one_of: [true, false]\n }\n }\n },\n filtered: {\n __template: {\n query: {},\n filter: {}\n },\n query: {},\n filter: {}\n },\n fuzzy_like_this: {\n fields: [],\n like_text: '',\n max_query_terms: 12\n },\n flt: {\n __scope_link: '.fuzzy_like_this'\n },\n fuzzy: {\n '{field}': {\n 'value': '',\n 'boost': 1.0,\n 'min_similarity': 0.5,\n 'prefix_length': 0\n }\n },\n has_child: {\n __template: {\n type: 'TYPE',\n query: {}\n },\n 'type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'max', 'sum', 'avg']\n },\n '_scope': '',\n 'query': {},\n 'min_children': 1,\n 'max_children': 10\n },\n has_parent: {\n __template: {\n parent_type: 'TYPE',\n query: {}\n },\n 'parent_type': '{type}',\n 'score_mode': {\n __one_of: ['none', 'score']\n },\n '_scope': '',\n 'query': {}\n },\n match_all: {},\n more_like_this: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n fields: ['{field}'],\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: '',\n docs: [{\n _index: \"{index}\",\n _type: \"{type}\",\n _id: \"\"\n }],\n ids: [\"\"]\n },\n mlt: {\n __template: {\n 'fields': ['FIELD'],\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n },\n __scope_link: \".more_like_this\"\n },\n more_like_this_field: {\n __template: {\n 'FIELD': {\n 'like_text': 'text like this one',\n 'min_term_freq': 1,\n 'max_query_terms': 12\n }\n },\n '{field}': {\n like_text: '',\n percent_terms_to_match: 0.3,\n min_term_freq: 2,\n max_query_terms: 25,\n stop_words: [''],\n min_doc_freq: 5,\n max_doc_freq: 100,\n min_word_len: 0,\n max_word_len: 0,\n boost_terms: 1,\n boost: 1.0,\n analyzer: ''\n }\n },\n prefix: {\n __template: {\n 'FIELD': {\n 'value': ''\n }\n },\n '{field}': {\n value: '',\n boost: 1.0\n }\n },\n query_string: {\n __template: {\n 'default_field': 'FIELD',\n 'query': 'this AND that OR thus'\n },\n query: '',\n default_field: '{field}',\n fields: ['{field}'],\n default_operator: {\n __one_of: ['OR', 'AND']\n },\n analyzer: '',\n allow_leading_wildcard: {\n __one_of: [true, false]\n },\n lowercase_expanded_terms: {\n __one_of: [true, false]\n },\n enable_position_increments: {\n __one_of: [true, false]\n },\n fuzzy_max_expansions: 50,\n fuzzy_min_sim: 0.5,\n fuzzy_prefix_length: 0,\n phrase_slop: 0,\n boost: 1.0,\n analyze_wildcard: {\n __one_of: [false, true]\n },\n auto_generate_phrase_queries: {\n __one_of: [false, true]\n },\n minimum_should_match: '20%',\n lenient: {\n __one_of: [false, true]\n },\n use_dis_max: {\n __one_of: [true, false]\n },\n tie_breaker: 0\n },\n simple_query_string: {\n __template: {\n query: \"\",\n fields: []\n },\n query: \"\",\n fields: [\"{field}\"],\n default_operator: {__one_of: [\"OR\", \"AND\"]},\n analyzer: \"\",\n flags: \"OR|AND|PREFIX\",\n lowercase_expanded_terms: {__one_of: [true, false]},\n locale: \"ROOT\",\n lenient: {__one_of: [true, false]}\n },\n range: {\n __template: {\n 'FIELD': {\n gte: 10,\n lte: 20\n }\n },\n '{field}': {\n __template: {\n gte: 10,\n lte: 20\n },\n gte: 10,\n gt: 10,\n lte: 20,\n lt: 20,\n time_zone: \"+1:00\",\n boost: 1.0\n }\n },\n span_first: {\n __template: {\n 'match': {\n 'span_term': {\n 'FIELD': 'VALUE'\n }\n },\n 'end': 3\n },\n match: SPAN_QUERIES\n },\n span_near: {\n __template: {\n 'clauses': [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ],\n slop: 12,\n in_order: false\n },\n clauses: [\n SPAN_QUERIES\n ],\n slop: 12,\n in_order: {\n __one_of: [false, true]\n },\n collect_payloads: {\n __one_of: [false, true]\n }\n },\n span_term: {\n __template: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n span_not: {\n __template: {\n include: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n },\n exclude: {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n },\n include: SPAN_QUERIES,\n exclude: SPAN_QUERIES\n },\n span_or: {\n __template: {\n clauses: [\n {\n span_term: {\n 'FIELD': {\n 'value': 'VALUE'\n }\n }\n }\n ]\n },\n clauses: [\n SPAN_QUERIES\n ]\n },\n term: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n terms: {\n __template: {\n 'FIELD': ['VALUE1', 'VALUE2']\n },\n '{field}': [''],\n minimum_match: 1\n },\n top_children: {\n __template: {\n type: 'CHILD_TYPE',\n query: {}\n },\n type: '$CHILD_TYPE$',\n query: {},\n score: {\n __one_of: ['max', 'sum', 'avg']\n },\n factor: 5,\n incremental_factor: 2\n },\n wildcard: {\n __template: {\n 'FIELD': {\n value: 'VALUE'\n }\n },\n '{field}': {\n value: '',\n boost: 2.0\n }\n },\n nested: {\n __template: {\n path: 'path_to_nested_doc',\n query: {}\n },\n path: '',\n query: {},\n filter: {},\n score_mode: {\n __one_of: ['avg', 'total', 'max', 'none']\n }\n },\n custom_filters_score: {\n __template: {\n query: {},\n filters: [\n {\n filter: {}\n }\n ]\n },\n query: {},\n filters: [\n {\n filter: {},\n boost: 2.0,\n script: ''\n }\n ],\n score_mode: {\n __one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply']\n },\n max_boost: 2.0,\n params: {},\n lang: ''\n },\n indices: {\n __template: {\n indices: ['INDEX1', 'INDEX2'],\n query: {}\n },\n indices: ['{index}'],\n query: {},\n no_match_query: {\n __scope_link: '.'\n }\n },\n geo_shape: {\n __template: {\n location: {},\n relation: 'within'\n },\n __scope_link: '.filter.geo_shape'\n },\n // js hint gets confused here\n /* jshint -W015 */\n function_score: _.defaults({\n __template: {\n query: {},\n functions: [\n {}\n ]\n },\n query: {},\n filter: {},\n functions: [\n _.defaults(\n {\n filter: {},\n weight: 1.0\n },\n SCORING_FUNCS\n )\n ],\n boost: 1.0,\n boost_mode: {__one_of: [\"multiply\", \"replace\", \"sum\", \"avg\", \"max\", \"min\"]},\n score_mode: {__one_of: [\"multiply\", \"sum\", \"first\", \"avg\", \"max\", \"min\"]},\n max_boost: 10\n },\n SCORING_FUNCS\n )\n\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/snapshot_restore.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [ + "tagged-template-literal" + ] + }, + "ignored": false, + "code": "'use strict';\n\nvar _templateObject = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']fs'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']fs']),\n _templateObject2 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']url'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']url']),\n _templateObject3 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']s3'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']s3']),\n _templateObject4 = _taggedTemplateLiteral(['type[\"\\']s*:s*[\"\\']hdfs'], ['type[\"\\']\\\\s*:\\\\s*[\"\\']hdfs']);\n\nfunction _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nmodule.exports = function (api) {\n api.addEndpointDescription('restore_snapshot', {\n methods: ['POST'],\n patterns: ['_snapshot/{id}/{id}/_restore'],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: { __one_of: [true, false] },\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\"\n }\n });\n\n api.addEndpointDescription('single_snapshot', {\n methods: ['GET', 'DELETE'],\n patterns: ['_snapshot/{id}/{id}']\n });\n\n api.addEndpointDescription('all_snapshots', {\n methods: ['GET'],\n patterns: ['_snapshot/{id}/_all']\n });\n\n api.addEndpointDescription('put_snapshot', {\n methods: ['PUT'],\n patterns: ['_snapshot/{id}/{id}'],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: { __one_of: [true, false] },\n include_global_state: { __one_of: [true, false] },\n partial: { __one_of: [true, false] }\n }\n });\n\n api.addEndpointDescription('_snapshot_status', {\n methods: ['GET'],\n patterns: ['_snapshot/_status', '_snapshot/{id}/_status', '_snapshot/{id}/{ids}/_status']\n });\n\n function getRepositoryType(context, editor) {\n var iter = editor.iterForCurrentLoc();\n // for now just iterate back to the first \"type\" key\n var t = iter.getCurrentToken();\n var type;\n while (t && t.type.indexOf(\"url\") < 0) {\n if (t.type === 'variable' && t.value === '\"type\"') {\n t = editor.parser.nextNonEmptyToken(iter);\n if (!t || t.type !== \"punctuation.colon\") {\n // weird place to be in, but safe choice..\n break;\n }\n t = editor.parser.nextNonEmptyToken(iter);\n if (t && t.type === \"string\") {\n type = t.value.replace(/\"/g, '');\n }\n break;\n }\n t = editor.parser.prevNonEmptyToken(iter);\n }\n return type;\n }\n\n api.addEndpointDescription('put_repository', {\n methods: ['PUT'],\n patterns: ['_snapshot/{id}'],\n data_autocomplete_rules: {\n __template: { \"type\": \"\" },\n\n \"type\": {\n __one_of: [\"fs\", \"url\", \"s3\", \"hdfs\"]\n },\n \"settings\": {\n __one_of: [{\n //fs\n __condition: {\n lines_regex: String.raw(_templateObject)\n },\n __template: {\n location: \"path\"\n },\n location: \"path\",\n compress: { __one_of: [true, false] },\n concurrent_streams: 5,\n chunk_size: \"10m\",\n max_restore_bytes_per_sec: \"20mb\",\n max_snapshot_bytes_per_sec: \"20mb\"\n }, { // url\n __condition: {\n lines_regex: String.raw(_templateObject2)\n },\n __template: {\n url: \"\"\n },\n url: \"\",\n concurrent_streams: 5\n }, { //s3\n __condition: {\n lines_regex: String.raw(_templateObject3)\n },\n __template: {\n bucket: \"\"\n },\n bucket: \"\",\n region: \"\",\n base_path: \"\",\n concurrent_streams: 5,\n chunk_size: \"10m\",\n compress: { __one_of: [true, false] }\n }, { // hdfs\n __condition: {\n lines_regex: String.raw(_templateObject4)\n },\n __template: {\n path: \"\"\n },\n uri: \"\",\n path: \"some/path\",\n load_defaults: { __one_of: [true, false] },\n conf_location: \"cfg.xml\",\n concurrent_streams: 5,\n compress: { __one_of: [true, false] },\n chunk_size: \"10m\"\n }]\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL3NuYXBzaG90X3Jlc3RvcmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTtBQUM5QixLQUFHLENBQUMsc0JBQXNCLENBQUMsa0JBQWtCLEVBQUU7QUFDN0MsV0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDO0FBQ2pCLFlBQVEsRUFBRSxDQUNSLDhCQUE4QixDQUMvQjtBQUNELGNBQVUsRUFBRTtBQUNWLHlCQUFtQixFQUFFLFVBQVU7S0FDaEM7QUFDRCwyQkFBdUIsRUFBRTtBQUN2QixhQUFPLEVBQUUsR0FBRztBQUNaLHdCQUFrQixFQUFFLEVBQUMsUUFBUSxFQUFFLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQyxFQUFDO0FBQzdDLDBCQUFvQixFQUFFLEtBQUs7QUFDM0Isb0JBQWMsRUFBRSxZQUFZO0FBQzVCLHdCQUFrQixFQUFFLG1CQUFtQjtLQUN4QztHQUNGLENBQUMsQ0FBQzs7QUFHSCxLQUFHLENBQUMsc0JBQXNCLENBQUMsaUJBQWlCLEVBQUU7QUFDNUMsV0FBTyxFQUFFLENBQUMsS0FBSyxFQUFFLFFBQVEsQ0FBQztBQUM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W9uOiBcInBhdGhcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgbG9jYXRpb246IFwicGF0aFwiLFxuICAgICAgICAgIGNvbXByZXNzOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgICAgIGNvbmN1cnJlbnRfc3RyZWFtczogNSxcbiAgICAgICAgICBjaHVua19zaXplOiBcIjEwbVwiLFxuICAgICAgICAgIG1heF9yZXN0b3JlX2J5dGVzX3Blcl9zZWM6IFwiMjBtYlwiLFxuICAgICAgICAgIG1heF9zbmFwc2hvdF9ieXRlc19wZXJfc2VjOiBcIjIwbWJcIlxuICAgICAgICB9LFxuICAgICAgICAgIHsvLyB1cmxcbiAgICAgICAgICAgIF9fY29uZGl0aW9uOiB7XG4gICAgICAgICAgICAgIGxpbmVzX3JlZ2V4OiBTdHJpbmcucmF3YHR5cGVbXCInXVxccyo6XFxzKltcIidddXJsYFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF9fdGVtcGxhdGU6IHtcbiAgICAgICAgICAgICAgdXJsOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdXJsOiBcIlwiLFxuICAgICAgICAgICAgY29uY3VycmVudF9zdHJlYW1zOiA1XG4gICAgICAgICAgfSxcbiAgICAgICAgICB7IC8vczNcbiAgICAgICAgICAgIF9fY29uZGl0aW9uOiB7XG4gICAgICAgICAgICAgIGxpbmVzX3JlZ2V4OiBTdHJpbmcucmF3YHR5cGVbXCInXVxccyo6XFxzKltcIiddczNgXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICBidWNrZXQ6IFwiXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBidWNrZXQ6IFwiXCIsXG4gICAgICAgICAgICByZWdpb246IFwiXCIsXG4gICAgICAgICAgICBiYXNlX3BhdGg6IFwiXCIsXG4gICAgICAgICAgICBjb25jdXJyZW50X3N0cmVhbXM6IDUsXG4gICAgICAgICAgICBjaHVua19zaXplOiBcIjEwbVwiLFxuICAgICAgICAgICAgY29tcHJlc3M6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHsvLyBoZGZzXG4gICAgICAgICAgICBfX2NvbmRpdGlvbjoge1xuICAgICAgICAgICAgICBsaW5lc19yZWdleDogU3RyaW5nLnJhd2B0eXBlW1wiJ11cXHMqOlxccypbXCInXWhkZnNgXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICBwYXRoOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdXJpOiBcIlwiLFxuICAgICAgICAgICAgcGF0aDogXCJzb21lL3BhdGhcIixcbiAgICAgICAgICAgIGxvYWRfZGVmYXVsdHM6IHtfX29uZV9vZjogW3RydWUsIGZhbHNlXX0sXG4gICAgICAgICAgICBjb25mX2xvY2F0aW9uOiBcImNmZy54bWxcIixcbiAgICAgICAgICAgIGNvbmN1cnJlbnRfc3RyZWFtczogNSxcbiAgICAgICAgICAgIGNvbXByZXNzOiB7X19vbmVfb2Y6IFt0cnVlLCBmYWxzZV19LFxuICAgICAgICAgICAgY2h1bmtfc2l6ZTogXCIxMG1cIlxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/snapshot_restore.js" + ], + "names": [], + "mappings": ";;;;;;;;;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,kBAAkB,EAAE;AAC7C,WAAO,EAAE,CAAC,MAAM,CAAC;AACjB,YAAQ,EAAE,CACR,8BAA8B,CAC/B;AACD,cAAU,EAAE;AACV,yBAAmB,EAAE,UAAU;KAChC;AACD,2BAAu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+ "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('restore_snapshot', {\n methods: ['POST'],\n patterns: [\n '_snapshot/{id}/{id}/_restore'\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: {__one_of: [true, false]},\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\"\n }\n });\n\n\n api.addEndpointDescription('single_snapshot', {\n methods: ['GET', 'DELETE'],\n patterns: [\n '_snapshot/{id}/{id}'\n ]\n });\n\n api.addEndpointDescription('all_snapshots', {\n methods: ['GET'],\n patterns: [\n '_snapshot/{id}/_all'\n ]\n });\n\n api.addEndpointDescription('put_snapshot', {\n methods: ['PUT'],\n patterns: [\n '_snapshot/{id}/{id}'\n ],\n url_params: {\n wait_for_completion: \"__flag__\"\n },\n data_autocomplete_rules: {\n indices: \"*\",\n ignore_unavailable: {__one_of: [true, false]},\n include_global_state: {__one_of: [true, false]},\n partial: {__one_of: [true, false]}\n }\n });\n\n api.addEndpointDescription('_snapshot_status', {\n methods: ['GET'],\n patterns: [\n '_snapshot/_status',\n '_snapshot/{id}/_status',\n '_snapshot/{id}/{ids}/_status'\n ]\n });\n\n\n function getRepositoryType(context, editor) {\n var iter = editor.iterForCurrentLoc();\n // for now just iterate back to the first \"type\" key\n var t = iter.getCurrentToken();\n var type;\n while (t && t.type.indexOf(\"url\") < 0) {\n if (t.type === 'variable' && t.value === '\"type\"') {\n t = editor.parser.nextNonEmptyToken(iter);\n if (!t || t.type !== \"punctuation.colon\") {\n // weird place to be in, but safe choice..\n break;\n }\n t = editor.parser.nextNonEmptyToken(iter);\n if (t && t.type === \"string\") {\n type = t.value.replace(/\"/g, '');\n }\n break;\n }\n t = editor.parser.prevNonEmptyToken(iter);\n }\n return type;\n }\n\n api.addEndpointDescription('put_repository', {\n methods: ['PUT'],\n patterns: [\n '_snapshot/{id}'\n ],\n data_autocomplete_rules: {\n __template: {\"type\": \"\"},\n\n \"type\": {\n __one_of: [\"fs\", \"url\", \"s3\", \"hdfs\"]\n },\n \"settings\": {\n __one_of: [{\n //fs\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']fs`\n },\n __template: {\n location: \"path\"\n },\n location: \"path\",\n compress: {__one_of: [true, false]},\n concurrent_streams: 5,\n chunk_size: \"10m\",\n max_restore_bytes_per_sec: \"20mb\",\n max_snapshot_bytes_per_sec: \"20mb\"\n },\n {// url\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']url`\n },\n __template: {\n url: \"\"\n },\n url: \"\",\n concurrent_streams: 5\n },\n { //s3\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']s3`\n },\n __template: {\n bucket: \"\"\n },\n bucket: \"\",\n region: \"\",\n base_path: \"\",\n concurrent_streams: 5,\n chunk_size: \"10m\",\n compress: {__one_of: [true, false]}\n },\n {// hdfs\n __condition: {\n lines_regex: String.raw`type[\"']\\s*:\\s*[\"']hdfs`\n },\n __template: {\n path: \"\"\n },\n uri: \"\",\n path: \"some/path\",\n load_defaults: {__one_of: [true, false]},\n conf_location: \"cfg.xml\",\n concurrent_streams: 5,\n compress: {__one_of: [true, false]},\n chunk_size: \"10m\"\n }\n ]\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/search.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_search', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_search\", \"{indices}/_search\", \"_search\"],\n url_params: {\n q: \"\",\n df: \"\",\n analyzer: \"\",\n default_operator: [\"AND\", \"OR\"],\n explain: \"__flag__\",\n _source: \"\",\n _source_include: \"\",\n _source_exclude: \"\",\n fields: [],\n sort: \"\",\n track_scores: \"__flag__\",\n timeout: 1,\n from: 0,\n size: 10,\n search_type: [\"dfs_query_then_fetch\", \"dfs_query_and_fetch\", \"query_then_fetch\", \"query_and_fetch\", \"count\", \"scan\"],\n terminate_after: 10,\n lowercase_expanded_terms: [\"true\", \"false\"],\n analyze_wildcard: \"__flag__\",\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n scroll: \"5m\",\n scroll_id: \"\",\n routing: \"\",\n query_cache: [\"true\", \"false\"]\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n __template: {\n 'NAME': {\n 'TYPE': {}\n }\n }\n // populated by a global rule\n },\n aggs: {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n\n post_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n size: {\n __template: 20\n },\n from: 0,\n sort: {\n __template: [{\n 'FIELD': {\n 'order': 'desc'\n }\n }],\n __any_of: [{\n '{field}': {\n 'order': {\n __one_of: ['desc', 'asc']\n },\n missing: {\n __one_of: ['_last', '_first']\n },\n mode: {\n __one_of: ['min', 'max', 'avg', 'sum']\n },\n nested_path: \"\",\n nested_filter: {\n __scope_link: \"GLOBAL.filter\"\n }\n }\n }, '{field}', '_score', {\n '_geo_distance': {\n __template: {\n \"FIELD\": {\n lat: 40,\n lon: -70\n },\n order: \"asc\"\n },\n \"{field}\": {\n __one_of: [{\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }, [{\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }], [\"\"], \"\"]\n },\n distance_type: { __one_of: [\"sloppy_arc\", \"arc\", \"plane\"] },\n sort_mode: { __one_of: [\"min\", \"max\", \"avg\"] },\n order: { __one_of: [\"asc\", \"desc\"] },\n unit: \"km\"\n }\n }]\n },\n fields: ['{field}'],\n fielddata_fields: [\"{field}\"],\n script_fields: {\n __template: {\n 'FIELD': {\n 'script': ''\n }\n },\n '*': {\n __scope_link: 'GLOBAL.SCRIPT_ENV'\n }\n },\n partial_fields: {\n __template: {\n 'NAME': {\n include: []\n }\n },\n '*': {\n include: [],\n exclude: []\n }\n },\n highlight: {\n // populated by a global rule\n },\n _source: {\n __one_of: [\"{field}\", [\"{field}\"], {\n \"include\": {\n __one_of: [\"{field}\", [\"{field}\"]]\n },\n \"exclude\": {\n __one_of: [\"{field}\", [\"{field}\"]]\n }\n }]\n },\n explain: {\n __one_of: [true, false]\n },\n stats: [''],\n timeout: \"1s\",\n version: { __one_of: [true, false] }\n }\n });\n\n api.addEndpointDescription('_search_template', {\n methods: ['GET'],\n patterns: [\"{indices}/{types}/_search/template\", \"{indices}/_search/template\", \"_search/template\"],\n data_autocomplete_rules: {\n \"template\": {\n __one_of: [{ __scope_link: \"_search\" }, { \"file\": \"\" }, { \"id\": \"\" }]\n },\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_get_delete_search_template', {\n methods: ['GET', 'DELETE'],\n patterns: [\"_search/template/{id}\"]\n });\n\n api.addEndpointDescription('_put_search_template', {\n methods: ['PUT'],\n patterns: [\"_search/template/{id}\"],\n data_autocomplete_rules: {\n \"template\": {\n __scope_link: \"_search\"\n }\n }\n });\n\n api.addEndpointDescription('_search_shards', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\"{indices}/{types}/_search_shards\", \"{indices}/_search_shards\", \"_search_shards\"],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n local: \"__flag__\"\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL3NlYXJjaC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLFNBQVMsRUFBRTtBQUNwQyxXQUFPLEVBQUUsQ0FBQyxLQUFLLEVBQUUsTUFBTSxDQUFDO0FBQ3hCLFlBQVEsRUFBRSxFQUFFO0FBQ1osWUFBUSxFQUFFLENBQ1IsMkJBQTJCLEVBQzNCLG1CQUFtQixFQUNuQixTQUFTLENBQ1Y7QUFDRCxjQUFVLEVBQUU7QUFDVixPQUFDLEVBQUUsRUFBRTtBQUNMLFFBQUUsRUFBRSxFQUFFO0FBQ04sY0FBUSxFQUFFLEVBQUU7QUFDWixzQkFBZ0IsRUFBRSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUM7QUFDL0IsYUFBTyxFQUFFLFVBQVU7QUFDbkIsYUFBTyxFQUFFLEVBQUU7QUFDWCxxQkFBZSxFQUFFLEVBQUU7QUFDbkIscUJBQWUsRUFBRSxFQUFFO0FBQ25CLFlBQU0sRUFBRSxFQUFFO0FBQ1YsVUFBSSxFQUFFLEVBQUU7QUFDUixrQkFBWSxFQUFFLFVBQVU7QUFDeEIsYUFBTyxFQUFFLENBQUM7QUFDVixVQUFJLEVBQUUsQ0FBQztBQUNQLF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ZXJfbm9kZTp4eXpcIiwgXCJfc2hhcmRzOjIsM1wiXSxcbiAgICAgIHNjcm9sbDogXCI1bVwiLFxuICAgICAgc2Nyb2xsX2lkOiBcIlwiLFxuICAgICAgcm91dGluZzogXCJcIixcbiAgICAgIHF1ZXJ5X2NhY2hlOiBbXCJ0cnVlXCIsIFwiZmFsc2VcIl1cbiAgICB9LFxuICAgIGRhdGFfYXV0b2NvbXBsZXRlX3J1bGVzOiB7XG4gICAgICBxdWVyeToge1xuICAgICAgICAvLyBwb3B1bGF0ZWQgYnkgYSBnbG9iYWwgcnVsZVxuICAgICAgfSxcbiAgICAgIGZhY2V0czoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgJ05BTUUnOiB7XG4gICAgICAgICAgICAnVFlQRSc6IHt9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9LFxuICAgICAgYWdnczoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgXCJOQU1FXCI6IHtcbiAgICAgICAgICAgIFwiQUdHX1RZUEVcIjoge31cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG5cbiAgICAgIHBvc3RfZmlsdGVyOiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogJ0dMT0JBTC5maWx0ZXInXG4gICAgICB9LFxuICAgICAgc2l6ZToge1xuICAgICAgICBfX3RlbXBsYXRlOiAyMFxuICAgICAgfSxcbiAgICAgIGZyb206IDAsXG4gICAgICBzb3J0OiB7XG4gICAgICAgIF9fdGVtcGxhdGU6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICAnRklFTEQnOiB7XG4gICAgICAgICAgICAgICdvcmRlcic6ICdkZXNjJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgXSxcbiAgICAgICAgX19hbnlfb2Y6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICAne2ZpZWxkfSc6IHtcbiAgICAgICAgICAgICAgJ29yZGVyJzoge1xuICAgICAgICAgICAgICAgIF9fb25lX29mOiBbJ2Rlc2MnLCAnYXNjJ11cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgbWlzc2luZzoge1xuICAgICAgICAgICAgICAgIF9fb25lX29mOiBbJ19sYXN0JywgJ19maXJzdCddXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIG1vZGU6IHtcbiAgICAgICAgICAgICAgICBfX29uZV9vZjogWydtaW4nLCAnbWF4JywgJ2F2ZycsICdzdW0nXVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBuZXN0ZWRfcGF0aDogXCJcIixcbiAgICAgICAgICAgICAgbmVzdGVkX2ZpbHRlcjoge1xuICAgICAgICAgICAgICAgIF9fc2NvcGVfbGluazogXCJHTE9CQUwuZmlsdGVyXCJcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgJ3tmaWVsZH0nLFxuICAgICAgICAgICdfc2NvcmUnLFxuICAgICAgICAgIHtcbiAgICAgICAgICAgICdfZ2VvX2Rpc3RhbmNlJzoge1xuICAgICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgICAgXCJGSUVMRFwiOiB7XG4gICAgICAgICAgICAgICAgICBsYXQ6IDQwLFxuICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG9yZGVyOiBcImFzY1wiXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIFwie2ZpZWxkfVwiOiB7XG4gICAgICAgICAgICAgICAgX19vbmVfb2Y6IFtcbiAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICAgICAgICAgICAgIGxhdDogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgbGF0OiA0MCxcbiAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXQ6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgIGxhdDogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgbG9uOiAtNzBcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgIFtcIlwiXSxcbiAgICAgICAgICAgICAgICAgIFwiXCJcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGRpc3RhbmNlX3R5cGU6IHtfX29uZV9vZjogW1wic2xvcHB5X2FyY1wiLCBcImFyY1wiLCBcInBsYW5lXCJdfSxcbiAgICAgICAgICAgICAgc29ydF9tb2RlOiB7X19vbmVfb2Y6IFtcIm1pblwiLCBcIm1heFwiLCBcImF2Z1wiXX0sXG4gICAgICAgICAgICAgIG9yZGVyOiB7X19vbmVfb2Y6IFtcImFzY1wiLCBcImRlc2NcIl19LFxuICAgICAgICAgICAgICB1bml0OiBcImttXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBmaWVsZHM6IFsne2ZpZWxkfSddLFxuICAgICAgZmllbGRkYXRhX2ZpZWxkczogW1wie2ZpZWxkfVwiXSxcbiAgICAgIHNjcmlwdF9maWVsZHM6IHtcbiAgICAgICAgX190ZW1wbGF0ZToge1xuICAgICAgICAgICdGSUVMRCc6IHtcbiAgICAgICAgICAgICdzY3JpcHQnOiAnJ1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgJyonOiB7XG4gICAgICAgICAgX19zY29wZV9saW5rOiAnR0xPQkFMLlNDUklQVF9FTlYnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBwYXJ0aWFsX2ZpZWxkczoge1xuICAgICAgICBfX3RlbXBsYXRlOiB7XG4gICAgICAgICAgJ05BTUUnOiB7XG4gICAgICAgICAgICBpbmNsdWRlOiBbXVxuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgJyonOiB7XG4gICAgICAgICAgaW5jbHVkZTogW10sXG4gICAgICAgICAgZXhjbHVkZTogW11cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGhpZ2hsaWdodDoge1xuICAgICAgICAvLyBwb3B1bGF0ZWQgYnkgYSBnbG9iYWwgcnVsZVxuICAgICAgfSxcbiAgICAgIF9zb3VyY2U6IHtcbiAgICAgICAgX19vbmVfb2Y6IFtcbiAgICAgICAgICBcIntmaWVsZH1cIixcbiAgICAgICAgICBbXCJ7ZmllbGR9XCJdLFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIFwiaW5jbHVkZVwiOiB7XG4gICAgICAgICAgICAgIF9fb25lX29mOiBbXG4gICAgICAgICAgICAgICAgXCJ7ZmllbGR9XCIsXG4gICAgICAgICAgICAgICAgW1wie2ZpZWxkfVwiXVxuICAgICAgICAgICAgICBdXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJleGNsdWRlXCI6IHtcbiAgICAgICAgICAgICAgX19vbmVfb2Y6IFtcbiAgICAgICAgICAgICAgICBcIntmaWVsZH1cIixcbiAgICAgICAgICAgICAgICBbXCJ7ZmllbGR9XCJdXG4gICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBleHBsYWluOiB7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YXR0ZXJuczogW1xuICAgICAgXCJfc2VhcmNoL3RlbXBsYXRlL3tpZH1cIlxuICAgIF0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgIFwidGVtcGxhdGVcIjoge1xuICAgICAgICBfX3Njb3BlX2xpbms6IFwiX3NlYXJjaFwiXG4gICAgICB9XG4gICAgfVxuICB9KTtcblxuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3NlYXJjaF9zaGFyZHMnLCB7XG4gICAgbWV0aG9kczogWydHRVQnXSxcbiAgICBwcmlvcml0eTogMTAsIC8vIGNvbGxpZGVzIHdpdGggZ2V0IGRvYyBieSBpZFxuICAgIHBhdHRlcm5zOiBbXG4gICAgICBcIntpbmRpY2VzfS97dHlwZXN9L19zZWFyY2hfc2hhcmRzXCIsXG4gICAgICBcIntpbmRpY2VzfS9fc2VhcmNoX3NoYXJkc1wiLFxuICAgICAgXCJfc2VhcmNoX3NoYXJkc1wiXG4gICAgXSxcbiAgICB1cmxfcGFyYW1zOiB7XG4gICAgICBwcmVmZXJlbmNlOiBbXCJfcHJpbWFyeVwiLCBcIl9wcmltYXJ5X2ZpcnN0XCIsIFwiX2xvY2FsXCIsIFwiX29ubHlfbm9kZTp4eXpcIiwgXCJfcHJlZmVyX25vZGU6eHl6XCIsIFwiX3NoYXJkczoyLDNcIl0sXG4gICAgICByb3V0aW5nOiBcIlwiLFxuICAgICAgbG9jYWw6IFwiX19mbGFnX19cIlxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/search.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,SAAS,EAAE;AACpC,WAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACxB,YAAQ,EAAE,EAAE;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EAAE,EAAE,EAAC,EACZ,EAAC,IAAI,EAAE,EAAE,EAAC,CACX;OACF;AACD,cAAQ,EAAE,EAAE;KACb;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,6BAA6B,EAAE;AACxD,WAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC1B,YAAQ,EAAE,CACR,uBAAuB,CACxB;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,sBAAsB,EAAE;AACjD,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,uBAAuB,CACxB;AACD,2BAAuB,EAAE;AACvB,gBAAU,EAAE;AACV,oBAAY,EAAE,SAAS;OACxB;KACF;GACF,CAAC,CAAC;;AAEH,KAAG,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;AAC3C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,EAAE;AACZ,YAAQ,EAAE,CACR,kCAAkC,EAClC,0BAA0B,EAC1B,gBAAgB,CACjB;AACD,cAAU,EAAE;AACV,gBAAU,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC;AACzG,aAAO,EAAE,EAAE;AACX,WAAK,EAAE,UAAU;KAClB;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/search.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_search', {\n methods: ['GET', 'POST'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_search\",\n \"{indices}/_search\",\n \"_search\"\n ],\n url_params: {\n q: \"\",\n df: \"\",\n analyzer: \"\",\n default_operator: [\"AND\", \"OR\"],\n explain: \"__flag__\",\n _source: \"\",\n _source_include: \"\",\n _source_exclude: \"\",\n fields: [],\n sort: \"\",\n track_scores: \"__flag__\",\n timeout: 1,\n from: 0,\n size: 10,\n search_type: [\"dfs_query_then_fetch\", \"dfs_query_and_fetch\", \"query_then_fetch\", \"query_and_fetch\", \"count\", \"scan\"],\n terminate_after: 10,\n lowercase_expanded_terms: [\"true\", \"false\"],\n analyze_wildcard: \"__flag__\",\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n scroll: \"5m\",\n scroll_id: \"\",\n routing: \"\",\n query_cache: [\"true\", \"false\"]\n },\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n __template: {\n 'NAME': {\n 'TYPE': {}\n }\n }\n // populated by a global rule\n },\n aggs: {\n __template: {\n \"NAME\": {\n \"AGG_TYPE\": {}\n }\n }\n },\n\n post_filter: {\n __scope_link: 'GLOBAL.filter'\n },\n size: {\n __template: 20\n },\n from: 0,\n sort: {\n __template: [\n {\n 'FIELD': {\n 'order': 'desc'\n }\n }\n ],\n __any_of: [\n {\n '{field}': {\n 'order': {\n __one_of: ['desc', 'asc']\n },\n missing: {\n __one_of: ['_last', '_first']\n },\n mode: {\n __one_of: ['min', 'max', 'avg', 'sum']\n },\n nested_path: \"\",\n nested_filter: {\n __scope_link: \"GLOBAL.filter\"\n }\n }\n },\n '{field}',\n '_score',\n {\n '_geo_distance': {\n __template: {\n \"FIELD\": {\n lat: 40,\n lon: -70\n },\n order: \"asc\"\n },\n \"{field}\": {\n __one_of: [\n {\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n },\n [\n {\n __template: {\n lat: 40,\n lon: -70\n },\n lat: 40,\n lon: -70\n }\n ],\n [\"\"],\n \"\"\n ]\n },\n distance_type: {__one_of: [\"sloppy_arc\", \"arc\", \"plane\"]},\n sort_mode: {__one_of: [\"min\", \"max\", \"avg\"]},\n order: {__one_of: [\"asc\", \"desc\"]},\n unit: \"km\"\n }\n }\n ]\n },\n fields: ['{field}'],\n fielddata_fields: [\"{field}\"],\n script_fields: {\n __template: {\n 'FIELD': {\n 'script': ''\n }\n },\n '*': {\n __scope_link: 'GLOBAL.SCRIPT_ENV'\n }\n },\n partial_fields: {\n __template: {\n 'NAME': {\n include: []\n }\n },\n '*': {\n include: [],\n exclude: []\n }\n },\n highlight: {\n // populated by a global rule\n },\n _source: {\n __one_of: [\n \"{field}\",\n [\"{field}\"],\n {\n \"include\": {\n __one_of: [\n \"{field}\",\n [\"{field}\"]\n ]\n },\n \"exclude\": {\n __one_of: [\n \"{field}\",\n [\"{field}\"]\n ]\n }\n }\n ]\n },\n explain: {\n __one_of: [true, false]\n },\n stats: [''],\n timeout: \"1s\",\n version: {__one_of: [true, false]}\n }\n });\n\n api.addEndpointDescription('_search_template', {\n methods: ['GET'],\n patterns: [\n \"{indices}/{types}/_search/template\",\n \"{indices}/_search/template\",\n \"_search/template\"\n ],\n data_autocomplete_rules: {\n \"template\": {\n __one_of: [\n {__scope_link: \"_search\"},\n {\"file\": \"\"},\n {\"id\": \"\"}\n ]\n },\n \"params\": {}\n }\n });\n\n api.addEndpointDescription('_get_delete_search_template', {\n methods: ['GET', 'DELETE'],\n patterns: [\n \"_search/template/{id}\"\n ]\n });\n\n api.addEndpointDescription('_put_search_template', {\n methods: ['PUT'],\n patterns: [\n \"_search/template/{id}\"\n ],\n data_autocomplete_rules: {\n \"template\": {\n __scope_link: \"_search\"\n }\n }\n });\n\n api.addEndpointDescription('_search_shards', {\n methods: ['GET'],\n priority: 10, // collides with get doc by id\n patterns: [\n \"{indices}/{types}/_search_shards\",\n \"{indices}/_search_shards\",\n \"_search_shards\"\n ],\n url_params: {\n preference: [\"_primary\", \"_primary_first\", \"_local\", \"_only_node:xyz\", \"_prefer_node:xyz\", \"_shards:2,3\"],\n routing: \"\",\n local: \"__flag__\"\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/settings.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nmodule.exports = function (api) {\n\n api.addEndpointDescription('_get_settings', {\n patterns: [\"{indices}/_settings\", \"_settings\"],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n api.addEndpointDescription('_put_settings', {\n methods: ['PUT'],\n patterns: [\"{indices}/_settings\", \"_settings\"],\n data_autocomplete_rules: {\n refresh_interval: '1s',\n number_of_shards: 5,\n number_of_replicas: 1,\n 'blocks.read_only': {\n __one_of: [false, true]\n },\n 'blocks.read': {\n __one_of: [true, false]\n },\n 'blocks.write': {\n __one_of: [true, false]\n },\n 'blocks.metadata': {\n __one_of: [true, false]\n },\n term_index_interval: 32,\n term_index_divisor: 1,\n 'translog.flush_threshold_ops': 5000,\n 'translog.flush_threshold_size': '200mb',\n 'translog.flush_threshold_period': '30m',\n 'translog.disable_flush': {\n __one_of: [true, false]\n },\n 'cache.filter.max_size': '2gb',\n 'cache.filter.expire': '2h',\n 'gateway.snapshot_interval': '10s',\n routing: {\n allocation: {\n include: {\n tag: ''\n },\n exclude: {\n tag: ''\n },\n require: {\n tag: ''\n },\n total_shards_per_node: -1\n }\n },\n 'recovery.initial_shards': {\n __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1']\n },\n 'ttl.disable_purge': {\n __one_of: [true, false]\n },\n analysis: {\n analyzer: {},\n tokenizer: {},\n filter: {},\n char_filter: {}\n },\n 'cache.query.enable': {\n __one_of: [true, false]\n },\n shadow_replicas: {\n __one_of: [true, false]\n },\n shared_filesystem: {\n __one_of: [true, false]\n },\n data_path: 'path'\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL3NldHRpbmdzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxDQUFDLE9BQU8sR0FBRyxVQUFVLEdBQUcsRUFBRTs7QUFFOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGVBQWUsRUFBRTtBQUMxQyxZQUFRLEVBQUUsQ0FDUixxQkFBcUIsRUFDckIsV0FBVyxDQUNaO0FBQ0QsY0FBVSxFQUFFO0FBQ1YsbUJBQWEsRUFBRSxVQUFVO0tBQzFCO0dBQ0YsQ0FBQyxDQUFDO0FBQ0gsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGVBQWUsRUFBRTtBQUMxQyxXQUFPLEVBQUUsQ0FBQyxLQUFLLENBQUM7QUFDaEIsWUFBUSxFQUFFLENBQ1IscUJBQXFCLEVBQ3JCLFdBQVcsQ0FDWjtBQUNELDJCQUF1QixFQUFFO0FBQ3ZCLHNCQUFnQixFQUFFLElBQUk7QUFDdEIsc0JBQWdCLEVBQUUsQ0FBQztBQUNuQix3QkFBa0IsRUFBRSxDQUFDO0FBQ3JCLHdCQUFrQixFQUFFO0FBQ2xCLGdCQUFRLEVBQUUsQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDO09BQ3hCO0FBQ0QsbUJBQWEsRUFBRTtBQUNiLGdCQUFRLEVBQUUsQ0FBQyxJQUFJLEVBQUUsS0FBSyxDQUFDO09BQ3hCO0FBQ0Qsb0JBQWM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2F0aW9uOiB7XG4gICAgICAgICAgaW5jbHVkZToge1xuICAgICAgICAgICAgdGFnOiAnJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZXhjbHVkZToge1xuICAgICAgICAgICAgdGFnOiAnJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAgcmVxdWlyZToge1xuICAgICAgICAgICAgdGFnOiAnJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAgdG90YWxfc2hhcmRzX3Blcl9ub2RlOiAtMVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgJ3JlY292ZXJ5LmluaXRpYWxfc2hhcmRzJzoge1xuICAgICAgICBfX29uZV9vZjogWydxdW9ydW0nLCAncXVvcnVtLTEnLCAnaGFsZicsICdmdWxsJywgJ2Z1bGwtMSddXG4gICAgICB9LFxuICAgICAgJ3R0bC5kaXNhYmxlX3B1cmdlJzoge1xuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgIGFuYWx5c2lzOiB7XG4gICAgICAgIGFuYWx5emVyOiB7fSxcbiAgICAgICAgdG9rZW5pemVyOiB7fSxcbiAgICAgICAgZmlsdGVyOiB7fSxcbiAgICAgICAgY2hhcl9maWx0ZXI6IHt9XG4gICAgICB9LFxuICAgICAgJ2NhY2hlLnF1ZXJ5LmVuYWJsZSc6IHtcbiAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgIH0sXG4gICAgICBzaGFkb3dfcmVwbGljYXM6IHtcbiAgICAgICAgX19vbmVfb2Y6IFt0cnVlLCBmYWxzZV1cbiAgICAgIH0sXG4gICAgICBzaGFyZWRfZmlsZXN5c3RlbToge1xuICAgICAgICBfX29uZV9vZjogW3RydWUsIGZhbHNlXVxuICAgICAgfSxcbiAgICAgIGRhdGFfcGF0aDogJ3BhdGgnXG4gICAgfVxuICB9KTtcbn07XG4iXX0=", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense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,eAAG,EAAE,EAAE;WACR;AACD,+BAAqB,EAAE,CAAC,CAAC;SAC1B;OACF;AACD,+BAAyB,EAAE;AACzB,gBAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;OAC3D;AACD,yBAAmB,EAAE;AACnB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,cAAQ,EAAE;AACR,gBAAQ,EAAE,EAAE;AACZ,iBAAS,EAAE,EAAE;AACb,cAAM,EAAE,EAAE;AACV,mBAAW,EAAE,EAAE;OAChB;AACD,0BAAoB,EAAE;AACpB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,qBAAe,EAAE;AACf,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,uBAAiB,EAAE;AACjB,gBAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;OACxB;AACD,eAAS,EAAE,MAAM;KAClB;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/settings.js", + "sourcesContent": [ + "module.exports = function (api) {\n\n api.addEndpointDescription('_get_settings', {\n patterns: [\n \"{indices}/_settings\",\n \"_settings\"\n ],\n url_params: {\n flat_settings: \"__flag__\"\n }\n });\n api.addEndpointDescription('_put_settings', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_settings\",\n \"_settings\"\n ],\n data_autocomplete_rules: {\n refresh_interval: '1s',\n number_of_shards: 5,\n number_of_replicas: 1,\n 'blocks.read_only': {\n __one_of: [false, true]\n },\n 'blocks.read': {\n __one_of: [true, false]\n },\n 'blocks.write': {\n __one_of: [true, false]\n },\n 'blocks.metadata': {\n __one_of: [true, false]\n },\n term_index_interval: 32,\n term_index_divisor: 1,\n 'translog.flush_threshold_ops': 5000,\n 'translog.flush_threshold_size': '200mb',\n 'translog.flush_threshold_period': '30m',\n 'translog.disable_flush': {\n __one_of: [true, false]\n },\n 'cache.filter.max_size': '2gb',\n 'cache.filter.expire': '2h',\n 'gateway.snapshot_interval': '10s',\n routing: {\n allocation: {\n include: {\n tag: ''\n },\n exclude: {\n tag: ''\n },\n require: {\n tag: ''\n },\n total_shards_per_node: -1\n }\n },\n 'recovery.initial_shards': {\n __one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1']\n },\n 'ttl.disable_purge': {\n __one_of: [true, false]\n },\n analysis: {\n analyzer: {},\n tokenizer: {},\n filter: {},\n char_filter: {}\n },\n 'cache.query.enable': {\n __one_of: [true, false]\n },\n shadow_replicas: {\n __one_of: [true, false]\n },\n shared_filesystem: {\n __one_of: [true, false]\n },\n data_path: 'path'\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/templates.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "'use strict';\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_delete_template', {\n methods: ['DELETE'],\n patterns: [\"_template/{id}\"]\n });\n api.addEndpointDescription('_get_template', {\n methods: ['GET'],\n patterns: [\"_template/{id}\", \"_template\"]\n });\n api.addEndpointDescription('_put_template', {\n methods: ['PUT'],\n patterns: [\"_template/{id}\"],\n data_autocomplete_rules: {\n template: 'index*',\n warmers: { __scope_link: '_warmer' },\n mappings: { __scope_link: '_put_mapping' },\n settings: { __scope_link: '_put_settings' }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL3RlbXBsYXRlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxHQUFHLEVBQUU7QUFDOUIsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGtCQUFrQixFQUFFO0FBQzdDLFdBQU8sRUFBRSxDQUFDLFFBQVEsQ0FBQztBQUNuQixZQUFRLEVBQUUsQ0FDUixnQkFBZ0IsQ0FDakI7R0FDRixDQUFDLENBQUM7QUFDSCxLQUFHLENBQUMsc0JBQXNCLENBQUMsZUFBZSxFQUFFO0FBQzFDLFdBQU8sRUFBRSxDQUFDLEtBQUssQ0FBQztBQUNoQixZQUFRLEVBQUUsQ0FDUixnQkFBZ0IsRUFDaEIsV0FBVyxDQUNaO0dBQ0YsQ0FBQyxDQUFDO0FBQ0gsS0FBRyxDQUFDLHNCQUFzQixDQUFDLGVBQWUsRUFBRTtBQUMxQyxXQUFPLEVBQUUsQ0FBQyxLQUFLLENBQUM7QUFDaEIsWUFBUSxFQUFFLENBQ1IsZ0JBQWdCLENBQ2pCO0FBQ0QsMkJBQXVCLEVBQUU7QUFDdkIsY0FBUSxFQUFFLFFBQVE7QUFDbEIsYUFBTyxFQUFFLEVBQUMsWUFBWSxFQUFFLFNBQVMsRUFBQztBQUNsQyxjQUFRLEVBQUUsRUFBQyxZQUFZLEVBQUUsY0FBYyxFQUFDO0FBQ3hDLGNBQVEsRUFBRSxFQUFDLFlBQVksRUFBRSxl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19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/templates.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,kBAAkB,EAAE;AAC7C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,gBAAgB,CACjB;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,gBAAgB,EAChB,WAAW,CACZ;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,eAAe,EAAE;AAC1C,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,gBAAgB,CACjB;AACD,2BAAuB,EAAE;AACvB,cAAQ,EAAE,QAAQ;AAClB,aAAO,EAAE,EAAC,YAAY,EAAE,SAAS,EAAC;AAClC,cAAQ,EAAE,EAAC,YAAY,EAAE,cAAc,EAAC;AACxC,cAAQ,EAAE,EAAC,YAAY,EAAE,eAAe,EAAC;KAC1C;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/templates.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_delete_template', {\n methods: ['DELETE'],\n patterns: [\n \"_template/{id}\",\n ]\n });\n api.addEndpointDescription('_get_template', {\n methods: ['GET'],\n patterns: [\n \"_template/{id}\",\n \"_template\",\n ]\n });\n api.addEndpointDescription('_put_template', {\n methods: ['PUT'],\n patterns: [\n \"_template/{id}\",\n ],\n data_autocomplete_rules: {\n template: 'index*',\n warmers: {__scope_link: '_warmer'},\n mappings: {__scope_link: '_put_mapping'},\n settings: {__scope_link: '_put_settings'}\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + }, + "{\"filename\":\"/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/warmers.js\",\"extra\":{},\"env\":{},\"retainLines\":false,\"nonStandard\":true,\"experimental\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"stage\":2,\"blacklist\":[],\"optional\":[],\"modules\":\"common\",\"moduleIds\":false,\"jsxPragma\":\"React.createElement\",\"plugins\":[],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"keepModuleIdExtensions\":false,\"auxiliaryCommentAfter\":\"\",\"externalHelpers\":false,\"metadataUsedHelpers\":false,\"breakConfig\":false,\"sourceType\":\"module\"}:5.8.23": { + "metadata": { + "modules": { + "imports": [], + "exports": { + "exported": [], + "specifiers": [] + } + }, + "usedHelpers": [] + }, + "ignored": false, + "code": "\"use strict\";\n\nmodule.exports = function (api) {\n api.addEndpointDescription('_get_warmer', {\n patterns: [\"_warmer\", \"_warmer/{name}\", \"{indices}/_warmer\", \"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_delete_warmer', {\n methods: ['DELETE'],\n patterns: [\"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_put_warmer', {\n methods: ['PUT'],\n patterns: [\"{indices}/_warmer/{name}\", \"{indices}/{types}/_warmer/{name}\"],\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n // populated by a global rule\n },\n aggs: {},\n sort: {\n __scope_link: \"_search.sort\"\n }\n }\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9naWxseWIvZGV2L3NlbnNpdGl2ZS9zZW5zZS9pbnN0YWxsZWRQbHVnaW5zL3NlbnNlL2FwaV9zZXJ2ZXIvZXNfMV8wL3dhcm1lcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQ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hcm1lclwiLCBcIntpbmRpY2VzfS9fd2FybWVyL3tuYW1lfVwiXVxuICB9KTtcbiAgYXBpLmFkZEVuZHBvaW50RGVzY3JpcHRpb24oJ19kZWxldGVfd2FybWVyJywge1xuICAgIG1ldGhvZHM6IFsnREVMRVRFJ10sXG4gICAgcGF0dGVybnM6IFtcbiAgICAgIFwie2luZGljZXN9L193YXJtZXIve25hbWV9XCJcbiAgICBdXG4gIH0pO1xuICBhcGkuYWRkRW5kcG9pbnREZXNjcmlwdGlvbignX3B1dF93YXJtZXInLCB7XG4gICAgbWV0aG9kczogWydQVVQnXSxcbiAgICBwYXR0ZXJuczogW1xuICAgICAgXCJ7aW5kaWNlc30vX3dhcm1lci97bmFtZX1cIixcbiAgICAgIFwie2luZGljZXN9L3t0eXBlc30vX3dhcm1lci97bmFtZX1cIlxuICAgIF0sXG4gICAgZGF0YV9hdXRvY29tcGxldGVfcnVsZXM6IHtcbiAgICAgIHF1ZXJ5OiB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9LFxuICAgICAgZmFjZXRzOiB7XG4gICAgICAgIC8vIHBvcHVsYXRlZCBieSBhIGdsb2JhbCBydWxlXG4gICAgICB9LFxuICAgICAgYWdnczoge30sXG4gICAgICBzb3J0OiB7XG4gICAgICAgIF9fc2NvcGVfbGluazogXCJfc2VhcmNoLnNvcnRcIlxuICAgICAgfVxuICAgIH1cbiAgfSk7XG59O1xuIl19", + "ast": null, + "map": { + "version": 3, + "sources": [ + "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/warmers.js" + ], + "names": [], + "mappings": ";;AAAA,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE;AAC9B,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,YAAQ,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,0BAA0B,CAAC;GACzF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;AAC3C,WAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,YAAQ,EAAE,CACR,0BAA0B,CAC3B;GACF,CAAC,CAAC;AACH,KAAG,CAAC,sBAAsB,CAAC,aAAa,EAAE;AACxC,WAAO,EAAE,CAAC,KAAK,CAAC;AAChB,YAAQ,EAAE,CACR,0BAA0B,EAC1B,kCAAkC,CACnC;AACD,2BAAuB,EAAE;AACvB,WAAK,EAAE;;OAEN;AACD,YAAM,EAAE;;OAEP;AACD,UAAI,EAAE,EAAE;AACR,UAAI,EAAE;AACJ,oBAAY,EAAE,cAAc;OAC7B;KACF;GACF,CAAC,CAAC;CACJ,CAAC", + "file": "/Users/gillyb/dev/sensitive/sense/installedPlugins/sense/api_server/es_1_0/warmers.js", + "sourcesContent": [ + "module.exports = function (api) {\n api.addEndpointDescription('_get_warmer', {\n patterns: [\"_warmer\", \"_warmer/{name}\", \"{indices}/_warmer\", \"{indices}/_warmer/{name}\"]\n });\n api.addEndpointDescription('_delete_warmer', {\n methods: ['DELETE'],\n patterns: [\n \"{indices}/_warmer/{name}\"\n ]\n });\n api.addEndpointDescription('_put_warmer', {\n methods: ['PUT'],\n patterns: [\n \"{indices}/_warmer/{name}\",\n \"{indices}/{types}/_warmer/{name}\"\n ],\n data_autocomplete_rules: {\n query: {\n // populated by a global rule\n },\n facets: {\n // populated by a global rule\n },\n aggs: {},\n sort: {\n __scope_link: \"_search.sort\"\n }\n }\n });\n};\n" + ] + }, + "mtime": 1454362615000 + } +} \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/a573941f02f4331f81046356ebb667eb.swf b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/a573941f02f4331f81046356ebb667eb.swf new file mode 100644 index 0000000..8bad6a3 Binary files /dev/null and b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/a573941f02f4331f81046356ebb667eb.swf differ diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/commons.bundle.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/commons.bundle.js new file mode 100644 index 0000000..8014d85 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/commons.bundle.js @@ -0,0 +1,94 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // install a JSONP callback for chunk loading +/******/ var parentJsonpFunction = window["webpackJsonp"]; +/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) { +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0, callbacks = []; +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(installedChunks[chunkId]) +/******/ callbacks.push.apply(callbacks, installedChunks[chunkId]); +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ for(moduleId in moreModules) { +/******/ modules[moduleId] = moreModules[moduleId]; +/******/ } +/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules); +/******/ while(callbacks.length) +/******/ callbacks.shift().call(null, __webpack_require__); +/******/ if(moreModules[0]) { +/******/ installedModules[0] = 0; +/******/ return __webpack_require__(0); +/******/ } +/******/ }; + +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // object to store loaded and loading chunks +/******/ // "0" means "already loaded" +/******/ // Array means "loading", array contains callbacks +/******/ var installedChunks = { +/******/ 2:0 +/******/ }; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = function requireEnsure(chunkId, callback) { +/******/ // "0" is the signal for "already loaded" +/******/ if(installedChunks[chunkId] === 0) +/******/ return callback.call(null, __webpack_require__); + +/******/ // an array means "currently loading". +/******/ if(installedChunks[chunkId] !== undefined) { +/******/ installedChunks[chunkId].push(callback); +/******/ } else { +/******/ // start chunk loading +/******/ installedChunks[chunkId] = [callback]; +/******/ var head = document.getElementsByTagName('head')[0]; +/******/ var script = document.createElement('script'); +/******/ script.type = 'text/javascript'; +/******/ script.charset = 'utf-8'; +/******/ script.async = true; + +/******/ script.src = __webpack_require__.p + "" + chunkId + "." + ({"3":"sense"}[chunkId]||chunkId) + ".bundle.js"; +/******/ head.appendChild(script); +/******/ } +/******/ }; + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/bundles/"; +/******/ }) +/************************************************************************/ +/******/ ([]); \ No newline at end of file diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/commons.style.css b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/commons.style.css new file mode 100644 index 0000000..2ca6a93 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/commons.style.css @@ -0,0 +1,11938 @@ +.app-links { + text-align: justify; +} +.app-links .app-link { + display: inline-block; + vertical-align: top; + text-align: left; + width: 68px; + margin: 0px 10px; + padding: 10px; + border-radius: 4px; +} +.app-links .app-link .app-icon { + display: block; + height: 48px; + width: 48px; + background-position: center; + background-size: contain; + border-radius: 4px; + background-color: #b4bcc2; + width: 100%; +} +.app-links .app-link .app-icon-missing { + text-align: center; + font-size: 2.7em; + font-weight: bold; + font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #fff; +} +.app-links .app-link .app-title { + color: #444444; + font-size: 0.9em; + width: 100%; + text-align: center; + margin-top: 3px; +} +.app-links .app-link:hover .app-title { + text-decoration: underline; +} +.app-links .app-link.active { + background: #ecf0f1; +} +.app-links .app-link.active .app-title { + text-decoration: underline; +} +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +mark { + background: #ff0; + color: #000; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + box-sizing: content-box; + height: 0; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-appearance: textfield; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { + background: transparent !important; + color: #000 !important; + box-shadow: none !important; + text-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + .navbar { + display: none; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; + src: url(/bundles/node_modules/bootstrap/fonts/glyphicons-halflings-regular.eot); + src: url(/bundles/node_modules/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'), url(/bundles/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff2) format('woff2'), url(/bundles/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff) format('woff'), url(/bundles/node_modules/bootstrap/fonts/glyphicons-halflings-regular.ttf) format('truetype'), url(/bundles/node_modules/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "*"; +} +.glyphicon-plus:before { + content: "+"; +} +.glyphicon-euro:before, +.glyphicon-eur:before { + content: "\20AC"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270F"; +} +.glyphicon-glass:before { + content: "\E001"; +} +.glyphicon-music:before { + content: "\E002"; +} +.glyphicon-search:before { + content: "\E003"; +} +.glyphicon-heart:before { + content: "\E005"; +} +.glyphicon-star:before { + content: "\E006"; +} +.glyphicon-star-empty:before { + content: "\E007"; +} +.glyphicon-user:before { + content: "\E008"; +} +.glyphicon-film:before { + content: "\E009"; +} +.glyphicon-th-large:before { + content: "\E010"; +} +.glyphicon-th:before { + content: "\E011"; +} +.glyphicon-th-list:before { + content: "\E012"; +} +.glyphicon-ok:before { + content: "\E013"; +} +.glyphicon-remove:before { + content: "\E014"; +} +.glyphicon-zoom-in:before { + content: "\E015"; +} +.glyphicon-zoom-out:before { + content: "\E016"; +} +.glyphicon-off:before { + content: "\E017"; +} +.glyphicon-signal:before { + content: "\E018"; +} +.glyphicon-cog:before { + content: "\E019"; +} +.glyphicon-trash:before { + content: "\E020"; +} +.glyphicon-home:before { + content: "\E021"; +} +.glyphicon-file:before { + content: "\E022"; +} +.glyphicon-time:before { + content: "\E023"; +} +.glyphicon-road:before { + content: "\E024"; +} +.glyphicon-download-alt:before { + content: "\E025"; +} +.glyphicon-download:before { + content: "\E026"; +} +.glyphicon-upload:before { + content: "\E027"; +} +.glyphicon-inbox:before { + content: "\E028"; +} +.glyphicon-play-circle:before { + content: "\E029"; +} +.glyphicon-repeat:before { + content: "\E030"; +} +.glyphicon-refresh:before { + content: "\E031"; +} +.glyphicon-list-alt:before { + content: "\E032"; +} +.glyphicon-lock:before { + content: "\E033"; +} +.glyphicon-flag:before { + content: "\E034"; +} +.glyphicon-headphones:before { + content: "\E035"; +} +.glyphicon-volume-off:before { + content: "\E036"; +} +.glyphicon-volume-down:before { + content: "\E037"; +} +.glyphicon-volume-up:before { + content: "\E038"; +} +.glyphicon-qrcode:before { + content: "\E039"; +} +.glyphicon-barcode:before { + content: "\E040"; +} +.glyphicon-tag:before { + content: "\E041"; +} +.glyphicon-tags:before { + content: "\E042"; +} +.glyphicon-book:before { + content: "\E043"; +} +.glyphicon-bookmark:before { + content: "\E044"; +} +.glyphicon-print:before { + content: "\E045"; +} +.glyphicon-camera:before { + content: "\E046"; +} +.glyphicon-font:before { + content: "\E047"; +} +.glyphicon-bold:before { + content: "\E048"; +} +.glyphicon-italic:before { + content: "\E049"; +} +.glyphicon-text-height:before { + content: "\E050"; +} +.glyphicon-text-width:before { + content: "\E051"; +} +.glyphicon-align-left:before { + content: "\E052"; +} +.glyphicon-align-center:before { + content: "\E053"; +} +.glyphicon-align-right:before { + content: "\E054"; +} +.glyphicon-align-justify:before { + content: "\E055"; +} +.glyphicon-list:before { + content: "\E056"; +} +.glyphicon-indent-left:before { + content: "\E057"; +} +.glyphicon-indent-right:before { + content: "\E058"; +} +.glyphicon-facetime-video:before { + content: "\E059"; +} +.glyphicon-picture:before { + content: "\E060"; +} +.glyphicon-map-marker:before { + content: "\E062"; +} +.glyphicon-adjust:before { + content: "\E063"; +} +.glyphicon-tint:before { + content: "\E064"; +} +.glyphicon-edit:before { + content: "\E065"; +} +.glyphicon-share:before { + content: "\E066"; +} +.glyphicon-check:before { + content: "\E067"; +} +.glyphicon-move:before { + content: "\E068"; +} +.glyphicon-step-backward:before { + content: "\E069"; +} +.glyphicon-fast-backward:before { + content: "\E070"; +} +.glyphicon-backward:before { + content: "\E071"; +} +.glyphicon-play:before { + content: "\E072"; +} +.glyphicon-pause:before { + content: "\E073"; +} +.glyphicon-stop:before { + content: "\E074"; +} +.glyphicon-forward:before { + content: "\E075"; +} +.glyphicon-fast-forward:before { + content: "\E076"; +} +.glyphicon-step-forward:before { + content: "\E077"; +} +.glyphicon-eject:before { + content: "\E078"; +} +.glyphicon-chevron-left:before { + content: "\E079"; +} +.glyphicon-chevron-right:before { + content: "\E080"; +} +.glyphicon-plus-sign:before { + content: "\E081"; +} +.glyphicon-minus-sign:before { + content: "\E082"; +} +.glyphicon-remove-sign:before { + content: "\E083"; +} +.glyphicon-ok-sign:before { + content: "\E084"; +} +.glyphicon-question-sign:before { + content: "\E085"; +} +.glyphicon-info-sign:before { + content: "\E086"; +} +.glyphicon-screenshot:before { + content: "\E087"; +} +.glyphicon-remove-circle:before { + content: "\E088"; +} +.glyphicon-ok-circle:before { + content: "\E089"; +} +.glyphicon-ban-circle:before { + content: "\E090"; +} +.glyphicon-arrow-left:before { + content: "\E091"; +} +.glyphicon-arrow-right:before { + content: "\E092"; +} +.glyphicon-arrow-up:before { + content: "\E093"; +} +.glyphicon-arrow-down:before { + content: "\E094"; +} +.glyphicon-share-alt:before { + content: "\E095"; +} +.glyphicon-resize-full:before { + content: "\E096"; +} +.glyphicon-resize-small:before { + content: "\E097"; +} +.glyphicon-exclamation-sign:before { + content: "\E101"; +} +.glyphicon-gift:before { + content: "\E102"; +} +.glyphicon-leaf:before { + content: "\E103"; +} +.glyphicon-fire:before { + content: "\E104"; +} +.glyphicon-eye-open:before { + content: "\E105"; +} +.glyphicon-eye-close:before { + content: "\E106"; +} +.glyphicon-warning-sign:before { + content: "\E107"; +} +.glyphicon-plane:before { + content: "\E108"; +} +.glyphicon-calendar:before { + content: "\E109"; +} +.glyphicon-random:before { + content: "\E110"; +} +.glyphicon-comment:before { + content: "\E111"; +} +.glyphicon-magnet:before { + content: "\E112"; +} +.glyphicon-chevron-up:before { + content: "\E113"; +} +.glyphicon-chevron-down:before { + content: "\E114"; +} +.glyphicon-retweet:before { + content: "\E115"; +} +.glyphicon-shopping-cart:before { + content: "\E116"; +} +.glyphicon-folder-close:before { + content: "\E117"; +} +.glyphicon-folder-open:before { + content: "\E118"; +} +.glyphicon-resize-vertical:before { + content: "\E119"; +} +.glyphicon-resize-horizontal:before { + content: "\E120"; +} +.glyphicon-hdd:before { + content: "\E121"; +} +.glyphicon-bullhorn:before { + content: "\E122"; +} +.glyphicon-bell:before { + content: "\E123"; +} +.glyphicon-certificate:before { + content: "\E124"; +} +.glyphicon-thumbs-up:before { + content: "\E125"; +} +.glyphicon-thumbs-down:before { + content: "\E126"; +} +.glyphicon-hand-right:before { + content: "\E127"; +} +.glyphicon-hand-left:before { + content: "\E128"; +} +.glyphicon-hand-up:before { + content: "\E129"; +} +.glyphicon-hand-down:before { + content: "\E130"; +} +.glyphicon-circle-arrow-right:before { + content: "\E131"; +} +.glyphicon-circle-arrow-left:before { + content: "\E132"; +} +.glyphicon-circle-arrow-up:before { + content: "\E133"; +} +.glyphicon-circle-arrow-down:before { + content: "\E134"; +} +.glyphicon-globe:before { + content: "\E135"; +} +.glyphicon-wrench:before { + content: "\E136"; +} +.glyphicon-tasks:before { + content: "\E137"; +} +.glyphicon-filter:before { + content: "\E138"; +} +.glyphicon-briefcase:before { + content: "\E139"; +} +.glyphicon-fullscreen:before { + content: "\E140"; +} +.glyphicon-dashboard:before { + content: "\E141"; +} +.glyphicon-paperclip:before { + content: "\E142"; +} +.glyphicon-heart-empty:before { + content: "\E143"; +} +.glyphicon-link:before { + content: "\E144"; +} +.glyphicon-phone:before { + content: "\E145"; +} +.glyphicon-pushpin:before { + content: "\E146"; +} +.glyphicon-usd:before { + content: "\E148"; +} +.glyphicon-gbp:before { + content: "\E149"; +} +.glyphicon-sort:before { + content: "\E150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\E151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\E152"; +} +.glyphicon-sort-by-order:before { + content: "\E153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\E154"; +} +.glyphicon-sort-by-attributes:before { + content: "\E155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\E156"; +} +.glyphicon-unchecked:before { + content: "\E157"; +} +.glyphicon-expand:before { + content: "\E158"; +} +.glyphicon-collapse-down:before { + content: "\E159"; +} +.glyphicon-collapse-up:before { + content: "\E160"; +} +.glyphicon-log-in:before { + content: "\E161"; +} +.glyphicon-flash:before { + content: "\E162"; +} +.glyphicon-log-out:before { + content: "\E163"; +} +.glyphicon-new-window:before { + content: "\E164"; +} +.glyphicon-record:before { + content: "\E165"; +} +.glyphicon-save:before { + content: "\E166"; +} +.glyphicon-open:before { + content: "\E167"; +} +.glyphicon-saved:before { + content: "\E168"; +} +.glyphicon-import:before { + content: "\E169"; +} +.glyphicon-export:before { + content: "\E170"; +} +.glyphicon-send:before { + content: "\E171"; +} +.glyphicon-floppy-disk:before { + content: "\E172"; +} +.glyphicon-floppy-saved:before { + content: "\E173"; +} +.glyphicon-floppy-remove:before { + content: "\E174"; +} +.glyphicon-floppy-save:before { + content: "\E175"; +} +.glyphicon-floppy-open:before { + content: "\E176"; +} +.glyphicon-credit-card:before { + content: "\E177"; +} +.glyphicon-transfer:before { + content: "\E178"; +} +.glyphicon-cutlery:before { + content: "\E179"; +} +.glyphicon-header:before { + content: "\E180"; +} +.glyphicon-compressed:before { + content: "\E181"; +} +.glyphicon-earphone:before { + content: "\E182"; +} +.glyphicon-phone-alt:before { + content: "\E183"; +} +.glyphicon-tower:before { + content: "\E184"; +} +.glyphicon-stats:before { + content: "\E185"; +} +.glyphicon-sd-video:before { + content: "\E186"; +} +.glyphicon-hd-video:before { + content: "\E187"; +} +.glyphicon-subtitles:before { + content: "\E188"; +} +.glyphicon-sound-stereo:before { + content: "\E189"; +} +.glyphicon-sound-dolby:before { + content: "\E190"; +} +.glyphicon-sound-5-1:before { + content: "\E191"; +} +.glyphicon-sound-6-1:before { + content: "\E192"; +} +.glyphicon-sound-7-1:before { + content: "\E193"; +} +.glyphicon-copyright-mark:before { + content: "\E194"; +} +.glyphicon-registration-mark:before { + content: "\E195"; +} +.glyphicon-cloud-download:before { + content: "\E197"; +} +.glyphicon-cloud-upload:before { + content: "\E198"; +} +.glyphicon-tree-conifer:before { + content: "\E199"; +} +.glyphicon-tree-deciduous:before { + content: "\E200"; +} +.glyphicon-cd:before { + content: "\E201"; +} +.glyphicon-save-file:before { + content: "\E202"; +} +.glyphicon-open-file:before { + content: "\E203"; +} +.glyphicon-level-up:before { + content: "\E204"; +} +.glyphicon-copy:before { + content: "\E205"; +} +.glyphicon-paste:before { + content: "\E206"; +} +.glyphicon-alert:before { + content: "\E209"; +} +.glyphicon-equalizer:before { + content: "\E210"; +} +.glyphicon-king:before { + content: "\E211"; +} +.glyphicon-queen:before { + content: "\E212"; +} +.glyphicon-pawn:before { + content: "\E213"; +} +.glyphicon-bishop:before { + content: "\E214"; +} +.glyphicon-knight:before { + content: "\E215"; +} +.glyphicon-baby-formula:before { + content: "\E216"; +} +.glyphicon-tent:before { + content: "\26FA"; +} +.glyphicon-blackboard:before { + content: "\E218"; +} +.glyphicon-bed:before { + content: "\E219"; +} +.glyphicon-apple:before { + content: "\F8FF"; +} +.glyphicon-erase:before { + content: "\E221"; +} +.glyphicon-hourglass:before { + content: "\231B"; +} +.glyphicon-lamp:before { + content: "\E223"; +} +.glyphicon-duplicate:before { + content: "\E224"; +} +.glyphicon-piggy-bank:before { + content: "\E225"; +} +.glyphicon-scissors:before { + content: "\E226"; +} +.glyphicon-bitcoin:before { + content: "\E227"; +} +.glyphicon-btc:before { + content: "\E227"; +} +.glyphicon-xbt:before { + content: "\E227"; +} +.glyphicon-yen:before { + content: "\A5"; +} +.glyphicon-jpy:before { + content: "\A5"; +} +.glyphicon-ruble:before { + content: "\20BD"; +} +.glyphicon-rub:before { + content: "\20BD"; +} +.glyphicon-scale:before { + content: "\E230"; +} +.glyphicon-ice-lolly:before { + content: "\E231"; +} +.glyphicon-ice-lolly-tasted:before { + content: "\E232"; +} +.glyphicon-education:before { + content: "\E233"; +} +.glyphicon-option-horizontal:before { + content: "\E234"; +} +.glyphicon-option-vertical:before { + content: "\E235"; +} +.glyphicon-menu-hamburger:before { + content: "\E236"; +} +.glyphicon-modal-window:before { + content: "\E237"; +} +.glyphicon-oil:before { + content: "\E238"; +} +.glyphicon-grain:before { + content: "\E239"; +} +.glyphicon-sunglasses:before { + content: "\E240"; +} +.glyphicon-text-size:before { + content: "\E241"; +} +.glyphicon-text-color:before { + content: "\E242"; +} +.glyphicon-text-background:before { + content: "\E243"; +} +.glyphicon-object-align-top:before { + content: "\E244"; +} +.glyphicon-object-align-bottom:before { + content: "\E245"; +} +.glyphicon-object-align-horizontal:before { + content: "\E246"; +} +.glyphicon-object-align-left:before { + content: "\E247"; +} +.glyphicon-object-align-vertical:before { + content: "\E248"; +} +.glyphicon-object-align-right:before { + content: "\E249"; +} +.glyphicon-triangle-right:before { + content: "\E250"; +} +.glyphicon-triangle-left:before { + content: "\E251"; +} +.glyphicon-triangle-bottom:before { + content: "\E252"; +} +.glyphicon-triangle-top:before { + content: "\E253"; +} +.glyphicon-console:before { + content: "\E254"; +} +.glyphicon-superscript:before { + content: "\E255"; +} +.glyphicon-subscript:before { + content: "\E256"; +} +.glyphicon-menu-left:before { + content: "\E257"; +} +.glyphicon-menu-right:before { + content: "\E258"; +} +.glyphicon-menu-down:before { + content: "\E259"; +} +.glyphicon-menu-up:before { + content: "\E260"; +} +* { + box-sizing: border-box; +} +*:before, +*:after { + box-sizing: border-box; +} +html { + font-size: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + line-height: 1.42857143; + color: #444444; + background-color: #ffffff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #1f6b7a; + text-decoration: none; +} +a:hover, +a:focus { + color: #298fa3; + text-decoration: none; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + padding: 4px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #ecf0f1; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 18px; + margin-bottom: 18px; + border: 0; + border-top: 1px solid #ecf0f1; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +[role="button"] { + cursor: pointer; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 400; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #b4bcc2; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 18px; + margin-bottom: 9px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 9px; + margin-bottom: 9px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 33px; +} +h2, +.h2 { + font-size: 27px; +} +h3, +.h3 { + font-size: 23px; +} +h4, +.h4 { + font-size: 17px; +} +h5, +.h5 { + font-size: 13px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 9px; +} +.lead { + margin-bottom: 18px; + font-size: 14px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 19.5px; + } +} +small, +.small { + font-size: 92%; +} +mark, +.mark { + background-color: #f39c12; + padding: .2em; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #b4bcc2; +} +.text-primary { + color: #444444; +} +a.text-primary:hover, +a.text-primary:focus { + color: #2b2b2b; +} +.text-success { + color: #ffffff; +} +a.text-success:hover, +a.text-success:focus { + color: #e6e6e6; +} +.text-info { + color: #ffffff; +} +a.text-info:hover, +a.text-info:focus { + color: #e6e6e6; +} +.text-warning { + color: #ffffff; +} +a.text-warning:hover, +a.text-warning:focus { + color: #e6e6e6; +} +.text-danger { + color: #ffffff; +} +a.text-danger:hover, +a.text-danger:focus { + color: #e6e6e6; +} +.bg-primary { + color: #fff; + background-color: #444444; +} +a.bg-primary:hover, +a.bg-primary:focus { + background-color: #2b2b2b; +} +.bg-success { + background-color: #31c471; +} +a.bg-success:hover, +a.bg-success:focus { + background-color: #279b59; +} +.bg-info { + background-color: #1f6b7a; +} +a.bg-info:hover, +a.bg-info:focus { + background-color: #154751; +} +.bg-warning { + background-color: #f39c12; +} +a.bg-warning:hover, +a.bg-warning:focus { + background-color: #c87f0a; +} +.bg-danger { + background-color: #e74c3c; +} +a.bg-danger:hover, +a.bg-danger:focus { + background-color: #d62c1a; +} +.page-header { + padding-bottom: 8px; + margin: 36px 0 18px; + border-bottom: 1px solid transparent; +} +ul, +ol { + margin-top: 0; + margin-bottom: 9px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + list-style: none; + margin-left: -5px; +} +.list-inline > li { + display: inline-block; + padding-left: 5px; + padding-right: 5px; +} +dl { + margin-top: 0; + margin-bottom: 18px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #b4bcc2; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 9px 18px; + margin: 0 0 18px; + font-size: 16.25px; + border-left: 5px solid #ecf0f1; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #b4bcc2; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #ecf0f1; + border-left: 0; + text-align: right; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\A0 \2014'; +} +address { + margin-bottom: 18px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #ffffff; + background-color: #333333; + border-radius: 3px; + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + box-shadow: none; +} +pre { + display: block; + padding: 8.5px; + margin: 0 0 9px; + font-size: 12px; + line-height: 1.42857143; + word-break: break-all; + word-wrap: break-word; + color: #7b8a8b; + background-color: #ecf0f1; + border: 1px solid #cccccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +.row { + margin-left: -15px; + margin-right: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} +table { + background-color: transparent; +} +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #b4bcc2; + text-align: left; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 18px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #ecf0f1; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #ecf0f1; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #ecf0f1; +} +.table .table { + background-color: #ffffff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #ecf0f1; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #ecf0f1; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover { + background-color: #ecf0f1; +} +table col[class*="col-"] { + position: static; + float: none; + display: table-column; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + float: none; + display: table-cell; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #ecf0f1; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #dde4e6; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #31c471; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #2cb065; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #1f6b7a; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #1a5966; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #f39c12; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #e08e0b; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #e74c3c; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #e43725; +} +.table-responsive { + overflow-x: auto; + min-height: 0.01%; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 13.5px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #ecf0f1; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + padding: 0; + margin: 0; + border: 0; + min-width: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 18px; + font-size: 19.5px; + line-height: inherit; + color: #444444; + border: 0; + border-bottom: 1px solid transparent; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 6px; + font-size: 13px; + line-height: 1.42857143; + color: #444444; +} +.form-control { + display: block; + width: 100%; + height: 30px; + padding: 5px 15px; + font-size: 13px; + line-height: 1.42857143; + color: #444444; + background-color: #ffffff; + background-image: none; + border: 1px solid #ecf0f1; + border-radius: 4px; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #b4bcc2; + outline: 0; + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(180, 188, 194, 0.6); +} +.form-control::-moz-placeholder { + color: #acb6c0; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #acb6c0; +} +.form-control::-webkit-input-placeholder { + color: #acb6c0; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #ecf0f1; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"].form-control, + input[type="time"].form-control, + input[type="datetime-local"].form-control, + input[type="month"].form-control { + line-height: 30px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm, + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"] { + line-height: 32px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg, + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"] { + line-height: 61px; + } +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + min-height: 18px; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-left: -20px; + margin-top: 4px \9; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 6px; + padding-bottom: 6px; + margin-bottom: 0; + min-height: 31px; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-left: 0; + padding-right: 0; +} +.input-sm { + height: 32px; + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 32px; + line-height: 32px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.form-group-sm .form-control { + height: 32px; + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.form-group-sm select.form-control { + height: 32px; + line-height: 32px; +} +.form-group-sm textarea.form-control, +.form-group-sm select[multiple].form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 32px; + min-height: 30px; + padding: 7px 9px; + font-size: 12px; + line-height: 1.5; +} +.input-lg { + height: 61px; + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg { + height: 61px; + line-height: 61px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.form-group-lg .form-control { + height: 61px; + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; + border-radius: 6px; +} +.form-group-lg select.form-control { + height: 61px; + line-height: 61px; +} +.form-group-lg textarea.form-control, +.form-group-lg select[multiple].form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 61px; + min-height: 35px; + padding: 19px 27px; + font-size: 17px; + line-height: 1.33; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 37.5px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback, +.input-group-lg + .form-control-feedback, +.form-group-lg .form-control + .form-control-feedback { + width: 61px; + height: 61px; + line-height: 61px; +} +.input-sm + .form-control-feedback, +.input-group-sm + .form-control-feedback, +.form-group-sm .form-control + .form-control-feedback { + width: 32px; + height: 32px; + line-height: 32px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #ffffff; +} +.has-success .form-control { + border-color: #ffffff; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #e6e6e6; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; +} +.has-success .input-group-addon { + color: #ffffff; + border-color: #ffffff; + background-color: #31c471; +} +.has-success .form-control-feedback { + color: #ffffff; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #ffffff; +} +.has-warning .form-control { + border-color: #ffffff; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #e6e6e6; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; +} +.has-warning .input-group-addon { + color: #ffffff; + border-color: #ffffff; + background-color: #f39c12; +} +.has-warning .form-control-feedback { + color: #ffffff; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #ffffff; +} +.has-error .form-control { + border-color: #ffffff; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #e6e6e6; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; +} +.has-error .input-group-addon { + color: #ffffff; + border-color: #ffffff; + background-color: #e74c3c; +} +.has-error .form-control-feedback { + color: #ffffff; +} +.has-feedback label ~ .form-control-feedback { + top: 23px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #848484; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 6px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 24px; +} +.form-horizontal .form-group { + margin-left: -15px; + margin-right: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + margin-bottom: 0; + padding-top: 6px; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 24.94px; + font-size: 17px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 7px; + font-size: 12px; + } +} +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 5px 15px; + font-size: 13px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus, +.btn.focus { + color: #ffffff; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + opacity: 0.65; + filter: alpha(opacity=65); + box-shadow: none; +} +a.btn.disabled, +fieldset[disabled] a.btn { + pointer-events: none; +} +.btn-default { + color: #ffffff; + background-color: #95a5a6; + border-color: #95a5a6; +} +.btn-default:focus, +.btn-default.focus { + color: #ffffff; + background-color: #798d8f; + border-color: #566566; +} +.btn-default:hover { + color: #ffffff; + background-color: #798d8f; + border-color: #74898a; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #ffffff; + background-color: #798d8f; + border-color: #74898a; +} +.btn-default:active:hover, +.btn-default.active:hover, +.open > .dropdown-toggle.btn-default:hover, +.btn-default:active:focus, +.btn-default.active:focus, +.open > .dropdown-toggle.btn-default:focus, +.btn-default:active.focus, +.btn-default.active.focus, +.open > .dropdown-toggle.btn-default.focus { + color: #ffffff; + background-color: #687b7c; + border-color: #566566; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #95a5a6; + border-color: #95a5a6; +} +.btn-default .badge { + color: #95a5a6; + background-color: #ffffff; +} +.btn-primary { + color: #ffffff; + background-color: #444444; + border-color: #444444; +} +.btn-primary:focus, +.btn-primary.focus { + color: #ffffff; + background-color: #2b2b2b; + border-color: #040404; +} +.btn-primary:hover { + color: #ffffff; + background-color: #2b2b2b; + border-color: #252525; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #2b2b2b; + border-color: #252525; +} +.btn-primary:active:hover, +.btn-primary.active:hover, +.open > .dropdown-toggle.btn-primary:hover, +.btn-primary:active:focus, +.btn-primary.active:focus, +.open > .dropdown-toggle.btn-primary:focus, +.btn-primary:active.focus, +.btn-primary.active.focus, +.open > .dropdown-toggle.btn-primary.focus { + color: #ffffff; + background-color: #191919; + border-color: #040404; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #444444; + border-color: #444444; +} +.btn-primary .badge { + color: #444444; + background-color: #ffffff; +} +.btn-success { + color: #ffffff; + background-color: #31c471; + border-color: #31c471; +} +.btn-success:focus, +.btn-success.focus { + color: #ffffff; + background-color: #279b59; + border-color: #185e36; +} +.btn-success:hover { + color: #ffffff; + background-color: #279b59; + border-color: #259355; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #279b59; + border-color: #259355; +} +.btn-success:active:hover, +.btn-success.active:hover, +.open > .dropdown-toggle.btn-success:hover, +.btn-success:active:focus, +.btn-success.active:focus, +.open > .dropdown-toggle.btn-success:focus, +.btn-success:active.focus, +.btn-success.active.focus, +.open > .dropdown-toggle.btn-success.focus { + color: #ffffff; + background-color: #207f49; + border-color: #185e36; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #31c471; + border-color: #31c471; +} +.btn-success .badge { + color: #31c471; + background-color: #ffffff; +} +.btn-info { + color: #ffffff; + background-color: #1f6b7a; + border-color: #1f6b7a; +} +.btn-info:focus, +.btn-info.focus { + color: #ffffff; + background-color: #154751; + border-color: #051214; +} +.btn-info:hover { + color: #ffffff; + background-color: #154751; + border-color: #134049; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #154751; + border-color: #134049; +} +.btn-info:active:hover, +.btn-info.active:hover, +.open > .dropdown-toggle.btn-info:hover, +.btn-info:active:focus, +.btn-info.active:focus, +.open > .dropdown-toggle.btn-info:focus, +.btn-info:active.focus, +.btn-info.active.focus, +.open > .dropdown-toggle.btn-info.focus { + color: #ffffff; + background-color: #0d2e35; + border-color: #051214; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #1f6b7a; + border-color: #1f6b7a; +} +.btn-info .badge { + color: #1f6b7a; + background-color: #ffffff; +} +.btn-warning { + color: #ffffff; + background-color: #f39c12; + border-color: #f39c12; +} +.btn-warning:focus, +.btn-warning.focus { + color: #ffffff; + background-color: #c87f0a; + border-color: #7f5006; +} +.btn-warning:hover { + color: #ffffff; + background-color: #c87f0a; + border-color: #be780a; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #c87f0a; + border-color: #be780a; +} +.btn-warning:active:hover, +.btn-warning.active:hover, +.open > .dropdown-toggle.btn-warning:hover, +.btn-warning:active:focus, +.btn-warning.active:focus, +.open > .dropdown-toggle.btn-warning:focus, +.btn-warning:active.focus, +.btn-warning.active.focus, +.open > .dropdown-toggle.btn-warning.focus { + color: #ffffff; + background-color: #a66908; + border-color: #7f5006; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f39c12; + border-color: #f39c12; +} +.btn-warning .badge { + color: #f39c12; + background-color: #ffffff; +} +.btn-danger { + color: #ffffff; + background-color: #e74c3c; + border-color: #e74c3c; +} +.btn-danger:focus, +.btn-danger.focus { + color: #ffffff; + background-color: #d62c1a; + border-color: #921e12; +} +.btn-danger:hover { + color: #ffffff; + background-color: #d62c1a; + border-color: #cd2a19; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #d62c1a; + border-color: #cd2a19; +} +.btn-danger:active:hover, +.btn-danger.active:hover, +.open > .dropdown-toggle.btn-danger:hover, +.btn-danger:active:focus, +.btn-danger.active:focus, +.open > .dropdown-toggle.btn-danger:focus, +.btn-danger:active.focus, +.btn-danger.active.focus, +.open > .dropdown-toggle.btn-danger.focus { + color: #ffffff; + background-color: #b62516; + border-color: #921e12; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #e74c3c; + border-color: #e74c3c; +} +.btn-danger .badge { + color: #e74c3c; + background-color: #ffffff; +} +.btn-link { + color: #1f6b7a; + font-weight: normal; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link.active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #298fa3; + text-decoration: none; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #b4bcc2; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-property: height, visibility; + transition-property: height, visibility; + -webkit-transition-duration: 0.35s; + transition-duration: 0.35s; + -webkit-transition-timing-function: ease; + transition-timing-function: ease; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-top: 4px solid \9; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropup, +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + font-size: 13px; + text-align: left; + background-color: #ffffff; + border: 1px solid #dddddd; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + background-clip: padding-box; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 8px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #7b8a8b; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + text-decoration: none; + color: #ffffff; + background-color: #444444; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #444444; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #b4bcc2; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + left: auto; + right: 0; +} +.dropdown-menu-left { + left: 0; + right: auto; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #b4bcc2; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px dashed; + border-bottom: 4px solid \9; + content: ""; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + left: auto; + right: 0; + } + .navbar-right .dropdown-menu-left { + left: 0; + right: auto; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn, +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} +.btn-group.open .dropdown-toggle { + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn-group.open .dropdown-toggle.btn-link { + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-bottom-left-radius: 4px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + float: none; + display: table-cell; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 61px; + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 61px; + line-height: 61px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 32px; + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 32px; + line-height: 32px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 5px 15px; + font-size: 13px; + font-weight: normal; + line-height: 1; + color: #444444; + text-align: center; + background-color: #ecf0f1; + border: 1px solid #ecf0f1; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 6px 9px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 18px 27px; + font-size: 17px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + z-index: 2; + margin-left: -1px; +} +.nav { + margin-bottom: 0; + padding-left: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #ecf0f1; +} +.nav > li.disabled > a { + color: #b4bcc2; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #b4bcc2; + text-decoration: none; + background-color: transparent; + cursor: not-allowed; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #ecf0f1; + border-color: #1f6b7a; +} +.nav .nav-divider { + height: 1px; + margin: 8px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #ecf0f1; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #ecf0f1 #ecf0f1 #ecf0f1; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #444444; + background-color: #ffffff; + border: 1px solid #ecf0f1; + border-bottom-color: transparent; + cursor: default; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #ecf0f1; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ecf0f1; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #ffffff; + background-color: #444444; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #ecf0f1; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ecf0f1; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar { + position: relative; + min-height: 45px; + margin-bottom: 0px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + overflow-x: visible; + padding-right: 15px; + padding-left: 15px; + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-overflow-scrolling: touch; +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-left: 0; + padding-right: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1050; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + padding: 13.5px 15px; + font-size: 17px; + line-height: 18px; + height: 45px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + margin-right: 15px; + padding: 9px 10px; + margin-top: 5.5px; + margin-bottom: 5.5px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 6.75px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 18px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 18px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 13.5px; + padding-bottom: 13.5px; + } +} +.navbar-form { + margin-left: -15px; + margin-right: -15px; + padding: 10px 15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + margin-top: 7.5px; + margin-bottom: 7.5px; +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 7.5px; + margin-bottom: 7.5px; +} +.navbar-btn.btn-sm { + margin-top: 6.5px; + margin-bottom: 6.5px; +} +.navbar-btn.btn-xs { + margin-top: 11.5px; + margin-bottom: 11.5px; +} +.navbar-text { + margin-top: 13.5px; + margin-bottom: 13.5px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-left: 15px; + margin-right: 15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + float: left; + } + .navbar-right { + float: right !important; + float: right; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #656a76; + border-color: #4d515b; +} +.navbar-default .navbar-brand { + color: #ecf0f1; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #ffffff; +} +.navbar-default .navbar-nav > li > a { + color: #ecf0f1; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #4d515b; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #cccccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #4d515b; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #4d515b; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #4d515b; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + background-color: #4d515b; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #ecf0f1; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #4d515b; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #cccccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #ecf0f1; +} +.navbar-default .navbar-link:hover { + color: #ffffff; +} +.navbar-default .btn-link { + color: #ecf0f1; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #ffffff; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #cccccc; +} +.navbar-inverse { + background-color: #222222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #ffffff; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #ffffff; + background-color: #3c3c3c; +} +.navbar-inverse .navbar-text { + color: #ffffff; +} +.navbar-inverse .navbar-nav > li > a { + color: #ecf0f1; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #ffffff; + background-color: #555555; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #41454c; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #b4bcc2; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #080808; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #080808; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + background-color: #41454c; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #ecf0f1; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: #555555; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #41454c; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #b4bcc2; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #ecf0f1; +} +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} +.navbar-inverse .btn-link { + color: #ecf0f1; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #ffffff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #b4bcc2; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 18px; + list-style: none; + background-color: #ecf0f1; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + content: "/\A0"; + padding: 0 5px; + color: #cccccc; +} +.breadcrumb > .active { + color: #95a5a6; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 18px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 5px 15px; + line-height: 1.42857143; + text-decoration: none; + color: #1f6b7a; + background-color: transparent; + border: 1px solid transparent; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + z-index: 3; + color: #1f6b7a; + background-color: rgba(0, 0, 0, 0); + border-color: transparent; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #444444; + background-color: rgba(0, 0, 0, 0); + border-color: transparent; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #222222; + background-color: rgba(38, 38, 38, 0); + border-color: transparent; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 18px 0; + list-style: none; + text-align: center; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: transparent; + border: 1px solid transparent; + border-radius: 0px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: rgba(0, 0, 0, 0); +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #ffffff; + background-color: transparent; + cursor: not-allowed; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #95a5a6; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #798d8f; +} +.label-primary { + background-color: #444444; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #2b2b2b; +} +.label-success { + background-color: #31c471; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #279b59; +} +.label-info { + background-color: #1f6b7a; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #154751; +} +.label-warning { + background-color: #f39c12; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #c87f0a; +} +.label-danger { + background-color: #e74c3c; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #d62c1a; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + color: #ffffff; + line-height: 1; + vertical-align: middle; + white-space: nowrap; + text-align: center; + background-color: #444444; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge, +.btn-group-xs > .btn .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #444444; + background-color: #ffffff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding-top: 30px; + padding-bottom: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #ecf0f1; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 20px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #cfd9db; +} +.container .jumbotron, +.container-fluid .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-left: 60px; + padding-right: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 59px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 18px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #ecf0f1; + border-radius: 4px; + -webkit-transition: border 0.2s ease-in-out; + transition: border 0.2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-left: auto; + margin-right: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #1f6b7a; +} +.thumbnail .caption { + padding: 9px; + color: #444444; +} +.alert { + padding: 15px; + margin-bottom: 18px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #31c471; + border-color: #279b59; + color: #ffffff; +} +.alert-success hr { + border-top-color: #22874e; +} +.alert-success .alert-link { + color: #e6e6e6; +} +.alert-info { + background-color: #1f6b7a; + border-color: #154751; + color: #ffffff; +} +.alert-info hr { + border-top-color: #0f353d; +} +.alert-info .alert-link { + color: #e6e6e6; +} +.alert-warning { + background-color: #f39c12; + border-color: #c87f0a; + color: #ffffff; +} +.alert-warning hr { + border-top-color: #b06f09; +} +.alert-warning .alert-link { + color: #e6e6e6; +} +.alert-danger { + background-color: #e74c3c; + border-color: #d62c1a; + color: #ffffff; +} +.alert-danger hr { + border-top-color: #bf2718; +} +.alert-danger .alert-link { + color: #e6e6e6; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + overflow: hidden; + height: 18px; + margin-bottom: 18px; + background-color: #ecf0f1; + border-radius: 4px; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.progress-bar { + float: left; + width: 0%; + height: 100%; + font-size: 12px; + line-height: 18px; + color: #ffffff; + text-align: center; + background-color: #444444; + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #31c471; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #1f6b7a; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f39c12; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #e74c3c; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media, +.media-body { + zoom: 1; + overflow: hidden; +} +.media-body { + width: 10000px; +} +.media-object { + display: block; +} +.media-object.img-thumbnail { + max-width: none; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item, +button.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading, +button.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +button.list-group-item:hover, +a.list-group-item:focus, +button.list-group-item:focus { + text-decoration: none; + color: #555555; + background-color: #f5f5f5; +} +button.list-group-item { + width: 100%; + text-align: left; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + background-color: #ecf0f1; + color: #b4bcc2; + cursor: not-allowed; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #b4bcc2; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #444444; + background-color: #444444; + border-color: #444444; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #aaaaaa; +} +.list-group-item-success { + color: #ffffff; + background-color: #31c471; +} +a.list-group-item-success, +button.list-group-item-success { + color: #ffffff; +} +a.list-group-item-success .list-group-item-heading, +button.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +button.list-group-item-success:hover, +a.list-group-item-success:focus, +button.list-group-item-success:focus { + color: #ffffff; + background-color: #2cb065; +} +a.list-group-item-success.active, +button.list-group-item-success.active, +a.list-group-item-success.active:hover, +button.list-group-item-success.active:hover, +a.list-group-item-success.active:focus, +button.list-group-item-success.active:focus { + color: #fff; + background-color: #ffffff; + border-color: #ffffff; +} +.list-group-item-info { + color: #ffffff; + background-color: #1f6b7a; +} +a.list-group-item-info, +button.list-group-item-info { + color: #ffffff; +} +a.list-group-item-info .list-group-item-heading, +button.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +button.list-group-item-info:hover, +a.list-group-item-info:focus, +button.list-group-item-info:focus { + color: #ffffff; + background-color: #1a5966; +} +a.list-group-item-info.active, +button.list-group-item-info.active, +a.list-group-item-info.active:hover, +button.list-group-item-info.active:hover, +a.list-group-item-info.active:focus, +button.list-group-item-info.active:focus { + color: #fff; + background-color: #ffffff; + border-color: #ffffff; +} +.list-group-item-warning { + color: #ffffff; + background-color: #f39c12; +} +a.list-group-item-warning, +button.list-group-item-warning { + color: #ffffff; +} +a.list-group-item-warning .list-group-item-heading, +button.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +button.list-group-item-warning:hover, +a.list-group-item-warning:focus, +button.list-group-item-warning:focus { + color: #ffffff; + background-color: #e08e0b; +} +a.list-group-item-warning.active, +button.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +button.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus, +button.list-group-item-warning.active:focus { + color: #fff; + background-color: #ffffff; + border-color: #ffffff; +} +.list-group-item-danger { + color: #ffffff; + background-color: #e74c3c; +} +a.list-group-item-danger, +button.list-group-item-danger { + color: #ffffff; +} +a.list-group-item-danger .list-group-item-heading, +button.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +button.list-group-item-danger:hover, +a.list-group-item-danger:focus, +button.list-group-item-danger:focus { + color: #ffffff; + background-color: #e43725; +} +a.list-group-item-danger.active, +button.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +button.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus, +button.list-group-item-danger.active:focus { + color: #fff; + background-color: #ffffff; + border-color: #ffffff; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 18px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 4px; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 15px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-left: 15px; + padding-right: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #ecf0f1; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-group { + margin-bottom: 18px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #7b8a8b; + background-color: #f5f5f5; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #7b8a8b; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #444444; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #444444; + border-color: #444444; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #444444; +} +.panel-primary > .panel-heading .badge { + color: #444444; + background-color: #ffffff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #444444; +} +.panel-success { + border-color: #279b59; +} +.panel-success > .panel-heading { + color: #ffffff; + background-color: #31c471; + border-color: #279b59; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #279b59; +} +.panel-success > .panel-heading .badge { + color: #31c471; + background-color: #ffffff; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #279b59; +} +.panel-info { + border-color: #154751; +} +.panel-info > .panel-heading { + color: #ffffff; + background-color: #1f6b7a; + border-color: #154751; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #154751; +} +.panel-info > .panel-heading .badge { + color: #1f6b7a; + background-color: #ffffff; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #154751; +} +.panel-warning { + border-color: #c87f0a; +} +.panel-warning > .panel-heading { + color: #ffffff; + background-color: #f39c12; + border-color: #c87f0a; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #c87f0a; +} +.panel-warning > .panel-heading .badge { + color: #f39c12; + background-color: #ffffff; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #c87f0a; +} +.panel-danger { + border-color: #d62c1a; +} +.panel-danger > .panel-heading { + color: #ffffff; + background-color: #e74c3c; + border-color: #d62c1a; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d62c1a; +} +.panel-danger > .panel-heading .badge { + color: #e74c3c; + background-color: #ffffff; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d62c1a; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + left: 0; + bottom: 0; + height: 100%; + width: 100%; + border: 0; +} +.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #ecf0f1; + border: 1px solid transparent; + border-radius: 4px; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 19.5px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: none; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: hidden; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1070; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transform: translate(0, -25%); + transform: translate(0, -25%); + -webkit-transition: -webkit-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; + outline: 0; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1060; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.42857143px; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 20px; +} +.modal-footer { + padding: 20px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1040; + display: block; + font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-break: auto; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + white-space: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + font-size: 12px; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ecf0f1; + text-align: center; + background-color: rgba(34, 34, 34, 0.93); + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: rgba(34, 34, 34, 0.93); +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + right: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: rgba(34, 34, 34, 0.93); +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: rgba(34, 34, 34, 0.93); +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: rgba(34, 34, 34, 0.93); +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: rgba(34, 34, 34, 0.93); +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: rgba(34, 34, 34, 0.93); +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: rgba(34, 34, 34, 0.93); +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: rgba(34, 34, 34, 0.93); +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-break: auto; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + white-space: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + font-size: 13px; + background-color: #ffffff; + background-clip: padding-box; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + margin: 0; + padding: 8px 14px; + font-size: 13px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + border-width: 10px; + content: ""; +} +.popover.top > .arrow { + left: 50%; + margin-left: -11px; + border-bottom-width: 0; + border-top-color: #999999; + border-top-color: rgba(0, 0, 0, 0.25); + bottom: -11px; +} +.popover.top > .arrow:after { + content: " "; + bottom: 1px; + margin-left: -10px; + border-bottom-width: 0; + border-top-color: #ffffff; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-left-width: 0; + border-right-color: #999999; + border-right-color: rgba(0, 0, 0, 0.25); +} +.popover.right > .arrow:after { + content: " "; + left: 1px; + bottom: -10px; + border-left-width: 0; + border-right-color: #ffffff; +} +.popover.bottom > .arrow { + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999999; + border-bottom-color: rgba(0, 0, 0, 0.25); + top: -11px; +} +.popover.bottom > .arrow:after { + content: " "; + top: 1px; + margin-left: -10px; + border-top-width: 0; + border-bottom-color: #ffffff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999999; + border-left-color: rgba(0, 0, 0, 0.25); +} +.popover.left > .arrow:after { + content: " "; + right: 1px; + border-right-width: 0; + border-left-color: #ffffff; + bottom: -10px; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + overflow: hidden; + width: 100%; +} +.carousel-inner > .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform 0.6s ease-in-out; + transition: transform 0.6s ease-in-out; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000px; + perspective: 1000px; + } + .carousel-inner > .item.next, + .carousel-inner > .item.active.right { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + left: 0; + } + .carousel-inner > .item.prev, + .carousel-inner > .item.active.left { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + left: 0; + } + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right, + .carousel-inner > .item.active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + left: 0; + } +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 15%; + opacity: 0.5; + filter: alpha(opacity=50); + font-size: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); +} +.carousel-control.right { + left: auto; + right: 0; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); +} +.carousel-control:hover, +.carousel-control:focus { + outline: 0; + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + margin-top: -10px; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + line-height: 1; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203A'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; + list-style: none; + text-align: center; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + border: 1px solid #ffffff; + border-radius: 10px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); +} +.carousel-indicators .active { + margin: 0; + width: 12px; + height: 12px; + background-color: #ffffff; +} +.carousel-caption { + position: absolute; + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -15px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -15px; + } + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-left: auto; + margin-right: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table !important; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table !important; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table !important; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table !important; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table !important; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +/*! + * Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url(./bundles/node_modules/font-awesome/fonts/fontawesome-webfont.eot); + src: url(./bundles/node_modules/font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.4.0) format('embedded-opentype'), url(./bundles/node_modules/font-awesome/fonts/fontawesome-webfont.woff2) format('woff2'), url(./bundles/node_modules/font-awesome/fonts/fontawesome-webfont.woff) format('woff'), url(./bundles/node_modules/font-awesome/fonts/fontawesome-webfont.ttf) format('truetype'), url(./bundles/node_modules/font-awesome/fonts/fontawesome-webfont.svg#fontawesomeregular) format('svg'); + font-weight: normal; + font-style: normal; +} +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714286em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.fa-pull-left { + float: left; +} +.fa-pull-right { + float: right; +} +.fa.fa-pull-left { + margin-right: .3em; +} +.fa.fa-pull-right { + margin-left: .3em; +} +/* Deprecated as of 4.4.0 */ +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +.fa-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +.fa-rotate-90 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); + -webkit-transform: rotate(90deg); + transform: rotate(90deg); +} +.fa-rotate-180 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); + -webkit-transform: rotate(180deg); + transform: rotate(180deg); +} +.fa-rotate-270 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); + -webkit-transform: rotate(270deg); + transform: rotate(270deg); +} +.fa-flip-horizontal { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); + -webkit-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fa-flip-vertical { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); + -webkit-transform: scale(1, -1); + transform: scale(1, -1); +} +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + -webkit-filter: none; + filter: none; +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\F000"; +} +.fa-music:before { + content: "\F001"; +} +.fa-search:before { + content: "\F002"; +} +.fa-envelope-o:before { + content: "\F003"; +} +.fa-heart:before { + content: "\F004"; +} +.fa-star:before { + content: "\F005"; +} +.fa-star-o:before { + content: "\F006"; +} +.fa-user:before { + content: "\F007"; +} +.fa-film:before { + content: "\F008"; +} +.fa-th-large:before { + content: "\F009"; +} +.fa-th:before { + content: "\F00A"; +} +.fa-th-list:before { + content: "\F00B"; +} +.fa-check:before { + content: "\F00C"; +} +.fa-remove:before, +.fa-close:before, +.fa-times:before { + content: "\F00D"; +} +.fa-search-plus:before { + content: "\F00E"; +} +.fa-search-minus:before { + content: "\F010"; +} +.fa-power-off:before { + content: "\F011"; +} +.fa-signal:before { + content: "\F012"; +} +.fa-gear:before, +.fa-cog:before { + content: "\F013"; +} +.fa-trash-o:before { + content: "\F014"; +} +.fa-home:before { + content: "\F015"; +} +.fa-file-o:before { + content: "\F016"; +} +.fa-clock-o:before { + content: "\F017"; +} +.fa-road:before { + content: "\F018"; +} +.fa-download:before { + content: "\F019"; +} +.fa-arrow-circle-o-down:before { + content: "\F01A"; +} +.fa-arrow-circle-o-up:before { + content: "\F01B"; +} +.fa-inbox:before { + content: "\F01C"; +} +.fa-play-circle-o:before { + content: "\F01D"; +} +.fa-rotate-right:before, +.fa-repeat:before { + content: "\F01E"; +} +.fa-refresh:before { + content: "\F021"; +} +.fa-list-alt:before { + content: "\F022"; +} +.fa-lock:before { + content: "\F023"; +} +.fa-flag:before { + content: "\F024"; +} +.fa-headphones:before { + content: "\F025"; +} +.fa-volume-off:before { + content: "\F026"; +} +.fa-volume-down:before { + content: "\F027"; +} +.fa-volume-up:before { + content: "\F028"; +} +.fa-qrcode:before { + content: "\F029"; +} +.fa-barcode:before { + content: "\F02A"; +} +.fa-tag:before { + content: "\F02B"; +} +.fa-tags:before { + content: "\F02C"; +} +.fa-book:before { + content: "\F02D"; +} +.fa-bookmark:before { + content: "\F02E"; +} +.fa-print:before { + content: "\F02F"; +} +.fa-camera:before { + content: "\F030"; +} +.fa-font:before { + content: "\F031"; +} +.fa-bold:before { + content: "\F032"; +} +.fa-italic:before { + content: "\F033"; +} +.fa-text-height:before { + content: "\F034"; +} +.fa-text-width:before { + content: "\F035"; +} +.fa-align-left:before { + content: "\F036"; +} +.fa-align-center:before { + content: "\F037"; +} +.fa-align-right:before { + content: "\F038"; +} +.fa-align-justify:before { + content: "\F039"; +} +.fa-list:before { + content: "\F03A"; +} +.fa-dedent:before, +.fa-outdent:before { + content: "\F03B"; +} +.fa-indent:before { + content: "\F03C"; +} +.fa-video-camera:before { + content: "\F03D"; +} +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: "\F03E"; +} +.fa-pencil:before { + content: "\F040"; +} +.fa-map-marker:before { + content: "\F041"; +} +.fa-adjust:before { + content: "\F042"; +} +.fa-tint:before { + content: "\F043"; +} +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\F044"; +} +.fa-share-square-o:before { + content: "\F045"; +} +.fa-check-square-o:before { + content: "\F046"; +} +.fa-arrows:before { + content: "\F047"; +} +.fa-step-backward:before { + content: "\F048"; +} +.fa-fast-backward:before { + content: "\F049"; +} +.fa-backward:before { + content: "\F04A"; +} +.fa-play:before { + content: "\F04B"; +} +.fa-pause:before { + content: "\F04C"; +} +.fa-stop:before { + content: "\F04D"; +} +.fa-forward:before { + content: "\F04E"; +} +.fa-fast-forward:before { + content: "\F050"; +} +.fa-step-forward:before { + content: "\F051"; +} +.fa-eject:before { + content: "\F052"; +} +.fa-chevron-left:before { + content: "\F053"; +} +.fa-chevron-right:before { + content: "\F054"; +} +.fa-plus-circle:before { + content: "\F055"; +} +.fa-minus-circle:before { + content: "\F056"; +} +.fa-times-circle:before { + content: "\F057"; +} +.fa-check-circle:before { + content: "\F058"; +} +.fa-question-circle:before { + content: "\F059"; +} +.fa-info-circle:before { + content: "\F05A"; +} +.fa-crosshairs:before { + content: "\F05B"; +} +.fa-times-circle-o:before { + content: "\F05C"; +} +.fa-check-circle-o:before { + content: "\F05D"; +} +.fa-ban:before { + content: "\F05E"; +} +.fa-arrow-left:before { + content: "\F060"; +} +.fa-arrow-right:before { + content: "\F061"; +} +.fa-arrow-up:before { + content: "\F062"; +} +.fa-arrow-down:before { + content: "\F063"; +} +.fa-mail-forward:before, +.fa-share:before { + content: "\F064"; +} +.fa-expand:before { + content: "\F065"; +} +.fa-compress:before { + content: "\F066"; +} +.fa-plus:before { + content: "\F067"; +} +.fa-minus:before { + content: "\F068"; +} +.fa-asterisk:before { + content: "\F069"; +} +.fa-exclamation-circle:before { + content: "\F06A"; +} +.fa-gift:before { + content: "\F06B"; +} +.fa-leaf:before { + content: "\F06C"; +} +.fa-fire:before { + content: "\F06D"; +} +.fa-eye:before { + content: "\F06E"; +} +.fa-eye-slash:before { + content: "\F070"; +} +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\F071"; +} +.fa-plane:before { + content: "\F072"; +} +.fa-calendar:before { + content: "\F073"; +} +.fa-random:before { + content: "\F074"; +} +.fa-comment:before { + content: "\F075"; +} +.fa-magnet:before { + content: "\F076"; +} +.fa-chevron-up:before { + content: "\F077"; +} +.fa-chevron-down:before { + content: "\F078"; +} +.fa-retweet:before { + content: "\F079"; +} +.fa-shopping-cart:before { + content: "\F07A"; +} +.fa-folder:before { + content: "\F07B"; +} +.fa-folder-open:before { + content: "\F07C"; +} +.fa-arrows-v:before { + content: "\F07D"; +} +.fa-arrows-h:before { + content: "\F07E"; +} +.fa-bar-chart-o:before, +.fa-bar-chart:before { + content: "\F080"; +} +.fa-twitter-square:before { + content: "\F081"; +} +.fa-facebook-square:before { + content: "\F082"; +} +.fa-camera-retro:before { + content: "\F083"; +} +.fa-key:before { + content: "\F084"; +} +.fa-gears:before, +.fa-cogs:before { + content: "\F085"; +} +.fa-comments:before { + content: "\F086"; +} +.fa-thumbs-o-up:before { + content: "\F087"; +} +.fa-thumbs-o-down:before { + content: "\F088"; +} +.fa-star-half:before { + content: "\F089"; +} +.fa-heart-o:before { + content: "\F08A"; +} +.fa-sign-out:before { + content: "\F08B"; +} +.fa-linkedin-square:before { + content: "\F08C"; +} +.fa-thumb-tack:before { + content: "\F08D"; +} +.fa-external-link:before { + content: "\F08E"; +} +.fa-sign-in:before { + content: "\F090"; +} +.fa-trophy:before { + content: "\F091"; +} +.fa-github-square:before { + content: "\F092"; +} +.fa-upload:before { + content: "\F093"; +} +.fa-lemon-o:before { + content: "\F094"; +} +.fa-phone:before { + content: "\F095"; +} +.fa-square-o:before { + content: "\F096"; +} +.fa-bookmark-o:before { + content: "\F097"; +} +.fa-phone-square:before { + content: "\F098"; +} +.fa-twitter:before { + content: "\F099"; +} +.fa-facebook-f:before, +.fa-facebook:before { + content: "\F09A"; +} +.fa-github:before { + content: "\F09B"; +} +.fa-unlock:before { + content: "\F09C"; +} +.fa-credit-card:before { + content: "\F09D"; +} +.fa-feed:before, +.fa-rss:before { + content: "\F09E"; +} +.fa-hdd-o:before { + content: "\F0A0"; +} +.fa-bullhorn:before { + content: "\F0A1"; +} +.fa-bell:before { + content: "\F0F3"; +} +.fa-certificate:before { + content: "\F0A3"; +} +.fa-hand-o-right:before { + content: "\F0A4"; +} +.fa-hand-o-left:before { + content: "\F0A5"; +} +.fa-hand-o-up:before { + content: "\F0A6"; +} +.fa-hand-o-down:before { + content: "\F0A7"; +} +.fa-arrow-circle-left:before { + content: "\F0A8"; +} +.fa-arrow-circle-right:before { + content: "\F0A9"; +} +.fa-arrow-circle-up:before { + content: "\F0AA"; +} +.fa-arrow-circle-down:before { + content: "\F0AB"; +} +.fa-globe:before { + content: "\F0AC"; +} +.fa-wrench:before { + content: "\F0AD"; +} +.fa-tasks:before { + content: "\F0AE"; +} +.fa-filter:before { + content: "\F0B0"; +} +.fa-briefcase:before { + content: "\F0B1"; +} +.fa-arrows-alt:before { + content: "\F0B2"; +} +.fa-group:before, +.fa-users:before { + content: "\F0C0"; +} +.fa-chain:before, +.fa-link:before { + content: "\F0C1"; +} +.fa-cloud:before { + content: "\F0C2"; +} +.fa-flask:before { + content: "\F0C3"; +} +.fa-cut:before, +.fa-scissors:before { + content: "\F0C4"; +} +.fa-copy:before, +.fa-files-o:before { + content: "\F0C5"; +} +.fa-paperclip:before { + content: "\F0C6"; +} +.fa-save:before, +.fa-floppy-o:before { + content: "\F0C7"; +} +.fa-square:before { + content: "\F0C8"; +} +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: "\F0C9"; +} +.fa-list-ul:before { + content: "\F0CA"; +} +.fa-list-ol:before { + content: "\F0CB"; +} +.fa-strikethrough:before { + content: "\F0CC"; +} +.fa-underline:before { + content: "\F0CD"; +} +.fa-table:before { + content: "\F0CE"; +} +.fa-magic:before { + content: "\F0D0"; +} +.fa-truck:before { + content: "\F0D1"; +} +.fa-pinterest:before { + content: "\F0D2"; +} +.fa-pinterest-square:before { + content: "\F0D3"; +} +.fa-google-plus-square:before { + content: "\F0D4"; +} +.fa-google-plus:before { + content: "\F0D5"; +} +.fa-money:before { + content: "\F0D6"; +} +.fa-caret-down:before { + content: "\F0D7"; +} +.fa-caret-up:before { + content: "\F0D8"; +} +.fa-caret-left:before { + content: "\F0D9"; +} +.fa-caret-right:before { + content: "\F0DA"; +} +.fa-columns:before { + content: "\F0DB"; +} +.fa-unsorted:before, +.fa-sort:before { + content: "\F0DC"; +} +.fa-sort-down:before, +.fa-sort-desc:before { + content: "\F0DD"; +} +.fa-sort-up:before, +.fa-sort-asc:before { + content: "\F0DE"; +} +.fa-envelope:before { + content: "\F0E0"; +} +.fa-linkedin:before { + content: "\F0E1"; +} +.fa-rotate-left:before, +.fa-undo:before { + content: "\F0E2"; +} +.fa-legal:before, +.fa-gavel:before { + content: "\F0E3"; +} +.fa-dashboard:before, +.fa-tachometer:before { + content: "\F0E4"; +} +.fa-comment-o:before { + content: "\F0E5"; +} +.fa-comments-o:before { + content: "\F0E6"; +} +.fa-flash:before, +.fa-bolt:before { + content: "\F0E7"; +} +.fa-sitemap:before { + content: "\F0E8"; +} +.fa-umbrella:before { + content: "\F0E9"; +} +.fa-paste:before, +.fa-clipboard:before { + content: "\F0EA"; +} +.fa-lightbulb-o:before { + content: "\F0EB"; +} +.fa-exchange:before { + content: "\F0EC"; +} +.fa-cloud-download:before { + content: "\F0ED"; +} +.fa-cloud-upload:before { + content: "\F0EE"; +} +.fa-user-md:before { + content: "\F0F0"; +} +.fa-stethoscope:before { + content: "\F0F1"; +} +.fa-suitcase:before { + content: "\F0F2"; +} +.fa-bell-o:before { + content: "\F0A2"; +} +.fa-coffee:before { + content: "\F0F4"; +} +.fa-cutlery:before { + content: "\F0F5"; +} +.fa-file-text-o:before { + content: "\F0F6"; +} +.fa-building-o:before { + content: "\F0F7"; +} +.fa-hospital-o:before { + content: "\F0F8"; +} +.fa-ambulance:before { + content: "\F0F9"; +} +.fa-medkit:before { + content: "\F0FA"; +} +.fa-fighter-jet:before { + content: "\F0FB"; +} +.fa-beer:before { + content: "\F0FC"; +} +.fa-h-square:before { + content: "\F0FD"; +} +.fa-plus-square:before { + content: "\F0FE"; +} +.fa-angle-double-left:before { + content: "\F100"; +} +.fa-angle-double-right:before { + content: "\F101"; +} +.fa-angle-double-up:before { + content: "\F102"; +} +.fa-angle-double-down:before { + content: "\F103"; +} +.fa-angle-left:before { + content: "\F104"; +} +.fa-angle-right:before { + content: "\F105"; +} +.fa-angle-up:before { + content: "\F106"; +} +.fa-angle-down:before { + content: "\F107"; +} +.fa-desktop:before { + content: "\F108"; +} +.fa-laptop:before { + content: "\F109"; +} +.fa-tablet:before { + content: "\F10A"; +} +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\F10B"; +} +.fa-circle-o:before { + content: "\F10C"; +} +.fa-quote-left:before { + content: "\F10D"; +} +.fa-quote-right:before { + content: "\F10E"; +} +.fa-spinner:before { + content: "\F110"; +} +.fa-circle:before { + content: "\F111"; +} +.fa-mail-reply:before, +.fa-reply:before { + content: "\F112"; +} +.fa-github-alt:before { + content: "\F113"; +} +.fa-folder-o:before { + content: "\F114"; +} +.fa-folder-open-o:before { + content: "\F115"; +} +.fa-smile-o:before { + content: "\F118"; +} +.fa-frown-o:before { + content: "\F119"; +} +.fa-meh-o:before { + content: "\F11A"; +} +.fa-gamepad:before { + content: "\F11B"; +} +.fa-keyboard-o:before { + content: "\F11C"; +} +.fa-flag-o:before { + content: "\F11D"; +} +.fa-flag-checkered:before { + content: "\F11E"; +} +.fa-terminal:before { + content: "\F120"; +} +.fa-code:before { + content: "\F121"; +} +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: "\F122"; +} +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\F123"; +} +.fa-location-arrow:before { + content: "\F124"; +} +.fa-crop:before { + content: "\F125"; +} +.fa-code-fork:before { + content: "\F126"; +} +.fa-unlink:before, +.fa-chain-broken:before { + content: "\F127"; +} +.fa-question:before { + content: "\F128"; +} +.fa-info:before { + content: "\F129"; +} +.fa-exclamation:before { + content: "\F12A"; +} +.fa-superscript:before { + content: "\F12B"; +} +.fa-subscript:before { + content: "\F12C"; +} +.fa-eraser:before { + content: "\F12D"; +} +.fa-puzzle-piece:before { + content: "\F12E"; +} +.fa-microphone:before { + content: "\F130"; +} +.fa-microphone-slash:before { + content: "\F131"; +} +.fa-shield:before { + content: "\F132"; +} +.fa-calendar-o:before { + content: "\F133"; +} +.fa-fire-extinguisher:before { + content: "\F134"; +} +.fa-rocket:before { + content: "\F135"; +} +.fa-maxcdn:before { + content: "\F136"; +} +.fa-chevron-circle-left:before { + content: "\F137"; +} +.fa-chevron-circle-right:before { + content: "\F138"; +} +.fa-chevron-circle-up:before { + content: "\F139"; +} +.fa-chevron-circle-down:before { + content: "\F13A"; +} +.fa-html5:before { + content: "\F13B"; +} +.fa-css3:before { + content: "\F13C"; +} +.fa-anchor:before { + content: "\F13D"; +} +.fa-unlock-alt:before { + content: "\F13E"; +} +.fa-bullseye:before { + content: "\F140"; +} +.fa-ellipsis-h:before { + content: "\F141"; +} +.fa-ellipsis-v:before { + content: "\F142"; +} +.fa-rss-square:before { + content: "\F143"; +} +.fa-play-circle:before { + content: "\F144"; +} +.fa-ticket:before { + content: "\F145"; +} +.fa-minus-square:before { + content: "\F146"; +} +.fa-minus-square-o:before { + content: "\F147"; +} +.fa-level-up:before { + content: "\F148"; +} +.fa-level-down:before { + content: "\F149"; +} +.fa-check-square:before { + content: "\F14A"; +} +.fa-pencil-square:before { + content: "\F14B"; +} +.fa-external-link-square:before { + content: "\F14C"; +} +.fa-share-square:before { + content: "\F14D"; +} +.fa-compass:before { + content: "\F14E"; +} +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\F150"; +} +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\F151"; +} +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\F152"; +} +.fa-euro:before, +.fa-eur:before { + content: "\F153"; +} +.fa-gbp:before { + content: "\F154"; +} +.fa-dollar:before, +.fa-usd:before { + content: "\F155"; +} +.fa-rupee:before, +.fa-inr:before { + content: "\F156"; +} +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\F157"; +} +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\F158"; +} +.fa-won:before, +.fa-krw:before { + content: "\F159"; +} +.fa-bitcoin:before, +.fa-btc:before { + content: "\F15A"; +} +.fa-file:before { + content: "\F15B"; +} +.fa-file-text:before { + content: "\F15C"; +} +.fa-sort-alpha-asc:before { + content: "\F15D"; +} +.fa-sort-alpha-desc:before { + content: "\F15E"; +} +.fa-sort-amount-asc:before { + content: "\F160"; +} +.fa-sort-amount-desc:before { + content: "\F161"; +} +.fa-sort-numeric-asc:before { + content: "\F162"; +} +.fa-sort-numeric-desc:before { + content: "\F163"; +} +.fa-thumbs-up:before { + content: "\F164"; +} +.fa-thumbs-down:before { + content: "\F165"; +} +.fa-youtube-square:before { + content: "\F166"; +} +.fa-youtube:before { + content: "\F167"; +} +.fa-xing:before { + content: "\F168"; +} +.fa-xing-square:before { + content: "\F169"; +} +.fa-youtube-play:before { + content: "\F16A"; +} +.fa-dropbox:before { + content: "\F16B"; +} +.fa-stack-overflow:before { + content: "\F16C"; +} +.fa-instagram:before { + content: "\F16D"; +} +.fa-flickr:before { + content: "\F16E"; +} +.fa-adn:before { + content: "\F170"; +} +.fa-bitbucket:before { + content: "\F171"; +} +.fa-bitbucket-square:before { + content: "\F172"; +} +.fa-tumblr:before { + content: "\F173"; +} +.fa-tumblr-square:before { + content: "\F174"; +} +.fa-long-arrow-down:before { + content: "\F175"; +} +.fa-long-arrow-up:before { + content: "\F176"; +} +.fa-long-arrow-left:before { + content: "\F177"; +} +.fa-long-arrow-right:before { + content: "\F178"; +} +.fa-apple:before { + content: "\F179"; +} +.fa-windows:before { + content: "\F17A"; +} +.fa-android:before { + content: "\F17B"; +} +.fa-linux:before { + content: "\F17C"; +} +.fa-dribbble:before { + content: "\F17D"; +} +.fa-skype:before { + content: "\F17E"; +} +.fa-foursquare:before { + content: "\F180"; +} +.fa-trello:before { + content: "\F181"; +} +.fa-female:before { + content: "\F182"; +} +.fa-male:before { + content: "\F183"; +} +.fa-gittip:before, +.fa-gratipay:before { + content: "\F184"; +} +.fa-sun-o:before { + content: "\F185"; +} +.fa-moon-o:before { + content: "\F186"; +} +.fa-archive:before { + content: "\F187"; +} +.fa-bug:before { + content: "\F188"; +} +.fa-vk:before { + content: "\F189"; +} +.fa-weibo:before { + content: "\F18A"; +} +.fa-renren:before { + content: "\F18B"; +} +.fa-pagelines:before { + content: "\F18C"; +} +.fa-stack-exchange:before { + content: "\F18D"; +} +.fa-arrow-circle-o-right:before { + content: "\F18E"; +} +.fa-arrow-circle-o-left:before { + content: "\F190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\F191"; +} +.fa-dot-circle-o:before { + content: "\F192"; +} +.fa-wheelchair:before { + content: "\F193"; +} +.fa-vimeo-square:before { + content: "\F194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\F195"; +} +.fa-plus-square-o:before { + content: "\F196"; +} +.fa-space-shuttle:before { + content: "\F197"; +} +.fa-slack:before { + content: "\F198"; +} +.fa-envelope-square:before { + content: "\F199"; +} +.fa-wordpress:before { + content: "\F19A"; +} +.fa-openid:before { + content: "\F19B"; +} +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\F19C"; +} +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\F19D"; +} +.fa-yahoo:before { + content: "\F19E"; +} +.fa-google:before { + content: "\F1A0"; +} +.fa-reddit:before { + content: "\F1A1"; +} +.fa-reddit-square:before { + content: "\F1A2"; +} +.fa-stumbleupon-circle:before { + content: "\F1A3"; +} +.fa-stumbleupon:before { + content: "\F1A4"; +} +.fa-delicious:before { + content: "\F1A5"; +} +.fa-digg:before { + content: "\F1A6"; +} +.fa-pied-piper:before { + content: "\F1A7"; +} +.fa-pied-piper-alt:before { + content: "\F1A8"; +} +.fa-drupal:before { + content: "\F1A9"; +} +.fa-joomla:before { + content: "\F1AA"; +} +.fa-language:before { + content: "\F1AB"; +} +.fa-fax:before { + content: "\F1AC"; +} +.fa-building:before { + content: "\F1AD"; +} +.fa-child:before { + content: "\F1AE"; +} +.fa-paw:before { + content: "\F1B0"; +} +.fa-spoon:before { + content: "\F1B1"; +} +.fa-cube:before { + content: "\F1B2"; +} +.fa-cubes:before { + content: "\F1B3"; +} +.fa-behance:before { + content: "\F1B4"; +} +.fa-behance-square:before { + content: "\F1B5"; +} +.fa-steam:before { + content: "\F1B6"; +} +.fa-steam-square:before { + content: "\F1B7"; +} +.fa-recycle:before { + content: "\F1B8"; +} +.fa-automobile:before, +.fa-car:before { + content: "\F1B9"; +} +.fa-cab:before, +.fa-taxi:before { + content: "\F1BA"; +} +.fa-tree:before { + content: "\F1BB"; +} +.fa-spotify:before { + content: "\F1BC"; +} +.fa-deviantart:before { + content: "\F1BD"; +} +.fa-soundcloud:before { + content: "\F1BE"; +} +.fa-database:before { + content: "\F1C0"; +} +.fa-file-pdf-o:before { + content: "\F1C1"; +} +.fa-file-word-o:before { + content: "\F1C2"; +} +.fa-file-excel-o:before { + content: "\F1C3"; +} +.fa-file-powerpoint-o:before { + content: "\F1C4"; +} +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\F1C5"; +} +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\F1C6"; +} +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\F1C7"; +} +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\F1C8"; +} +.fa-file-code-o:before { + content: "\F1C9"; +} +.fa-vine:before { + content: "\F1CA"; +} +.fa-codepen:before { + content: "\F1CB"; +} +.fa-jsfiddle:before { + content: "\F1CC"; +} +.fa-life-bouy:before, +.fa-life-buoy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\F1CD"; +} +.fa-circle-o-notch:before { + content: "\F1CE"; +} +.fa-ra:before, +.fa-rebel:before { + content: "\F1D0"; +} +.fa-ge:before, +.fa-empire:before { + content: "\F1D1"; +} +.fa-git-square:before { + content: "\F1D2"; +} +.fa-git:before { + content: "\F1D3"; +} +.fa-y-combinator-square:before, +.fa-yc-square:before, +.fa-hacker-news:before { + content: "\F1D4"; +} +.fa-tencent-weibo:before { + content: "\F1D5"; +} +.fa-qq:before { + content: "\F1D6"; +} +.fa-wechat:before, +.fa-weixin:before { + content: "\F1D7"; +} +.fa-send:before, +.fa-paper-plane:before { + content: "\F1D8"; +} +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\F1D9"; +} +.fa-history:before { + content: "\F1DA"; +} +.fa-circle-thin:before { + content: "\F1DB"; +} +.fa-header:before { + content: "\F1DC"; +} +.fa-paragraph:before { + content: "\F1DD"; +} +.fa-sliders:before { + content: "\F1DE"; +} +.fa-share-alt:before { + content: "\F1E0"; +} +.fa-share-alt-square:before { + content: "\F1E1"; +} +.fa-bomb:before { + content: "\F1E2"; +} +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: "\F1E3"; +} +.fa-tty:before { + content: "\F1E4"; +} +.fa-binoculars:before { + content: "\F1E5"; +} +.fa-plug:before { + content: "\F1E6"; +} +.fa-slideshare:before { + content: "\F1E7"; +} +.fa-twitch:before { + content: "\F1E8"; +} +.fa-yelp:before { + content: "\F1E9"; +} +.fa-newspaper-o:before { + content: "\F1EA"; +} +.fa-wifi:before { + content: "\F1EB"; +} +.fa-calculator:before { + content: "\F1EC"; +} +.fa-paypal:before { + content: "\F1ED"; +} +.fa-google-wallet:before { + content: "\F1EE"; +} +.fa-cc-visa:before { + content: "\F1F0"; +} +.fa-cc-mastercard:before { + content: "\F1F1"; +} +.fa-cc-discover:before { + content: "\F1F2"; +} +.fa-cc-amex:before { + content: "\F1F3"; +} +.fa-cc-paypal:before { + content: "\F1F4"; +} +.fa-cc-stripe:before { + content: "\F1F5"; +} +.fa-bell-slash:before { + content: "\F1F6"; +} +.fa-bell-slash-o:before { + content: "\F1F7"; +} +.fa-trash:before { + content: "\F1F8"; +} +.fa-copyright:before { + content: "\F1F9"; +} +.fa-at:before { + content: "\F1FA"; +} +.fa-eyedropper:before { + content: "\F1FB"; +} +.fa-paint-brush:before { + content: "\F1FC"; +} +.fa-birthday-cake:before { + content: "\F1FD"; +} +.fa-area-chart:before { + content: "\F1FE"; +} +.fa-pie-chart:before { + content: "\F200"; +} +.fa-line-chart:before { + content: "\F201"; +} +.fa-lastfm:before { + content: "\F202"; +} +.fa-lastfm-square:before { + content: "\F203"; +} +.fa-toggle-off:before { + content: "\F204"; +} +.fa-toggle-on:before { + content: "\F205"; +} +.fa-bicycle:before { + content: "\F206"; +} +.fa-bus:before { + content: "\F207"; +} +.fa-ioxhost:before { + content: "\F208"; +} +.fa-angellist:before { + content: "\F209"; +} +.fa-cc:before { + content: "\F20A"; +} +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: "\F20B"; +} +.fa-meanpath:before { + content: "\F20C"; +} +.fa-buysellads:before { + content: "\F20D"; +} +.fa-connectdevelop:before { + content: "\F20E"; +} +.fa-dashcube:before { + content: "\F210"; +} +.fa-forumbee:before { + content: "\F211"; +} +.fa-leanpub:before { + content: "\F212"; +} +.fa-sellsy:before { + content: "\F213"; +} +.fa-shirtsinbulk:before { + content: "\F214"; +} +.fa-simplybuilt:before { + content: "\F215"; +} +.fa-skyatlas:before { + content: "\F216"; +} +.fa-cart-plus:before { + content: "\F217"; +} +.fa-cart-arrow-down:before { + content: "\F218"; +} +.fa-diamond:before { + content: "\F219"; +} +.fa-ship:before { + content: "\F21A"; +} +.fa-user-secret:before { + content: "\F21B"; +} +.fa-motorcycle:before { + content: "\F21C"; +} +.fa-street-view:before { + content: "\F21D"; +} +.fa-heartbeat:before { + content: "\F21E"; +} +.fa-venus:before { + content: "\F221"; +} +.fa-mars:before { + content: "\F222"; +} +.fa-mercury:before { + content: "\F223"; +} +.fa-intersex:before, +.fa-transgender:before { + content: "\F224"; +} +.fa-transgender-alt:before { + content: "\F225"; +} +.fa-venus-double:before { + content: "\F226"; +} +.fa-mars-double:before { + content: "\F227"; +} +.fa-venus-mars:before { + content: "\F228"; +} +.fa-mars-stroke:before { + content: "\F229"; +} +.fa-mars-stroke-v:before { + content: "\F22A"; +} +.fa-mars-stroke-h:before { + content: "\F22B"; +} +.fa-neuter:before { + content: "\F22C"; +} +.fa-genderless:before { + content: "\F22D"; +} +.fa-facebook-official:before { + content: "\F230"; +} +.fa-pinterest-p:before { + content: "\F231"; +} +.fa-whatsapp:before { + content: "\F232"; +} +.fa-server:before { + content: "\F233"; +} +.fa-user-plus:before { + content: "\F234"; +} +.fa-user-times:before { + content: "\F235"; +} +.fa-hotel:before, +.fa-bed:before { + content: "\F236"; +} +.fa-viacoin:before { + content: "\F237"; +} +.fa-train:before { + content: "\F238"; +} +.fa-subway:before { + content: "\F239"; +} +.fa-medium:before { + content: "\F23A"; +} +.fa-yc:before, +.fa-y-combinator:before { + content: "\F23B"; +} +.fa-optin-monster:before { + content: "\F23C"; +} +.fa-opencart:before { + content: "\F23D"; +} +.fa-expeditedssl:before { + content: "\F23E"; +} +.fa-battery-4:before, +.fa-battery-full:before { + content: "\F240"; +} +.fa-battery-3:before, +.fa-battery-three-quarters:before { + content: "\F241"; +} +.fa-battery-2:before, +.fa-battery-half:before { + content: "\F242"; +} +.fa-battery-1:before, +.fa-battery-quarter:before { + content: "\F243"; +} +.fa-battery-0:before, +.fa-battery-empty:before { + content: "\F244"; +} +.fa-mouse-pointer:before { + content: "\F245"; +} +.fa-i-cursor:before { + content: "\F246"; +} +.fa-object-group:before { + content: "\F247"; +} +.fa-object-ungroup:before { + content: "\F248"; +} +.fa-sticky-note:before { + content: "\F249"; +} +.fa-sticky-note-o:before { + content: "\F24A"; +} +.fa-cc-jcb:before { + content: "\F24B"; +} +.fa-cc-diners-club:before { + content: "\F24C"; +} +.fa-clone:before { + content: "\F24D"; +} +.fa-balance-scale:before { + content: "\F24E"; +} +.fa-hourglass-o:before { + content: "\F250"; +} +.fa-hourglass-1:before, +.fa-hourglass-start:before { + content: "\F251"; +} +.fa-hourglass-2:before, +.fa-hourglass-half:before { + content: "\F252"; +} +.fa-hourglass-3:before, +.fa-hourglass-end:before { + content: "\F253"; +} +.fa-hourglass:before { + content: "\F254"; +} +.fa-hand-grab-o:before, +.fa-hand-rock-o:before { + content: "\F255"; +} +.fa-hand-stop-o:before, +.fa-hand-paper-o:before { + content: "\F256"; +} +.fa-hand-scissors-o:before { + content: "\F257"; +} +.fa-hand-lizard-o:before { + content: "\F258"; +} +.fa-hand-spock-o:before { + content: "\F259"; +} +.fa-hand-pointer-o:before { + content: "\F25A"; +} +.fa-hand-peace-o:before { + content: "\F25B"; +} +.fa-trademark:before { + content: "\F25C"; +} +.fa-registered:before { + content: "\F25D"; +} +.fa-creative-commons:before { + content: "\F25E"; +} +.fa-gg:before { + content: "\F260"; +} +.fa-gg-circle:before { + content: "\F261"; +} +.fa-tripadvisor:before { + content: "\F262"; +} +.fa-odnoklassniki:before { + content: "\F263"; +} +.fa-odnoklassniki-square:before { + content: "\F264"; +} +.fa-get-pocket:before { + content: "\F265"; +} +.fa-wikipedia-w:before { + content: "\F266"; +} +.fa-safari:before { + content: "\F267"; +} +.fa-chrome:before { + content: "\F268"; +} +.fa-firefox:before { + content: "\F269"; +} +.fa-opera:before { + content: "\F26A"; +} +.fa-internet-explorer:before { + content: "\F26B"; +} +.fa-tv:before, +.fa-television:before { + content: "\F26C"; +} +.fa-contao:before { + content: "\F26D"; +} +.fa-500px:before { + content: "\F26E"; +} +.fa-amazon:before { + content: "\F270"; +} +.fa-calendar-plus-o:before { + content: "\F271"; +} +.fa-calendar-minus-o:before { + content: "\F272"; +} +.fa-calendar-times-o:before { + content: "\F273"; +} +.fa-calendar-check-o:before { + content: "\F274"; +} +.fa-industry:before { + content: "\F275"; +} +.fa-map-pin:before { + content: "\F276"; +} +.fa-map-signs:before { + content: "\F277"; +} +.fa-map-o:before { + content: "\F278"; +} +.fa-map:before { + content: "\F279"; +} +.fa-commenting:before { + content: "\F27A"; +} +.fa-commenting-o:before { + content: "\F27B"; +} +.fa-houzz:before { + content: "\F27C"; +} +.fa-vimeo:before { + content: "\F27D"; +} +.fa-black-tie:before { + content: "\F27E"; +} +.fa-fonticons:before { + content: "\F280"; +} +.fa-file-new-o:before { + content: "\F016"; +} +.fa-file-new-o:after { + content: "\F067"; + position: relative; + margin-left: -1em; + font-size: 0.5em; +} +.fa-success:before { + content: "\F00C"; +} +.fa-danger:before { + content: "\F06A"; +} +.navbar { + border-width: 0; + box-shadow: inset 0 -10px 10px -12px #333333; + -moz-box-shadow: inset 0 -10px 10px -12px #333333; + -webkit-box-shadow: inset 0 -10px 10px -12px #333333; +} +.navbar-btn-link { + height: 45px; + margin: 0; + border-radius: 0; +} +@media (max-width: 768px) { + .navbar-btn-link { + width: 100%; + text-align: left; + } +} +.navbar-default .badge { + background-color: #ffffff; + color: #656a76; +} +.navbar-inverse .logo { + height: 45px; + width: 252px; + background-color: #3c3c3c; +} +.navbar-inverse .logo-small { + height: 45px; + width: 45px; + background-color: #3c3c3c; +} +.navbar-inverse .badge { + background-color: #ffffff; + color: #3c3c3c; +} +.navbar .navbar-nav > .active > a { + border-bottom-color: #ffffff; +} +.navbar .navbar-nav > .active > a:before { + content: ""; + display: inline-block; + position: absolute; + border: 7px solid transparent; + border-bottom-color: inherit; + top: 31px; + left: 0; + right: 0; + margin: 0 auto; + width: 0; + height: 0; +} +@media (max-width: 768px) { + .navbar .navbar-nav > .active > a:before { + display: none !important; + } +} +.navbar-brand { + cursor: default; + font-size: 1.8em; + background-color: #3c3c3c; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.navbar-nav { + font-size: 12px; +} +.navbar-toggle { + margin-top: 4px; +} +.btn:active { + box-shadow: none; +} +.btn-group.open .dropdown-toggle { + box-shadow: none; +} +/* Small devices (tablets, 768px and smaller) */ +@media (max-width: 768px) { + .btn { + /* Fixes an issue with buttons not respecting the bounds of the screen */ + white-space: normal; + } +} +.text-primary, +.text-primary:hover { + color: #444444; +} +.text-success, +.text-success:hover { + color: #31c471; +} +.text-danger, +.text-danger:hover { + color: #e74c3c; +} +.text-warning, +.text-warning:hover { + color: #f39c12; +} +.text-info, +.text-info:hover { + color: #1f6b7a; +} +table a, +.table a { + text-decoration: underline; +} +table .success, +.table .success, +table .warning, +.table .warning, +table .danger, +.table .danger, +table .info, +.table .info { + color: #ffffff; +} +table .success a, +.table .success a, +table .warning a, +.table .warning a, +table .danger a, +.table .danger a, +table .info a, +.table .info a { + color: #ffffff; +} +table-bordered > thead > tr > th, +.table-bordered > thead > tr > th, +table-bordered > tbody > tr > th, +.table-bordered > tbody > tr > th, +table-bordered > tfoot > tr > th, +.table-bordered > tfoot > tr > th, +table-bordered > thead > tr > td, +.table-bordered > thead > tr > td, +table-bordered > tbody > tr > td, +.table-bordered > tbody > tr > td, +table-bordered > tfoot > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #ecf0f1; +} +.form-control, +input { + border-width: 2px; + box-shadow: none; +} +.form-control:focus, +input:focus { + box-shadow: none; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning .form-control-feedback { + color: #f39c12; +} +.has-warning .form-control, +.has-warning .form-control:focus { + border: 2px solid; + border-color: #f39c12; +} +.has-warning .input-group-addon { + border-color: #f39c12; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error .form-control-feedback { + color: #e74c3c; +} +.has-error .form-control, +.has-error .form-control:focus { + border: 2px solid; + border-color: #e74c3c; +} +.has-error .input-group-addon { + border-color: #e74c3c; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success .form-control-feedback { + color: #31c471; +} +.has-success .form-control, +.has-success .form-control:focus { + border: solid #31c471; +} +.has-success .input-group-addon { + border-color: #31c471; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + border-color: transparent; +} +.pager a, +.pager a:hover { + color: #ffffff; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + background-color: rgba(38, 38, 38, 0); +} +.panel { + border-radius: 0; + box-shadow: 0 0 0 rgba(0, 0, 0, 0); +} +.alert a, +.alert .alert-link { + color: #ffffff; + text-decoration: underline; +} +.alert .close { + color: #ffffff; + text-decoration: none; + opacity: 0.4; +} +.alert .close:hover, +.alert .close:focus { + color: #ffffff; + opacity: 1; +} +.progress { + box-shadow: none; +} +.progress .progress-bar { + font-size: 10px; + line-height: 10px; +} +.well { + box-shadow: none; +} +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.btn-group-lg > .btn { + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; + border-radius: 6px; +} +.btn-group-sm > .btn { + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +html, +body { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + height: 100%; + margin: 0px; +} +html > *, +body > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +label > small { + font-weight: normal; +} +button { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 5px 15px; + font-size: 13px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +button:focus, +button:active:focus, +button.active:focus, +button.focus, +button:active.focus, +button.active.focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +button:hover, +button:focus, +button.focus { + color: #ffffff; + text-decoration: none; +} +button:active, +button.active { + outline: 0; + background-image: none; + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +button.disabled, +button[disabled], +fieldset[disabled] button { + cursor: not-allowed; + opacity: 0.65; + filter: alpha(opacity=65); + box-shadow: none; +} +abutton.disabled, +fieldset[disabled] abutton { + pointer-events: none; +} +.small { + font-size: 0.9em !important; +} +.smaller { + font-size: 0.8em !important; +} +.smallest { + font-size: 0.7em !important; +} +.text-color-primary { + color: #444444; +} +.text-color-info { + color: #1f6b7a; +} +.text-color-success { + color: #31c471; +} +.text-color-warning { + color: #f39c12; +} +.text-color-danger { + color: #e74c3c; +} +.text-monospace { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + word-break: break-all; + word-wrap: break-word; +} +ul.navbar-inline li { + display: inline; +} +.tooltip { + font-size: 8pt; + font-weight: normal; + opacity: 90%; +} +.tooltip-inner { + word-break: normal; + word-wrap: break-word; + white-space: normal; +} +.content { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + position: relative; + z-index: 0; +} +.content > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +.content > nav { + position: relative; + z-index: 1; +} +.content > nav .navbar-right { + margin-right: 0; +} +.application { + -webkit-box-flex: 1; + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + position: relative; + z-index: 0; +} +.application > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +.top-fixed { + position: fixed; + bottom: 0px; +} +.checkbox label { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + padding-left: 0; +} +.checkbox label input[type="checkbox"] { + float: none; + margin: 0 4px; + position: static; +} +notifications { + z-index: 1; +} +.navbar { + margin-bottom: 0px!important; +} +a { + cursor: default; +} +[ng-click], +[clip-copy], +[href], +[confirm-click] { + cursor: pointer; +} +.app-container > * { + position: relative; + z-index: 0; +} +.app-container > config { + z-index: 1; +} +.app-container > nav, +.app-container > navbar { + z-index: 2 !important; +} +.nav-condensed > li > a { + padding-top: 2px; + padding-bottom: 2px; +} +.navbar > .container-fluid > .navbar-nav:not(.pull-right):first-child, +.navbar > .container-fluid > .navbar-form:not(.pull-right):first-child { + margin-left: -15px; +} +.navbtn { + color: #ffffff; + background-color: #656a76; + border-color: #4d515b; +} +.navbtn:focus, +.navbtn.focus { + color: #ffffff; + background-color: #4d515b; + border-color: #131416; +} +.navbtn:hover { + color: #ffffff; + background-color: #4d515b; + border-color: #31343a; +} +.navbtn:active, +.navbtn.active, +.open > .dropdown-toggle.navbtn { + color: #ffffff; + background-color: #4d515b; + border-color: #31343a; +} +.navbtn:active:hover, +.navbtn.active:hover, +.open > .dropdown-toggle.navbtn:hover, +.navbtn:active:focus, +.navbtn.active:focus, +.open > .dropdown-toggle.navbtn:focus, +.navbtn:active.focus, +.navbtn.active.focus, +.open > .dropdown-toggle.navbtn.focus { + color: #ffffff; + background-color: #3d4047; + border-color: #131416; +} +.navbtn:active, +.navbtn.active, +.open > .dropdown-toggle.navbtn { + background-image: none; +} +.navbtn.disabled, +.navbtn[disabled], +fieldset[disabled] .navbtn, +.navbtn.disabled:hover, +.navbtn[disabled]:hover, +fieldset[disabled] .navbtn:hover, +.navbtn.disabled:focus, +.navbtn[disabled]:focus, +fieldset[disabled] .navbtn:focus, +.navbtn.disabled.focus, +.navbtn[disabled].focus, +fieldset[disabled] .navbtn.focus, +.navbtn.disabled:active, +.navbtn[disabled]:active, +fieldset[disabled] .navbtn:active, +.navbtn.disabled.active, +.navbtn[disabled].active, +fieldset[disabled] .navbtn.active { + background-color: #656a76; + border-color: #4d515b; +} +.navbtn .badge { + color: #656a76; + background-color: #ffffff; +} +.navbtn-inverse { + color: #ffffff; + background-color: #656a76; + border-color: #4d515b; +} +.navbtn-inverse:focus, +.navbtn-inverse.focus { + color: #ffffff; + background-color: #4d515b; + border-color: #131416; +} +.navbtn-inverse:hover { + color: #ffffff; + background-color: #4d515b; + border-color: #31343a; +} +.navbtn-inverse:active, +.navbtn-inverse.active, +.open > .dropdown-toggle.navbtn-inverse { + color: #ffffff; + background-color: #4d515b; + border-color: #31343a; +} +.navbtn-inverse:active:hover, +.navbtn-inverse.active:hover, +.open > .dropdown-toggle.navbtn-inverse:hover, +.navbtn-inverse:active:focus, +.navbtn-inverse.active:focus, +.open > .dropdown-toggle.navbtn-inverse:focus, +.navbtn-inverse:active.focus, +.navbtn-inverse.active.focus, +.open > .dropdown-toggle.navbtn-inverse.focus { + color: #ffffff; + background-color: #3d4047; + border-color: #131416; +} +.navbtn-inverse:active, +.navbtn-inverse.active, +.open > .dropdown-toggle.navbtn-inverse { + background-image: none; +} +.navbtn-inverse.disabled, +.navbtn-inverse[disabled], +fieldset[disabled] .navbtn-inverse, +.navbtn-inverse.disabled:hover, +.navbtn-inverse[disabled]:hover, +fieldset[disabled] .navbtn-inverse:hover, +.navbtn-inverse.disabled:focus, +.navbtn-inverse[disabled]:focus, +fieldset[disabled] .navbtn-inverse:focus, +.navbtn-inverse.disabled.focus, +.navbtn-inverse[disabled].focus, +fieldset[disabled] .navbtn-inverse.focus, +.navbtn-inverse.disabled:active, +.navbtn-inverse[disabled]:active, +fieldset[disabled] .navbtn-inverse:active, +.navbtn-inverse.disabled.active, +.navbtn-inverse[disabled].active, +fieldset[disabled] .navbtn-inverse.active { + background-color: #656a76; + border-color: #4d515b; +} +.navbtn-inverse .badge { + color: #656a76; + background-color: #ffffff; +} +.navbar-static-top .navbar-right { + font-size: 12px; +} +.navbar-static-top .navbar-right .loading-spinner { + color: #ffffff; + vertical-align: middle; +} +.navbar-timepicker > li > a { + padding-left: 7px !important; + padding-right: 7px !important; +} +.navbar-timepicker-time-desc > .fa-clock-o { + padding-right: 5px; +} +.navbar-timepicker .fa { + font-size: 16px; + vertical-align: middle; +} +kbn-info i { + cursor: help; +} +.kbn-timepicker .btn-default { + background: transparent; + color: #444444; + border: 0px; + box-shadow: none; + text-shadow: none; +} +.kbn-timepicker .btn-info { + color: #ffffff; + background-color: #1f6b7a; + border-color: #1f6b7a; + text-shadow: none; +} +.kbn-timepicker .btn-info:focus, +.kbn-timepicker .btn-info.focus { + color: #ffffff; + background-color: #154751; + border-color: #051214; +} +.kbn-timepicker .btn-info:hover { + color: #ffffff; + background-color: #154751; + border-color: #134049; +} +.kbn-timepicker .btn-info:active, +.kbn-timepicker .btn-info.active, +.open > .dropdown-toggle.kbn-timepicker .btn-info { + color: #ffffff; + background-color: #154751; + border-color: #134049; +} +.kbn-timepicker .btn-info:active:hover, +.kbn-timepicker .btn-info.active:hover, +.open > .dropdown-toggle.kbn-timepicker .btn-info:hover, +.kbn-timepicker .btn-info:active:focus, +.kbn-timepicker .btn-info.active:focus, +.open > .dropdown-toggle.kbn-timepicker .btn-info:focus, +.kbn-timepicker .btn-info:active.focus, +.kbn-timepicker .btn-info.active.focus, +.open > .dropdown-toggle.kbn-timepicker .btn-info.focus { + color: #ffffff; + background-color: #0d2e35; + border-color: #051214; +} +.kbn-timepicker .btn-info:active, +.kbn-timepicker .btn-info.active, +.open > .dropdown-toggle.kbn-timepicker .btn-info { + background-image: none; +} +.kbn-timepicker .btn-info.disabled, +.kbn-timepicker .btn-info[disabled], +fieldset[disabled] .kbn-timepicker .btn-info, +.kbn-timepicker .btn-info.disabled:hover, +.kbn-timepicker .btn-info[disabled]:hover, +fieldset[disabled] .kbn-timepicker .btn-info:hover, +.kbn-timepicker .btn-info.disabled:focus, +.kbn-timepicker .btn-info[disabled]:focus, +fieldset[disabled] .kbn-timepicker .btn-info:focus, +.kbn-timepicker .btn-info.disabled.focus, +.kbn-timepicker .btn-info[disabled].focus, +fieldset[disabled] .kbn-timepicker .btn-info.focus, +.kbn-timepicker .btn-info.disabled:active, +.kbn-timepicker .btn-info[disabled]:active, +fieldset[disabled] .kbn-timepicker .btn-info:active, +.kbn-timepicker .btn-info.disabled.active, +.kbn-timepicker .btn-info[disabled].active, +fieldset[disabled] .kbn-timepicker .btn-info.active { + background-color: #1f6b7a; + border-color: #1f6b7a; +} +.kbn-timepicker .btn-info .badge { + color: #1f6b7a; + background-color: #ffffff; +} +.kbn-timepicker .btn-info .text-info { + color: #ffffff; +} +.kbn-timepicker .refresh-interval { + padding: 0.2em 0.4em; + border-radius: 3px; +} +.kbn-timepicker .refresh-interval-active { + background-color: #1f6b7a; + color: #ffffff; +} +kbn-table, +.kbn-table { + font-size: 12px; +} +kbn-table th, +.kbn-table th { + white-space: nowrap; + padding-right: 10px; +} +kbn-table th .table-header-move, +.kbn-table th .table-header-move, +kbn-table th .table-header-sortchange, +.kbn-table th .table-header-sortchange { + visibility: hidden; +} +kbn-table th .fa, +.kbn-table th .fa { + font-size: 1.1em; +} +kbn-table th:hover .table-header-move, +.kbn-table th:hover .table-header-move, +kbn-table th:hover .table-header-sortchange, +.kbn-table th:hover .table-header-sortchange { + visibility: visible; +} +table td .fa { + line-height: 1.42857143; +} +saved-object-finder .form-group { + margin-bottom: 0; +} +saved-object-finder .form-group input { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +saved-object-finder .list-group-item a { + color: #1f6b7a !important; +} +saved-object-finder .list-group-item a i { + color: #154751 !important; +} +saved-object-finder .list-group-item:first-child { + border-top-right-radius: 0 !important; + border-top-left-radius: 0 !important; +} +saved-object-finder .list-group-item.list-group-no-results p { + margin-bottom: 0 !important; +} +saved-object-finder div.finder-form { + position: relative; +} +saved-object-finder div.finder-form-options { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: end; + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; +} +saved-object-finder div.finder-form-options > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +saved-object-finder span.finder-hit-count { + position: absolute; + right: 10px; + top: 25px; + font-size: 0.85em; +} +saved-object-finder .finder-options { + max-height: 300px; + overflow: auto; + padding: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +saved-object-finder .finder-options > * { + padding: 5px 15px; + margin: 0; +} +saved-object-finder .finder-options > li { + margin-top: -ceil(2.5px); +} +saved-object-finder .finder-options > li:first-child { + margin: 0; +} +saved-object-finder .finder-options > li.active { + background-color: #444444; + color: #ffffff; +} +saved-object-finder .finder-options > li.active a { + color: #ffffff; +} +.config saved-object-finder .finder-options { + margin-bottom: 0; + background: #ffffff; +} +.media-object { + width: 65px; + height: 65px; +} +.input-datetime-format { + font-size: 12px; + color: #b4bcc2; + padding: 5px 15px; +} +button[disabled] { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: default; + opacity: .8; +} +.fatal-body { + white-space: pre-wrap; +} +input.ng-invalid.ng-dirty, +input.ng-invalid.ng-touched, +textarea.ng-invalid.ng-dirty, +textarea.ng-invalid.ng-touched, +select.ng-invalid.ng-dirty, +select.ng-invalid.ng-touched { + border-color: #e74c3c !important; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +.radio[disabled], +.radio-inline[disabled], +.checkbox[disabled], +.checkbox-inline[disabled], +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"], +fieldset[disabled] .radio, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox, +fieldset[disabled] .checkbox-inline { + cursor: default; + opacity: .8; +} +textarea { + resize: vertical; +} +.field-collapse-toggle { + color: #999999; + margin-left: 10px !important; +} +style-compile { + display: none; +} +.tooltip-inner { + white-space: pre-wrap !important; +} +filter-bar .confirm { + padding: 8px 10px 4px; + background: #ecf0f1; + border-bottom: 1px solid; + border-bottom-color: #cccccc; +} +filter-bar .confirm ul { + margin-bottom: 0px; +} +filter-bar .confirm li { + display: inline-block; +} +filter-bar .confirm li:first-child { + font-weight: bold; + font-size: 1.2em; +} +filter-bar .confirm li button { + font-size: 0.9em; + padding: 2px 8px; +} +filter-bar .confirm .filter { + position: relative; + display: inline-block; + text-align: center; + min-width: calc(5*(1.414em + 13px)); + font-size: 12px; + background-color: #b4bcc2; + color: #333333; + margin-right: 4px; + margin-bottom: 4px; + max-width: 100%; + padding: 4px 8px; + border-radius: 12px; +} +filter-bar .bar { + padding: 6px 6px 4px 6px; + background: #ecf0f1; + border-bottom: 1px solid; + border-bottom-color: #cccccc; +} +filter-bar .bar-condensed { + padding: 2px 6px 0px 6px !important; + font-size: 0.9em; + background: #dde4e6; +} +filter-bar .bar .ace_editor { + height: 175px; + margin: 15px 0; +} +filter-bar .bar .filter-edit-alias { + margin-top: 15px; +} +filter-bar .bar .filter-link { + position: relative; + display: inline-block; + border: 4px solid transparent; + margin-bottom: 4px; +} +filter-bar .bar .filter-description { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +filter-bar .bar .filter { + position: relative; + display: inline-block; + text-align: center; + min-width: calc(5*(1.414em + 13px)); + font-size: 12px; + background-color: #569f76; + color: #ffffff; + margin-right: 4px; + margin-bottom: 4px; + max-width: 100%; + padding: 4px 8px; + border-radius: 12px; +} +filter-bar .bar .filter:hover > .filter-actions { + display: block; +} +filter-bar .bar .filter:hover > .filter-description { + opacity: 0.15; + background: transparent; + overflow: hidden; +} +filter-bar .bar .filter > .filter-actions { + font-size: 1.1em; + line-height: 1.4em; + position: absolute; + padding: 4px 8px; + top: 0; + left: 0; + width: 100%; + display: none; + text-align: center; + white-space: nowrap; +} +filter-bar .bar .filter > .filter-actions > * { + border-right: 1px solid rgba(255, 255, 255, 0.4); + padding-right: 0; + margin-right: 5px; +} +filter-bar .bar .filter > .filter-actions > *:last-child { + border-right: 0; + padding-right: 0; + margin-right: 0; +} +filter-bar .bar .filter > .filter-actions > * .unpinned { + opacity: 0.7; + filter: alpha(opacity=70); +} +filter-bar .bar .filter.negate { + background-color: #c6675d; +} +filter-bar .bar .filter a { + color: #ffffff; +} +filter-bar .bar .filter.disabled { + opacity: 0.6; + background-image: -webkit-repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.3) 10px, rgba(255, 255, 255, 0.3) 20px); + background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.3) 10px, rgba(255, 255, 255, 0.3) 20px); +} +filter-bar .bar .filter.disabled:hover span { + text-decoration: none; +} +.cell-hover { + background-color: white; +} +.cell-hover-show { + visibility: hidden; +} +.cell-hover:hover { + background-color: #ecf0f1; + cursor: cell; +} +.cell-hover:hover .cell-hover-show { + visibility: visible; +} +mark, +.mark { + background-color: #fce571; +} +fieldset { + margin: 15px; + padding: 15px; + border: 1px solid #ecf0f1; + border-radius: 4px; +} +[fixed-scroll] { + overflow-x: auto; + padding-bottom: 0px; +} +[fixed-scroll] + .fixed-scroll-scroller { + position: fixed; + bottom: 0px; + overflow-x: auto; + overflow-y: hidden; +} +.bs-callout-primary { + display: block; + margin: 20px 0; + padding: 15px 30px 15px 15px; + border-left: 5px solid #444444; + background-color: #b7b7b7; +} +.bs-callout-primary h1, +.bs-callout-primary h2, +.bs-callout-primary h3, +.bs-callout-primary h4, +.bs-callout-primary h5, +.bs-callout-primary h6 { + margin-top: 0; + color: #444444; +} +.bs-callout-primary p:last-child { + margin-bottom: 0; +} +.bs-callout-primary code, +.bs-callout-primary .highlight { + background-color: #fff; +} +.bs-callout-danger { + display: block; + margin: 20px 0; + padding: 15px 30px 15px 15px; + border-left: 5px solid #e74c3c; + background-color: #fbdedb; +} +.bs-callout-danger h1, +.bs-callout-danger h2, +.bs-callout-danger h3, +.bs-callout-danger h4, +.bs-callout-danger h5, +.bs-callout-danger h6 { + margin-top: 0; + color: #e74c3c; +} +.bs-callout-danger p:last-child { + margin-bottom: 0; +} +.bs-callout-danger code, +.bs-callout-danger .highlight { + background-color: #fff; +} +.bs-callout-warning { + display: block; + margin: 20px 0; + padding: 15px 30px 15px 15px; + border-left: 5px solid #f39c12; + background-color: #fad9a4; +} +.bs-callout-warning h1, +.bs-callout-warning h2, +.bs-callout-warning h3, +.bs-callout-warning h4, +.bs-callout-warning h5, +.bs-callout-warning h6 { + margin-top: 0; + color: #f39c12; +} +.bs-callout-warning p:last-child { + margin-bottom: 0; +} +.bs-callout-warning code, +.bs-callout-warning .highlight { + background-color: #fff; +} +.bs-callout-info { + display: block; + margin: 20px 0; + padding: 15px 30px 15px 15px; + border-left: 5px solid #1f6b7a; + background-color: #71c9db; +} +.bs-callout-info h1, +.bs-callout-info h2, +.bs-callout-info h3, +.bs-callout-info h4, +.bs-callout-info h5, +.bs-callout-info h6 { + margin-top: 0; + color: #1f6b7a; +} +.bs-callout-info p:last-child { + margin-bottom: 0; +} +.bs-callout-info code, +.bs-callout-info .highlight { + background-color: #fff; +} +.bs-callout-success { + display: block; + margin: 20px 0; + padding: 15px 30px 15px 15px; + border-left: 5px solid #31c471; + background-color: #baeed0; +} +.bs-callout-success h1, +.bs-callout-success h2, +.bs-callout-success h3, +.bs-callout-success h4, +.bs-callout-success h5, +.bs-callout-success h6 { + margin-top: 0; + color: #31c471; +} +.bs-callout-success p:last-child { + margin-bottom: 0; +} +.bs-callout-success code, +.bs-callout-success .highlight { + background-color: #fff; +} +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.btn-group-lg > .btn { + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; + border-radius: 6px; +} +.btn-group-sm > .btn { + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after, +.config:before, +.config:after { + content: " "; + display: table; +} +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after, +.config:after { + clear: both; +} +.config { + position: relative; + min-height: 45px; + margin-bottom: 0px; + border: 1px solid transparent; + border-width: 0; + box-shadow: inset 0 -10px 10px -12px #333333; + -moz-box-shadow: inset 0 -10px 10px -12px #333333; + -webkit-box-shadow: inset 0 -10px 10px -12px #333333; + background-color: #656a76; + border-color: #4d515b; + z-index: 1000; + border-width: 0 0 1px; + border-bottom: 1px solid; + border-bottom-color: #e6e6e6; +} +@media (min-width: 768px) { + .config { + border-radius: 4px; + } +} +.config-btn-link { + height: 45px; + margin: 0; + border-radius: 0; +} +@media (max-width: 768px) { + .config-btn-link { + width: 100%; + text-align: left; + } +} +.config-default .badge { + background-color: #ffffff; + color: #656a76; +} +.config-inverse .logo { + height: 45px; + width: 252px; + background-color: #3c3c3c; +} +.config-inverse .logo-small { + height: 45px; + width: 45px; + background-color: #3c3c3c; +} +.config-inverse .badge { + background-color: #ffffff; + color: #3c3c3c; +} +.config .navbar-nav > .active > a { + border-bottom-color: #ffffff; +} +.config .navbar-nav > .active > a:before { + content: ""; + display: inline-block; + position: absolute; + border: 7px solid transparent; + border-bottom-color: inherit; + top: 31px; + left: 0; + right: 0; + margin: 0 auto; + width: 0; + height: 0; +} +@media (max-width: 768px) { + .config .navbar-nav > .active > a:before { + display: none !important; + } +} +.config-brand { + cursor: default; + font-size: 1.8em; + background-color: #3c3c3c; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.config-nav { + font-size: 12px; +} +.config-toggle { + margin-top: 4px; +} +.config .navbar-brand { + color: #ecf0f1; +} +.config .navbar-brand:hover, +.config .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.config .navbar-text { + color: #ffffff; +} +.config .navbar-nav > li > a { + color: #ecf0f1; +} +.config .navbar-nav > li > a:hover, +.config .navbar-nav > li > a:focus { + color: #ffffff; + background-color: transparent; +} +.config .navbar-nav > .active > a, +.config .navbar-nav > .active > a:hover, +.config .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #4d515b; +} +.config .navbar-nav > .disabled > a, +.config .navbar-nav > .disabled > a:hover, +.config .navbar-nav > .disabled > a:focus { + color: #cccccc; + background-color: transparent; +} +.config .navbar-toggle { + border-color: #4d515b; +} +.config .navbar-toggle:hover, +.config .navbar-toggle:focus { + background-color: #4d515b; +} +.config .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.config .navbar-collapse, +.config .navbar-form { + border-color: #4d515b; +} +.config .navbar-nav > .open > a, +.config .navbar-nav > .open > a:hover, +.config .navbar-nav > .open > a:focus { + background-color: #4d515b; + color: #ffffff; +} +@media (max-width: 767px) { + .config .navbar-nav .open .dropdown-menu > li > a { + color: #ecf0f1; + } + .config .navbar-nav .open .dropdown-menu > li > a:hover, + .config .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: transparent; + } + .config .navbar-nav .open .dropdown-menu > .active > a, + .config .navbar-nav .open .dropdown-menu > .active > a:hover, + .config .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #4d515b; + } + .config .navbar-nav .open .dropdown-menu > .disabled > a, + .config .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .config .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #cccccc; + background-color: transparent; + } +} +.config .navbar-link { + color: #ecf0f1; +} +.config .navbar-link:hover { + color: #ffffff; +} +.config .btn-link { + color: #ecf0f1; +} +.config .btn-link:hover, +.config .btn-link:focus { + color: #ffffff; +} +.config .btn-link[disabled]:hover, +fieldset[disabled] .config .btn-link:hover, +.config .btn-link[disabled]:focus, +fieldset[disabled] .config .btn-link:focus { + color: #cccccc; +} +@media (min-width: 768px) { + .config { + border-radius: 0; + } +} +.config .config-close { + width: 100%; + background-color: #ecf0f1; + border-radius: 0; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); + text-align: center; +} +.config .container-fluid { + padding: 10px 10px; + background-color: #ffffff; +} +.control-group { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: stretch; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + padding: 5px 15px; + /*** + * components + ***/ +} +.control-group > * { + padding-right: 15px; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +.control-group > *:last-child { + padding-right: 0; +} +.control-group button { + padding: 5px 15px; + font-size: 13px; + color: #1f6b7a; + background-color: inherit; +} +.control-group button:hover { + color: #ecf0f1; + background-color: #5e5e5e; +} +.control-group button .active, +.control-group button:active, +.control-group button:focus { + color: #b4bcc2; + background-color: #5e5e5e; +} +.control-group button[disabled] { + color: #b4bcc2; + background-color: transparent; +} +.control-group button:focus { + outline-offset: -4px; +} +.control-group .button-group, +.control-group .inline-form .input-group { + margin-bottom: 0px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +.control-group .button-group > *, +.control-group .inline-form .input-group > * { + border-radius: 0; +} +.control-group .button-group > :first-child, +.control-group .inline-form .input-group > :first-child { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.control-group .button-group > :last-child, +.control-group .inline-form .input-group > :last-child { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.control-group .inline-form { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +.control-group .inline-form > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +.control-group .inline-form > .typeahead { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} +.control-group .inline-form > .typeahead > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +.control-group .inline-form > .typeahead > .input-group { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 1; + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; +} +.control-group .inline-form > .typeahead > .input-group > * { + float: none; + height: auto; + width: auto; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +.control-group .inline-form > .typeahead > .input-group input[type="text"] { + -webkit-box-flex: 1; + -webkit-flex: 1 1 100%; + -ms-flex: 1 1 100%; + flex: 1 1 100%; +} +.control-group > .fill { + -webkit-box-flex: 1; + -webkit-flex: 1 1 1%; + -ms-flex: 1 1 1%; + flex: 1 1 1%; +} +.nav-controls .column { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} +.tab-dashboard.theme-dark { + color: #cecece; + background-color: #1e1b1e; +} +.tab-dashboard.theme-dark a { + color: #b7e2ea; +} +.tab-dashboard.theme-dark a:hover, +.tab-dashboard.theme-dark a:focus { + color: #def2f6; +} +.tab-dashboard.theme-dark .form-control { + color: #cecece; + background-color: #444444; + border-color: #666666; +} +.tab-dashboard.theme-dark .form-control[disabled], +.tab-dashboard.theme-dark .form-control[readonly], +fieldset[disabled] .tab-dashboard.theme-dark .form-control { + background-color: #333333; +} +.tab-dashboard.theme-dark .panel { + background-color: #343434; +} +.tab-dashboard.theme-dark .table > thead > tr > th, +.tab-dashboard.theme-dark .table > tbody > tr > th, +.tab-dashboard.theme-dark .table > tfoot > tr > th, +.tab-dashboard.theme-dark .table > thead > tr > td, +.tab-dashboard.theme-dark .table > tbody > tr > td, +.tab-dashboard.theme-dark .table > tfoot > tr > td { + border-top-color: #5c5c5c; +} +.tab-dashboard.theme-dark .table > thead > tr > th { + border-bottom-color: #5c5c5c; +} +.tab-dashboard.theme-dark .table > tbody + tbody { + border-top-color: #5c5c5c; +} +.tab-dashboard.theme-dark .table .table { + background-color: transparent; +} +.tab-dashboard.theme-dark table th i.fa-sort { + color: #666666; +} +.tab-dashboard.theme-dark table th i.fa-sort-asc, +.tab-dashboard.theme-dark table th i.fa-sort-down { + color: #bbbbbb; +} +.tab-dashboard.theme-dark table th i.fa-sort-desc, +.tab-dashboard.theme-dark table th i.fa-sort-up { + color: #bbbbbb; +} +.tab-dashboard.theme-dark .btn:hover, +.tab-dashboard.theme-dark .btn:focus, +.tab-dashboard.theme-dark .btn.focus { + color: #ffffff; +} +.tab-dashboard.theme-dark .btn .findme { + font-weight: bold; +} +.tab-dashboard.theme-dark .btn-default { + color: #ffffff; + background-color: #777777; + border-color: #777777; +} +.tab-dashboard.theme-dark .btn-default:focus, +.tab-dashboard.theme-dark .btn-default.focus { + color: #ffffff; + background-color: #5e5e5e; + border-color: #373737; +} +.tab-dashboard.theme-dark .btn-default:hover { + color: #ffffff; + background-color: #5e5e5e; + border-color: #585858; +} +.tab-dashboard.theme-dark .btn-default:active, +.tab-dashboard.theme-dark .btn-default.active, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-default { + color: #ffffff; + background-color: #5e5e5e; + border-color: #585858; +} +.tab-dashboard.theme-dark .btn-default:active:hover, +.tab-dashboard.theme-dark .btn-default.active:hover, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-default:hover, +.tab-dashboard.theme-dark .btn-default:active:focus, +.tab-dashboard.theme-dark .btn-default.active:focus, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-default:focus, +.tab-dashboard.theme-dark .btn-default:active.focus, +.tab-dashboard.theme-dark .btn-default.active.focus, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-default.focus { + color: #ffffff; + background-color: #4c4c4c; + border-color: #373737; +} +.tab-dashboard.theme-dark .btn-default:active, +.tab-dashboard.theme-dark .btn-default.active, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-default { + background-image: none; +} +.tab-dashboard.theme-dark .btn-default.disabled, +.tab-dashboard.theme-dark .btn-default[disabled], +fieldset[disabled] .tab-dashboard.theme-dark .btn-default, +.tab-dashboard.theme-dark .btn-default.disabled:hover, +.tab-dashboard.theme-dark .btn-default[disabled]:hover, +fieldset[disabled] .tab-dashboard.theme-dark .btn-default:hover, +.tab-dashboard.theme-dark .btn-default.disabled:focus, +.tab-dashboard.theme-dark .btn-default[disabled]:focus, +fieldset[disabled] .tab-dashboard.theme-dark .btn-default:focus, +.tab-dashboard.theme-dark .btn-default.disabled.focus, +.tab-dashboard.theme-dark .btn-default[disabled].focus, +fieldset[disabled] .tab-dashboard.theme-dark .btn-default.focus, +.tab-dashboard.theme-dark .btn-default.disabled:active, +.tab-dashboard.theme-dark .btn-default[disabled]:active, +fieldset[disabled] .tab-dashboard.theme-dark .btn-default:active, +.tab-dashboard.theme-dark .btn-default.disabled.active, +.tab-dashboard.theme-dark .btn-default[disabled].active, +fieldset[disabled] .tab-dashboard.theme-dark .btn-default.active { + background-color: #777777; + border-color: #777777; +} +.tab-dashboard.theme-dark .btn-default .badge { + color: #777777; + background-color: #ffffff; +} +.tab-dashboard.theme-dark .btn-primary { + color: #ffffff; + background-color: #777777; + border-color: #777777; +} +.tab-dashboard.theme-dark .btn-primary:focus, +.tab-dashboard.theme-dark .btn-primary.focus { + color: #ffffff; + background-color: #5e5e5e; + border-color: #373737; +} +.tab-dashboard.theme-dark .btn-primary:hover { + color: #ffffff; + background-color: #5e5e5e; + border-color: #585858; +} +.tab-dashboard.theme-dark .btn-primary:active, +.tab-dashboard.theme-dark .btn-primary.active, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-primary { + color: #ffffff; + background-color: #5e5e5e; + border-color: #585858; +} +.tab-dashboard.theme-dark .btn-primary:active:hover, +.tab-dashboard.theme-dark .btn-primary.active:hover, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-primary:hover, +.tab-dashboard.theme-dark .btn-primary:active:focus, +.tab-dashboard.theme-dark .btn-primary.active:focus, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-primary:focus, +.tab-dashboard.theme-dark .btn-primary:active.focus, +.tab-dashboard.theme-dark .btn-primary.active.focus, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-primary.focus { + color: #ffffff; + background-color: #4c4c4c; + border-color: #373737; +} +.tab-dashboard.theme-dark .btn-primary:active, +.tab-dashboard.theme-dark .btn-primary.active, +.open > .dropdown-toggle.tab-dashboard.theme-dark .btn-primary { + background-image: none; +} +.tab-dashboard.theme-dark .btn-primary.disabled, +.tab-dashboard.theme-dark .btn-primary[disabled], +fieldset[disabled] .tab-dashboard.theme-dark .btn-primary, +.tab-dashboard.theme-dark .btn-primary.disabled:hover, +.tab-dashboard.theme-dark .btn-primary[disabled]:hover, +fieldset[disabled] .tab-dashboard.theme-dark .btn-primary:hover, +.tab-dashboard.theme-dark .btn-primary.disabled:focus, +.tab-dashboard.theme-dark .btn-primary[disabled]:focus, +fieldset[disabled] .tab-dashboard.theme-dark .btn-primary:focus, +.tab-dashboard.theme-dark .btn-primary.disabled.focus, +.tab-dashboard.theme-dark .btn-primary[disabled].focus, +fieldset[disabled] .tab-dashboard.theme-dark .btn-primary.focus, +.tab-dashboard.theme-dark .btn-primary.disabled:active, +.tab-dashboard.theme-dark .btn-primary[disabled]:active, +fieldset[disabled] .tab-dashboard.theme-dark .btn-primary:active, +.tab-dashboard.theme-dark .btn-primary.disabled.active, +.tab-dashboard.theme-dark .btn-primary[disabled].active, +fieldset[disabled] .tab-dashboard.theme-dark .btn-primary.active { + background-color: #777777; + border-color: #777777; +} +.tab-dashboard.theme-dark .btn-primary .badge { + color: #777777; + background-color: #ffffff; +} +.tab-dashboard.theme-dark .list-group-item { + background-color: #333333; + border-color: #777777; +} +.tab-dashboard.theme-dark a.list-group-item, +.tab-dashboard.theme-dark button.list-group-item { + color: #555555; +} +.tab-dashboard.theme-dark a.list-group-item .list-group-item-heading, +.tab-dashboard.theme-dark button.list-group-item .list-group-item-heading { + color: #333333; +} +.tab-dashboard.theme-dark a.list-group-item:hover, +.tab-dashboard.theme-dark button.list-group-item:hover, +.tab-dashboard.theme-dark a.list-group-item:focus, +.tab-dashboard.theme-dark button.list-group-item:focus { + color: #555555; + background-color: #eeeeee; +} +.tab-dashboard.theme-dark .panel > .panel-body + .table, +.tab-dashboard.theme-dark .panel > .panel-body + .table-responsive, +.tab-dashboard.theme-dark .panel > .table + .panel-body, +.tab-dashboard.theme-dark .panel > .table-responsive + .panel-body { + border-top-color: #5c5c5c; +} +.tab-dashboard.theme-dark .panel-group .panel-heading + .panel-collapse > .panel-body, +.tab-dashboard.theme-dark .panel-group .panel-heading + .panel-collapse > .list-group { + border-top-color: #dddddd; +} +.tab-dashboard.theme-dark .panel-group .panel-footer { + border-top: 0; +} +.tab-dashboard.theme-dark .panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #dddddd; +} +.tab-dashboard.theme-dark .panel-default { + border-color: #5c5c5c; +} +.tab-dashboard.theme-dark .panel-default > .panel-heading { + color: #eeeeee; + background-color: #272727; + border-color: #5c5c5c; +} +.tab-dashboard.theme-dark .panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #5c5c5c; +} +.tab-dashboard.theme-dark .panel-default > .panel-heading .badge { + color: #272727; + background-color: #eeeeee; +} +.tab-dashboard.theme-dark .panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #5c5c5c; +} +.tab-dashboard.theme-dark .nav > li > a:hover, +.tab-dashboard.theme-dark .nav > li > a:focus { + background-color: #666666; +} +.tab-dashboard.theme-dark .nav-tabs { + border-bottom: 1px solid #666666; +} +.tab-dashboard.theme-dark .nav-tabs > li > a:hover { + border-color: #777777 #777777 #666666; +} +.tab-dashboard.theme-dark .nav-tabs > li.active > a, +.tab-dashboard.theme-dark .nav-tabs > li.active > a:hover, +.tab-dashboard.theme-dark .nav-tabs > li.active > a:focus { + color: #eeeeee; + background-color: #333333; + border-color: #777777; +} +.tab-dashboard.theme-dark navbar { + color: #ffffff; + background-color: #333333; + border-color: #1a1a1a; +} +.tab-dashboard.theme-dark saved-object-finder .list-group-item a { + color: #cecece !important; +} +.tab-dashboard.theme-dark saved-object-finder .list-group-item a i { + color: #b5b5b5 !important; +} +.tab-dashboard.theme-dark saved-object-finder .finder-options > li.active { + background-color: #999999; + color: #555555; +} +.tab-dashboard.theme-dark saved-object-finder .finder-options > li.active a { + color: #555555; +} +.tab-dashboard.theme-dark .cell-hover { + background-color: transparent; +} +.tab-dashboard.theme-dark .cell-hover:hover { + background-color: #666666; +} +.tab-dashboard.theme-dark .spinner > div { + background-color: #ffffff; +} +.tab-dashboard.theme-dark .agg-table-paginated tr:hover td { + background-color: #707070; +} +.tab-dashboard.theme-dark .agg-table-paginated .cell-hover:hover { + background-color: #666666; +} +.tab-dashboard.theme-dark visualize-spy .visualize-show-spy { + border-top-color: #5c5c5c; +} +.tab-dashboard.theme-dark visualize-spy .visualize-show-spy-tab { + border-color: #5c5c5c; + background: #343434; + color: #888888; +} +.tab-dashboard.theme-dark visualize-spy .visualize-show-spy-tab:hover { + background-color: #666666; + color: #333333; +} +.tab-dashboard.theme-dark .axis line, +.tab-dashboard.theme-dark .axis path { + stroke: #888888; +} +.tab-dashboard.theme-dark .tick text { + fill: #aaaaaa; +} +.tab-dashboard.theme-dark .brush .extent { + stroke: #ffffff; +} +.tab-dashboard.theme-dark .endzone { + fill: #ffffff; +} +.tab-dashboard.theme-dark .legend-col-wrapper .legend-toggle { + background-color: #777777; +} +.tab-dashboard.theme-dark .legend-col-wrapper .legend-toggle:hover { + color: #cecece; + background-color: #6a6a6a; +} +.tab-dashboard.theme-dark .legend-col-wrapper .legend-ul { + border-left-color: #777777; + color: #aaaaaa; +} +.tab-dashboard.theme-dark .legend-value-title { + padding: 3px; +} +.tab-dashboard.theme-dark .legend-value-title:hover { + background-color: #6a6a6a; +} +.tab-dashboard.theme-dark .legend-value-full { + background-color: #6a6a6a; +} +.tab-dashboard.theme-dark .legend-value-details { + border-bottom: 1px solid #777777; +} +.tab-dashboard.theme-dark .legend-value-details .filter-button { + background-color: #777777; +} +.tab-dashboard.theme-dark .legend-value-details .filter-button:hover { + background-color: #6a6a6a; +} +.tab-dashboard.theme-dark .y-axis-title text, +.tab-dashboard.theme-dark .x-axis-title text { + fill: #aaaaaa; +} +.tab-dashboard.theme-dark .chart-title text { + fill: #aaaaaa; +} +.tab-dashboard.theme-dark .tilemap { + border-color: #dddddd; +} +.tab-dashboard.theme-dark .tilemap-legend { + background: #333333; + color: #cccccc; +} +.tab-dashboard.theme-dark .tilemap-legend i { + border-color: #999999; + background: #aaaaaa; +} +.tab-dashboard.theme-dark .tilemap-info { + background: #ffffff; + background: rgba(255, 255, 255, 0.92); +} +.tab-dashboard.theme-dark .tilemap-info h2 { + color: #444444; +} +.tab-dashboard.theme-dark .leaflet-control-fit { + background: #ffffff; + outline: 1px #000000; +} +.tab-dashboard.theme-dark .leaflet-container { + background: #333333 !important; +} +.tab-dashboard.theme-dark .leaflet-popup-content-wrapper { + background: rgba(68, 68, 68, 0.93) !important; + color: #eeeeee !important; +} +.tab-dashboard.theme-dark .leaflet-popup-content table thead tr { + border-bottom-color: #999999; +} +.tab-dashboard.theme-dark .leaflet-popup-content table tbody tr { + border-top-color: #999999; +} +.tab-dashboard.theme-dark img.leaflet-tile { + -webkit-filter: invert(1) brightness(1.75) grayscale(1) contrast(1); + filter: invert(1) brightness(1.75) grayscale(1) contrast(1); +} +.tab-dashboard.theme-dark .leaflet-control-attribution { + background-color: rgba(51, 51, 51, 0.8) !important; + color: #cccccc !important; +} +.tab-dashboard.theme-dark .leaflet-left .leaflet-control a, +.tab-dashboard.theme-dark .leaflet-left .leaflet-control a:hover { + color: #000000; +} +.tab-dashboard.theme-dark .leaflet-left .leaflet-draw-actions a { + background-color: #bbbbbb; +} +.tab-dashboard.theme-dark filter-bar .confirm { + background: #333333; + border-bottom-color: #000000; +} +.tab-dashboard.theme-dark filter-bar .confirm .filter { + background-color: #cccccc; + color: #333333; +} +.tab-dashboard.theme-dark filter-bar .bar { + background: #333333; + border-bottom-color: #000000; +} +.tab-dashboard.theme-dark filter-bar .bar-condensed { + background: #262626; +} +.tab-dashboard.theme-dark filter-bar .bar .filter { + background-color: #569f76; + color: #ffffff; +} +.tab-dashboard.theme-dark filter-bar .bar .filter.negate { + background-color: #c6675d; +} +.tab-dashboard.theme-dark filter-bar .bar .filter a { + color: #ffffff; +} +.tab-dashboard.theme-dark .config { + border-bottom-color: #444444; +} +.tab-dashboard.theme-dark .config .config-close { + background-color: #444444; +} +.tab-dashboard.theme-dark .config .container-fluid { + background-color: #333333; +} +.tab-dashboard.theme-dark .list-group-menu.select-mode a { + color: #b7e2ea; +} +.tab-dashboard.theme-dark .list-group-menu .list-group-menu-item { + color: #cecece; +} +.tab-dashboard.theme-dark .list-group-menu .list-group-menu-item.active { + background-color: #444444; +} +.tab-dashboard.theme-dark .list-group-menu .list-group-menu-item:hover { + background-color: #444444; +} +.tab-dashboard.theme-dark .list-group-menu .list-group-menu-item li { + color: #cecece; +} +.tab-dashboard.theme-dark select { + color: #cecece; + background-color: #444444; +} +.tab-dashboard.theme-dark paginate paginate-controls .pagination-other-pages-list > li.active a { + color: #999999; +} +.tab-dashboard.theme-dark .start-screen { + background-color: #1e1b1e; +} +.tab-dashboard.theme-dark .gridster { + background-color: #1e1b1e; +} +.tab-dashboard.theme-dark .gridster dashboard-panel { + background: #343434; + color: #cecece; +} +.tab-dashboard.theme-dark .gridster dashboard-panel .panel .panel-heading a { + color: #a6a6a6; +} +.tab-dashboard.theme-dark .gridster dashboard-panel .panel .panel-heading a:hover { + color: #a6a6a6; +} +.tab-dashboard.theme-dark .gridster dashboard-panel .panel .panel-heading span.panel-title { + color: #a6a6a6; +} +.tab-dashboard.theme-dark .gridster dashboard-panel .panel .panel-heading i { + color: #a6a6a6; + opacity: 1; +} +.tab-dashboard.theme-dark .gridster dashboard-panel .panel .load-error .fa-exclamation-triangle { + color: #e74c3c; +} +.hintbox { + padding: 10px 12px; + border-radius: 5px; + margin-bottom: 10px; + background-color: #ecf0f1; +} +.hintbox a { + color: #1f6b7a !important; +} +.hintbox a:hover { + color: #444444 !important; +} +.hintbox pre { + background-color: #ffffff; +} +.hintbox-label, +.hintbox-label[ng-click] { + cursor: help; +} +.hintbox ul, +.hintbox ol { + padding-left: 25px; +} +.hintbox > * { + margin: 0; +} +.hintbox > * + * { + margin-top: 10px; +} +.hintbox .table-bordered { + border: 1px solid #bfc9ca; +} +.hintbox .table-bordered > thead > tr > th, +.hintbox .table-bordered > tbody > tr > th, +.hintbox .table-bordered > tfoot > tr > th, +.hintbox .table-bordered > thead > tr > td, +.hintbox .table-bordered > tbody > tr > td, +.hintbox .table-bordered > tfoot > tr > td { + border: 1px solid #bfc9ca; +} +.hintbox .table-bordered > thead > tr > th, +.hintbox .table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +i.input-error { + position: absolute; + margin-left: -25px; + color: #e74c3c; + margin-top: 10px; + z-index: 5; +} +select { + color: #444444; + background-color: #ffffff; +} +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.btn-group-lg > .btn { + padding: 18px 27px; + font-size: 17px; + line-height: 1.33; + border-radius: 6px; +} +.btn-group-sm > .btn { + padding: 6px 9px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.list-group-menu.select-mode a { + outline: none; + color: #1f6b7a; +} +.list-group-menu .list-group-menu-item { + list-style: none; + color: #1f6b7a; +} +.list-group-menu .list-group-menu-item.active { + font-weight: bold; + background-color: #ecf0f1; +} +.list-group-menu .list-group-menu-item:hover { + background-color: #ecf0f1; +} +.list-group-menu .list-group-menu-item li { + list-style: none; + color: #1f6b7a; +} +.control-group { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: stretch; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + padding: 5px 15px; + /*** + * components + ***/ +} +.control-group > * { + padding-right: 15px; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +.control-group > *:last-child { + padding-right: 0; +} +.control-group button { + padding: 5px 15px; + font-size: 13px; + color: #1f6b7a; + background-color: inherit; +} +.control-group button:hover { + color: #ecf0f1; + background-color: #5e5e5e; +} +.control-group button .active, +.control-group button:active, +.control-group button:focus { + color: #b4bcc2; + background-color: #5e5e5e; +} +.control-group button[disabled] { + color: #b4bcc2; + background-color: transparent; +} +.control-group button:focus { + outline-offset: -4px; +} +.control-group .button-group, +.control-group .inline-form .input-group { + margin-bottom: 0px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +.control-group .button-group > *, +.control-group .inline-form .input-group > * { + border-radius: 0; +} +.control-group .button-group > :first-child, +.control-group .inline-form .input-group > :first-child { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.control-group .button-group > :last-child, +.control-group .inline-form .input-group > :last-child { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.control-group .inline-form { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +.control-group .inline-form > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +.control-group .inline-form > .typeahead { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} +.control-group .inline-form > .typeahead > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +.control-group .inline-form > .typeahead > .input-group { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 1; + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; +} +.control-group .inline-form > .typeahead > .input-group > * { + float: none; + height: auto; + width: auto; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +.control-group .inline-form > .typeahead > .input-group input[type="text"] { + -webkit-box-flex: 1; + -webkit-flex: 1 1 100%; + -ms-flex: 1 1 100%; + flex: 1 1 100%; +} +.control-group > .fill { + -webkit-box-flex: 1; + -webkit-flex: 1 1 1%; + -ms-flex: 1 1 1%; + flex: 1 1 1%; +} +.nav-controls .column { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} +navbar { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: stretch; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + /*** + * components + ***/ + max-height: 340px; + margin-bottom: 0px; + padding: 5px 15px; + color: #ffffff; + background-color: #656a76; + border-style: solid; + border-color: #4d515b; + border-width: 0 0 1px; + z-index: 1000; + /*** + * components + ***/ + /*** + * responsive modifications + ***/ +} +navbar > * { + padding-right: 15px; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +navbar > *:last-child { + padding-right: 0; +} +navbar button { + padding: 5px 15px; + font-size: 13px; + color: #1f6b7a; + background-color: inherit; +} +navbar button:hover { + color: #ecf0f1; + background-color: #5e5e5e; +} +navbar button .active, +navbar button:active, +navbar button:focus { + color: #b4bcc2; + background-color: #5e5e5e; +} +navbar button[disabled] { + color: #b4bcc2; + background-color: transparent; +} +navbar button:focus { + outline-offset: -4px; +} +navbar .button-group, +navbar .inline-form .input-group { + margin-bottom: 0px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +navbar .button-group > *, +navbar .inline-form .input-group > * { + border-radius: 0; +} +navbar .button-group > :first-child, +navbar .inline-form .input-group > :first-child { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +navbar .button-group > :last-child, +navbar .inline-form .input-group > :last-child { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +navbar .inline-form { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +navbar .inline-form > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +navbar .inline-form > .typeahead { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} +navbar .inline-form > .typeahead > * { + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} +navbar .inline-form > .typeahead > .input-group { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 1; + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; +} +navbar .inline-form > .typeahead > .input-group > * { + float: none; + height: auto; + width: auto; + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +navbar .inline-form > .typeahead > .input-group input[type="text"] { + -webkit-box-flex: 1; + -webkit-flex: 1 1 100%; + -ms-flex: 1 1 100%; + flex: 1 1 100%; +} +navbar > .fill { + -webkit-box-flex: 1; + -webkit-flex: 1 1 1%; + -ms-flex: 1 1 1%; + flex: 1 1 1%; +} +navbar > * { + padding-right: 15px; +} +navbar > .name { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + font-size: 17px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +navbar button { + color: #ecf0f1; + background-color: transparent; +} +navbar button:hover { + color: #ffffff; + background-color: transparent; +} +navbar button:focus { + color: #ecf0f1; + background-color: transparent; +} +navbar button:active, +navbar button.active { + color: #ffffff; + background-color: #4d515b; +} +navbar button[disabled] { + color: #cccccc; + background-color: transparent; +} +navbar .inline-form .input-group button { + color: #444444; + background-color: #ecf0f1; + border: 2px solid; + border-left: 0; + border-color: #ecf0f1; +} +@media (min-width: 992px) { + navbar > .name { + max-width: 500px; + } +} +@media (max-width: 992px) { + navbar > .fill { + -webkit-box-flex: 1; + -webkit-flex: 1 1 992px; + -ms-flex: 1 1 992px; + flex: 1 1 992px; + } +} +@media (max-width: 768px) { + navbar > .name { + max-width: 100%; + } +} +.toaster-container { + visibility: visible; + width: 100%; +} +.toaster-container .toaster { + margin: 0; + padding: 0; + list-style: none; +} +.toaster-container .alert { + padding: 0 15px; + margin: 0; + border-radius: 0; + border: 0px; +} +.toaster-container .toast { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; +} +.toaster-container .toast > * { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +.toaster-container .toast > *:not(:last-child) { + margin-right: 4px; +} +.toaster-container .toast-message { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + line-height: normal; +} +.toaster-container .toast-stack { + padding-bottom: 10px; +} +.toaster-container .toast-stack pre { + display: inline-block; + width: 100%; + margin: 10px 0; + word-break: normal; + word-wrap: normal; + white-space: pre-wrap; +} +.toaster-container .toast-controls { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +.toaster-container .toast-controls button { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + border: 0; + border-radius: 0; + padding: 10px 15px; +} +.toaster-container .alert-success .badge { + background: #185e36; +} +.toaster-container .alert-info .badge { + background: #051214; +} +.toaster-container .alert-warning .badge { + background: #7f5006; +} +.toaster-container .alert-danger .badge { + background: #921e12; +} +paginate { + display: block; +} +paginate paginate-controls { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + padding: 5px 5px 10px; + text-align: center; +} +paginate paginate-controls .pagination-other-pages { + -webkit-box-flex: 1; + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} +paginate paginate-controls .pagination-other-pages-list { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 0; + margin: 0; + list-style: none; +} +paginate paginate-controls .pagination-other-pages-list > li { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +paginate paginate-controls .pagination-other-pages-list > li a { + text-decoration: none; +} +paginate paginate-controls .pagination-other-pages-list > li a:hover { + text-decoration: underline; +} +paginate paginate-controls .pagination-other-pages-list > li.active a { + text-decoration: none !important; + font-weight: bold; + color: #444444; +} +paginate paginate-controls .pagination-size { + -webkit-box-flex: 0; + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} +paginate paginate-controls .pagination-size input[type=number] { + width: 3em; +} +.sidebar-container { + padding-left: 0px !important; + padding-right: 0px !important; + background-color: #ecf0f1; + border-right-color: transparent; + border-bottom-color: transparent; +} +.sidebar-container .sidebar-well { + background-color: #dde4e6; +} +.sidebar-container .sidebar-list ul { + list-style: none; + margin-bottom: 0px; +} +.sidebar-container .sidebar-list-header { + padding-left: 10px; + padding-right: 10px; + color: #444444; + border: 1px solid; + border-color: transparent; +} +.sidebar-container .sidebar-list .sidebar-item { + border-top-color: transparent; + font-size: 12px; +} +.sidebar-container .sidebar-list .sidebar-item a:not(.sidebar-item-button) { + color: #444444; +} +.sidebar-container .sidebar-list .sidebar-item a:not(.sidebar-item-button):hover { + color: #444444; + text-decoration: none; +} +.sidebar-container .sidebar-list .sidebar-item-title, +.sidebar-container .sidebar-list .sidebar-item-text, +.sidebar-container .sidebar-list .sidebar-item-button { + margin: 0; + padding: 5px 10px; + text-align: center; + width: 100%; + border: none; + border-radius: 0; +} +.sidebar-container .sidebar-list .sidebar-item-title { + text-align: left; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.sidebar-container .sidebar-list .sidebar-item-title.full-title { + white-space: normal; +} +.sidebar-container .sidebar-list .sidebar-item-title:hover, +.sidebar-container .sidebar-list .sidebar-item-title:hover .text-muted { + color: #444444; + background-color: #cfd9db; +} +.sidebar-container .sidebar-list .sidebar-item-text { + background: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item-button { + font-size: inherit; + display: block; +} +.sidebar-container .sidebar-list .sidebar-item-button[disabled] { + opacity: 0.65; + cursor: default; +} +.sidebar-container .sidebar-list .sidebar-item-button.primary { + background-color: #444444; + color: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item-button.info { + background-color: #1f6b7a; + color: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item-button.success { + background-color: #31c471; + color: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item-button.warning { + background-color: #f39c12; + color: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item-button.danger { + background-color: #e74c3c; + color: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item-button.default { + color: #ffffff; + background-color: #95a5a6; + border-color: #95a5a6; +} +.sidebar-container .sidebar-list .sidebar-item-button.default:focus, +.sidebar-container .sidebar-list .sidebar-item-button.default.focus { + color: #ffffff; + background-color: #798d8f; + border-color: #566566; +} +.sidebar-container .sidebar-list .sidebar-item-button.default:hover { + color: #ffffff; + background-color: #798d8f; + border-color: #74898a; +} +.sidebar-container .sidebar-list .sidebar-item-button.default:active, +.sidebar-container .sidebar-list .sidebar-item-button.default.active, +.open > .dropdown-toggle.sidebar-container .sidebar-list .sidebar-item-button.default { + color: #ffffff; + background-color: #798d8f; + border-color: #74898a; +} +.sidebar-container .sidebar-list .sidebar-item-button.default:active:hover, +.sidebar-container .sidebar-list .sidebar-item-button.default.active:hover, +.open > .dropdown-toggle.sidebar-container .sidebar-list .sidebar-item-button.default:hover, +.sidebar-container .sidebar-list .sidebar-item-button.default:active:focus, +.sidebar-container .sidebar-list .sidebar-item-button.default.active:focus, +.open > .dropdown-toggle.sidebar-container .sidebar-list .sidebar-item-button.default:focus, +.sidebar-container .sidebar-list .sidebar-item-button.default:active.focus, +.sidebar-container .sidebar-list .sidebar-item-button.default.active.focus, +.open > .dropdown-toggle.sidebar-container .sidebar-list .sidebar-item-button.default.focus { + color: #ffffff; + background-color: #687b7c; + border-color: #566566; +} +.sidebar-container .sidebar-list .sidebar-item-button.default:active, +.sidebar-container .sidebar-list .sidebar-item-button.default.active, +.open > .dropdown-toggle.sidebar-container .sidebar-list .sidebar-item-button.default { + background-image: none; +} +.sidebar-container .sidebar-list .sidebar-item-button.default.disabled, +.sidebar-container .sidebar-list .sidebar-item-button.default[disabled], +fieldset[disabled] .sidebar-container .sidebar-list .sidebar-item-button.default, +.sidebar-container .sidebar-list .sidebar-item-button.default.disabled:hover, +.sidebar-container .sidebar-list .sidebar-item-button.default[disabled]:hover, +fieldset[disabled] .sidebar-container .sidebar-list .sidebar-item-button.default:hover, +.sidebar-container .sidebar-list .sidebar-item-button.default.disabled:focus, +.sidebar-container .sidebar-list .sidebar-item-button.default[disabled]:focus, +fieldset[disabled] .sidebar-container .sidebar-list .sidebar-item-button.default:focus, +.sidebar-container .sidebar-list .sidebar-item-button.default.disabled.focus, +.sidebar-container .sidebar-list .sidebar-item-button.default[disabled].focus, +fieldset[disabled] .sidebar-container .sidebar-list .sidebar-item-button.default.focus, +.sidebar-container .sidebar-list .sidebar-item-button.default.disabled:active, +.sidebar-container .sidebar-list .sidebar-item-button.default[disabled]:active, +fieldset[disabled] .sidebar-container .sidebar-list .sidebar-item-button.default:active, +.sidebar-container .sidebar-list .sidebar-item-button.default.disabled.active, +.sidebar-container .sidebar-list .sidebar-item-button.default[disabled].active, +fieldset[disabled] .sidebar-container .sidebar-list .sidebar-item-button.default.active { + background-color: #95a5a6; + border-color: #95a5a6; +} +.sidebar-container .sidebar-list .sidebar-item-button.default .badge { + color: #95a5a6; + background-color: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item .active { + background-color: #444444 !important; + color: #ffffff; +} +.sidebar-container .sidebar-list .sidebar-item .active:hover, +.sidebar-container .sidebar-list .sidebar-item .active:hover .text-muted { + color: #ffffff; + background-color: #444444; +} +.sidebar-container .index-pattern { + background-color: #444444; + font-weight: bold; + padding: 5px 10px; + color: #ffffff; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; +} +.sidebar-container .index-pattern > * { + -webkit-box-flex: 0; + -webkit-flex: 0 1 auto; + -ms-flex: 0 1 auto; + flex: 0 1 auto; +} +.sidebar-container .index-pattern-selection .sidebar-item-title { + background-color: #ffffff; +} +.spinner { + margin: 0px auto 0; + white-space: nowrap; + text-align: center; + display: inline; +} +.spinner > div { + width: 10px; + height: 10px; + background-color: #444444; + border-radius: 100%; + display: inline-block; + -webkit-animation: bouncedelay 1s infinite ease-in-out; + animation: bouncedelay 1s infinite ease-in-out; + /* Prevent first frame from flickering when animation starts */ + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.navbar .spinner > div { + background-color: #ecf0f1; +} +.spinner.large > div { + width: 24px; + height: 24px; +} +.spinner .bounce1 { + -webkit-animation-delay: -0.32s; + animation-delay: -0.32s; +} +.spinner .bounce2 { + -webkit-animation-delay: -0.16s; + animation-delay: -0.16s; +} +@-webkit-keyframes bouncedelay { + 0%, + 80%, + 100% { + -webkit-transform: scale(0); + } + 40% { + -webkit-transform: scale(1); + } +} +@keyframes bouncedelay { + 0%, + 80%, + 100% { + transform: scale(0); + -webkit-transform: scale(0); + } + 40% { + transform: scale(1); + -webkit-transform: scale(1); + } +} +.table .table { + background-color: #ffffff; +} +kbn-table .table .table, +.kbn-table .table .table, +tbody[kbn-rows] .table .table { + margin-bottom: 0px; +} +kbn-table .table .table tr:first-child > td, +.kbn-table .table .table tr:first-child > td, +tbody[kbn-rows] .table .table tr:first-child > td { + border-top: none; +} +kbn-table .table .table td.field-name, +.kbn-table .table .table td.field-name, +tbody[kbn-rows] .table .table td.field-name { + font-weight: bold; +} +kbn-table dl.source, +.kbn-table dl.source, +tbody[kbn-rows] dl.source { + margin-bottom: 0; + line-height: 2em; + word-break: break-all; +} +kbn-table dl.source dt, +.kbn-table dl.source dt, +tbody[kbn-rows] dl.source dt, +kbn-table dl.source dd, +.kbn-table dl.source dd, +tbody[kbn-rows] dl.source dd { + display: inline; +} +kbn-table dl.source dt, +.kbn-table dl.source dt, +tbody[kbn-rows] dl.source dt { + background: #ecf0f1; + color: #444444; + padding: 1px 5px; + margin-right: 5px; + font-family: monospace; + word-break: normal; +} +table th i.fa-sort { + color: #b4bcc2; +} +table th i.fa-sort-asc, +table th i.fa-sort-down { + color: #b4bcc2; +} +table th i.fa-sort-desc, +table th i.fa-sort-up { + color: #b4bcc2; +} +.truncate-by-height { + position: relative; + overflow: hidden; +} +.truncate-by-height:before { + content: " "; + width: 100%; + height: 15px; + position: absolute; + left: 0; + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(1%, rgba(255, 255, 255, 0.01)), color-stop(99%, rgba(255, 255, 255, 0.99)), color-stop(100%, #ffffff)); + background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.01) 1%, rgba(255, 255, 255, 0.99) 99%, #ffffff 100%); + background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.01) 1%, rgba(255, 255, 255, 0.99) 99%, #ffffff 100%); +} diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/fbe046f38bf68f1469110319dee9bbfd.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/fbe046f38bf68f1469110319dee9bbfd.js new file mode 100644 index 0000000..4371f7f --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/fbe046f38bf68f1469110319dee9bbfd.js @@ -0,0 +1,1793 @@ +(function (window) { + "use strict"; + + if (typeof window.window !== "undefined" && window.document) { + return; + } + + window.console = function () { + var msgs = Array.prototype.slice.call(arguments, 0); + window.postMessage({type: "log", data: msgs}); + }; + window.console.error = + window.console.warn = + window.console.log = + window.console.trace = window.console; + + window.window = window; + window.ace = window; + + window.onerror = function (message, file, line, col, err) { + console.error("Worker " + err.stack); + }; + + window.normalizeModule = function (parentId, moduleName) { + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); + } + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = (base ? base + "/" : "") + moduleName; + + var previous; + while (moduleName.indexOf(".") !== -1 && previous != moduleName) { + previous = moduleName; + moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + + return moduleName; + }; + + window.require = function (parentId, id) { + if (!id) { + id = parentId + parentId = null; + } + if (!id.charAt) + throw new Error("worker.js require() accepts only (parentId, id) as arguments"); + + id = window.normalizeModule(parentId, id); + + var module = window.require.modules[id]; + if (module) { + if (!module.initialized) { + module.initialized = true; + module.exports = module.factory().exports; + } + return module.exports; + } + + var chunks = id.split("/"); + if (!window.require.tlns) + return console.log("unable to load " + id); + chunks[0] = window.require.tlns[chunks[0]] || chunks[0]; + var path = chunks.join("/") + ".js"; + + window.require.id = id; + window.importScripts(path); + return window.require(parentId, id); + }; + window.require.modules = {}; + window.require.tlns = {}; + + window.define = function (id, deps, factory) { + if (arguments.length == 2) { + factory = deps; + if (typeof id != "string") { + deps = id; + id = window.require.id; + } + } else if (arguments.length == 1) { + factory = id; + deps = [] + id = window.require.id; + } + + if (!deps.length) + deps = ['require', 'exports', 'module'] + + if (id.indexOf("text!") === 0) + return; + + var req = function (childId) { + return window.require(id, childId); + }; + + window.require.modules[id] = { + exports: {}, + factory: function () { + var module = this; + var returnExports = factory.apply(this, deps.map(function (dep) { + switch (dep) { + case 'require': + return req + case 'exports': + return module.exports + case 'module': + return module + default: + return req(dep) + } + })); + if (returnExports) + module.exports = returnExports; + return module; + } + }; + }; + window.define.amd = {} + + window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { + require.tlns = topLevelNamespaces; + } + + window.initSender = function initSender() { + + var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; + var oop = window.require("ace/lib/oop"); + + var Sender = function () { + }; + + (function () { + + oop.implement(this, EventEmitter); + + this.callback = function (data, callbackId) { + window.postMessage({ + type: "call", + id: callbackId, + data: data + }); + }; + + this.emit = function (name, data) { + window.postMessage({ + type: "event", + name: name, + data: data + }); + }; + + }).call(Sender.prototype); + + return new Sender(); + } + + window.main = null; + window.sender = null; + + window.onmessage = function (e) { + var msg = e.data; + if (msg.command) { + if (window.main[msg.command]) + window.main[msg.command].apply(window.main, msg.args); + else + throw new Error("Unknown command:" + msg.command); + } + else if (msg.init) { + window.initBaseUrls(msg.tlns); + require("ace/lib/es5-shim"); + window.sender = window.initSender(); + var clazz = require(msg.module)[msg.classname]; + /*jshint -W055 */ + window.main = new clazz(window.sender); + } + else if (msg.event && window.sender) { + window.sender._emit(msg.event, msg.data); + } + }; +})(this);// https://github.com/kriskowal/es5-shim + +define('ace/lib/oop', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + exports.inherits = function (ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + + exports.mixin = function (obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; + }; + + exports.implement = function (proto, mixin) { + exports.mixin(proto, mixin); + }; + +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function (require, exports, module) { + "use strict"; + + var Document = require("../document").Document; + var lang = require("../lib/lang"); + + var Mirror = exports.Mirror = function (sender) { + this.sender = sender; + var doc = this.doc = new Document(""); + + var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); + + var _self = this; + sender.on("change", function (e) { + doc.applyDeltas(e.data); + if (_self.$timeout) + return deferredUpdate.schedule(_self.$timeout); + _self.onUpdate(); + }); + }; + + (function () { + + this.$timeout = 500; + + this.setTimeout = function (timeout) { + this.$timeout = timeout; + }; + + this.setValue = function (value) { + this.doc.setValue(value); + this.deferredUpdate.schedule(this.$timeout); + }; + + this.getValue = function (callbackId) { + this.sender.callback(this.doc.getValue(), callbackId); + }; + + this.onUpdate = function () { + }; + + this.isPending = function () { + return this.deferredUpdate.isPending(); + }; + + }).call(Mirror.prototype); + +}); + +define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', + 'ace/range', 'ace/anchor'], function (require, exports, module) { + "use strict"; + + var oop = require("./lib/oop"); + var EventEmitter = require("./lib/event_emitter").EventEmitter; + var Range = require("./range").Range; + var Anchor = require("./anchor").Anchor; + + var Document = function (text) { + this.$lines = []; + if (text.length == 0) { + this.$lines = [""]; + } else if (Array.isArray(text)) { + this._insertLines(0, text); + } else { + this.insert({row: 0, column: 0}, text); + } + }; + + (function () { + + oop.implement(this, EventEmitter); + this.setValue = function (text) { + var len = this.getLength(); + this.remove(new Range(0, 0, len, this.getLine(len - 1).length)); + this.insert({row: 0, column: 0}, text); + }; + this.getValue = function () { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function (row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length == 0) + this.$split = function (text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + } + else + this.$split = function (text) { + return text.split(/\r\n|\r|\n/); + }; + + + this.$detectNewLine = function (text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + }; + this.getNewLineCharacter = function () { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine; + } + }; + + this.$autoNewLine = "\n"; + this.$newLineMode = "auto"; + this.setNewLineMode = function (newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + }; + this.getNewLineMode = function () { + return this.$newLineMode; + }; + this.isNewLine = function (text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function (row) { + return this.$lines[row] || ""; + }; + this.getLines = function (firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function () { + return this.getLines(0, this.getLength()); + }; + this.getLength = function () { + return this.$lines.length; + }; + this.getTextRange = function (range) { + if (range.start.row == range.end.row) { + return this.getLine(range.start.row) + .substring(range.start.column, range.end.column); + } + var lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + return lines.join(this.getNewLineCharacter()); + }; + + this.$clipPosition = function (position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length - 1).length; + } else if (position.row < 0) + position.row = 0; + return position; + }; + this.insert = function (position, text) { + if (!text || text.length === 0) + return position; + + position = this.$clipPosition(position); + if (this.getLength() <= 1) + this.$detectNewLine(text); + + var lines = this.$split(text); + var firstLine = lines.splice(0, 1)[0]; + var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; + + position = this.insertInLine(position, firstLine); + if (lastLine !== null) { + position = this.insertNewLine(position); // terminate first line + position = this._insertLines(position.row, lines); + position = this.insertInLine(position, lastLine || ""); + } + return position; + }; + this.insertLines = function (row, lines) { + if (row >= this.getLength()) + return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); + return this._insertLines(Math.max(row, 0), lines); + }; + this._insertLines = function (row, lines) { + if (lines.length == 0) + return {row: row, column: 0}; + var end; + if (lines.length > 0xFFFF) { + end = this._insertLines(row, lines.slice(0xFFFF)); + lines = lines.slice(0, 0xFFFF); + } + + var args = [row, 0]; + args.push.apply(args, lines); + this.$lines.splice.apply(this.$lines, args); + + var range = new Range(row, 0, row + lines.length, 0); + var delta = { + action: "insertLines", + range: range, + lines: lines + }; + this._emit("change", { data: delta }); + return end || range.end; + }; + this.insertNewLine = function (position) { + position = this.$clipPosition(position); + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column); + this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); + + var end = { + row: position.row + 1, + column: 0 + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + + return end; + }; + this.insertInLine = function (position, text) { + if (text.length == 0) + return position; + + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column) + text + + line.substring(position.column); + + var end = { + row: position.row, + column: position.column + text.length + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: text + }; + this._emit("change", { data: delta }); + + return end; + }; + this.remove = function (range) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + range.start = this.$clipPosition(range.start); + range.end = this.$clipPosition(range.end); + + if (range.isEmpty()) + return range.start; + + var firstRow = range.start.row; + var lastRow = range.end.row; + + if (range.isMultiLine()) { + var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; + var lastFullRow = lastRow - 1; + + if (range.end.column > 0) + this.removeInLine(lastRow, 0, range.end.column); + + if (lastFullRow >= firstFullRow) + this._removeLines(firstFullRow, lastFullRow); + + if (firstFullRow != firstRow) { + this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); + this.removeNewLine(range.start.row); + } + } + else { + this.removeInLine(firstRow, range.start.column, range.end.column); + } + return range.start; + }; + this.removeInLine = function (row, startColumn, endColumn) { + if (startColumn == endColumn) + return; + + var range = new Range(row, startColumn, row, endColumn); + var line = this.getLine(row); + var removed = line.substring(startColumn, endColumn); + var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); + this.$lines.splice(row, 1, newLine); + + var delta = { + action: "removeText", + range: range, + text: removed + }; + this._emit("change", { data: delta }); + return range.start; + }; + this.removeLines = function (firstRow, lastRow) { + if (firstRow < 0 || lastRow >= this.getLength()) + return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); + return this._removeLines(firstRow, lastRow); + }; + + this._removeLines = function (firstRow, lastRow) { + var range = new Range(firstRow, 0, lastRow + 1, 0); + var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); + + var delta = { + action: "removeLines", + range: range, + nl: this.getNewLineCharacter(), + lines: removed + }; + this._emit("change", { data: delta }); + return removed; + }; + this.removeNewLine = function (row) { + var firstLine = this.getLine(row); + var secondLine = this.getLine(row + 1); + + var range = new Range(row, firstLine.length, row + 1, 0); + var line = firstLine + secondLine; + + this.$lines.splice(row, 2, line); + + var delta = { + action: "removeText", + range: range, + text: this.getNewLineCharacter() + }; + this._emit("change", { data: delta }); + }; + this.replace = function (range, text) { + if (!range instanceof Range) + range = Range.fromPoints(range.start, range.end); + if (text.length == 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + var end; + if (text) { + end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function (deltas) { + for (var i = 0; i < deltas.length; i++) { + var delta = deltas[i]; + var range = Range.fromPoints(delta.range.start, delta.range.end); + + if (delta.action == "insertLines") + this.insertLines(range.start.row, delta.lines); + else if (delta.action == "insertText") + this.insert(range.start, delta.text); + else if (delta.action == "removeLines") + this._removeLines(range.start.row, range.end.row - 1); + else if (delta.action == "removeText") + this.remove(range); + } + }; + this.revertDeltas = function (deltas) { + for (var i = deltas.length - 1; i >= 0; i--) { + var delta = deltas[i]; + + var range = Range.fromPoints(delta.range.start, delta.range.end); + + if (delta.action == "insertLines") + this._removeLines(range.start.row, range.end.row - 1); + else if (delta.action == "insertText") + this.remove(range); + else if (delta.action == "removeLines") + this._insertLines(range.start.row, delta.lines); + else if (delta.action == "removeText") + this.insert(range.start, delta.text); + } + }; + this.indexToPosition = function (index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l - 1, column: lines[l - 1].length}; + }; + this.positionToIndex = function (pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + + }).call(Document.prototype); + + exports.Document = Document; +}); + +define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + var EventEmitter = {}; + var stopPropagation = function () { + this.propagationStopped = true; + }; + var preventDefault = function () { + this.defaultPrevented = true; + }; + + EventEmitter._emit = + EventEmitter._dispatchEvent = function (eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + + if (typeof e != "object" || !e) + e = {}; + + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + + listeners = listeners.slice(); + for (var i = 0; i < listeners.length; i++) { + listeners[i](e, this); + if (e.propagationStopped) + break; + } + + if (defaultHandler && !e.defaultPrevented) + return defaultHandler(e, this); + }; + + + EventEmitter._signal = function (eventName, e) { + var listeners = (this._eventRegistry || {})[eventName]; + if (!listeners) + return; + listeners = listeners.slice(); + for (var i = 0; i < listeners.length; i++) + listeners[i](e, this); + }; + + EventEmitter.once = function (eventName, callback) { + var _self = this; + callback && this.addEventListener(eventName, function newCallback() { + _self.removeEventListener(eventName, newCallback); + callback.apply(null, arguments); + }); + }; + + + EventEmitter.setDefaultHandler = function (eventName, callback) { + var handlers = this._defaultHandlers + if (!handlers) + handlers = this._defaultHandlers = {_disabled_: {}}; + + if (handlers[eventName]) { + var old = handlers[eventName]; + var disabled = handlers._disabled_[eventName]; + if (!disabled) + handlers._disabled_[eventName] = disabled = []; + disabled.push(old); + var i = disabled.indexOf(callback); + if (i != -1) + disabled.splice(i, 1); + } + handlers[eventName] = callback; + }; + EventEmitter.removeDefaultHandler = function (eventName, callback) { + var handlers = this._defaultHandlers + if (!handlers) + return; + var disabled = handlers._disabled_[eventName]; + + if (handlers[eventName] == callback) { + var old = handlers[eventName]; + if (disabled) + this.setDefaultHandler(eventName, disabled.pop()); + } else if (disabled) { + var i = disabled.indexOf(callback); + if (i != -1) + disabled.splice(i, 1); + } + }; + + EventEmitter.on = + EventEmitter.addEventListener = function (eventName, callback, capturing) { + this._eventRegistry = this._eventRegistry || {}; + + var listeners = this._eventRegistry[eventName]; + if (!listeners) + listeners = this._eventRegistry[eventName] = []; + + if (listeners.indexOf(callback) == -1) + listeners[capturing ? "unshift" : "push"](callback); + return callback; + }; + + EventEmitter.off = + EventEmitter.removeListener = + EventEmitter.removeEventListener = function (eventName, callback) { + this._eventRegistry = this._eventRegistry || {}; + + var listeners = this._eventRegistry[eventName]; + if (!listeners) + return; + + var index = listeners.indexOf(callback); + if (index !== -1) + listeners.splice(index, 1); + }; + + EventEmitter.removeAllListeners = function (eventName) { + if (this._eventRegistry) this._eventRegistry[eventName] = []; + }; + + exports.EventEmitter = EventEmitter; + +}); + +define('ace/range', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + var comparePoints = function (p1, p2) { + return p1.row - p2.row || p1.column - p2.column; + }; + var Range = function (startRow, startColumn, endRow, endColumn) { + this.start = { + row: startRow, + column: startColumn + }; + + this.end = { + row: endRow, + column: endColumn + }; + }; + + (function () { + this.isEqual = function (range) { + return this.start.row === range.start.row && + this.end.row === range.end.row && + this.start.column === range.start.column && + this.end.column === range.end.column; + }; + this.toString = function () { + return ("Range: [" + this.start.row + "/" + this.start.column + + "] -> [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function (row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function (range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function (p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function (range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function (range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function (row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function (row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function (row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function (row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function (row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function (row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function (row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function (row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + } + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function (row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function (row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function (row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function (firstRow, lastRow) { + var start, end; + if (this.end.row > lastRow) + end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function (row, column) { + var cmp = this.compare(row, column); + var start, end; + if (cmp == 0) + return this; + else if (cmp == -1) + start = {row: row, column: column}; + else + end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function () { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function () { + return (this.start.row !== this.end.row); + }; + this.clone = function () { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function () { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function (session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function (row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + + }).call(Range.prototype); + Range.fromPoints = function (start, end) { + return new Range(start.row, start.column, end.row, end.column); + }; + Range.comparePoints = comparePoints; + + Range.comparePoints = function (p1, p2) { + return p1.row - p2.row || p1.column - p2.column; + }; + + + exports.Range = Range; +}); + +define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function (require, exports, module) { + "use strict"; + + var oop = require("./lib/oop"); + var EventEmitter = require("./lib/event_emitter").EventEmitter; + + var Anchor = exports.Anchor = function (doc, row, column) { + this.$onChange = this.onChange.bind(this); + this.attach(doc); + + if (typeof column == "undefined") + this.setPosition(row.row, row.column); + else + this.setPosition(row, column); + }; + + (function () { + + oop.implement(this, EventEmitter); + this.getPosition = function () { + return this.$clipPositionToDocument(this.row, this.column); + }; + this.getDocument = function () { + return this.document; + }; + this.$insertRight = false; + this.onChange = function (e) { + var delta = e.data; + var range = delta.range; + + if (range.start.row == range.end.row && range.start.row != this.row) + return; + + if (range.start.row > this.row) + return; + + if (range.start.row == this.row && range.start.column > this.column) + return; + + var row = this.row; + var column = this.column; + var start = range.start; + var end = range.end; + + if (delta.action === "insertText") { + if (start.row === row && start.column <= column) { + if (start.column === column && this.$insertRight) { + } else if (start.row === end.row) { + column += end.column - start.column; + } else { + column -= start.column; + row += end.row - start.row; + } + } else if (start.row !== end.row && start.row < row) { + row += end.row - start.row; + } + } else if (delta.action === "insertLines") { + if (start.row <= row) { + row += end.row - start.row; + } + } else if (delta.action === "removeText") { + if (start.row === row && start.column < column) { + if (end.column >= column) + column = start.column; + else + column = Math.max(0, column - (end.column - start.column)); + + } else if (start.row !== end.row && start.row < row) { + if (end.row === row) + column = Math.max(0, column - end.column) + start.column; + row -= (end.row - start.row); + } else if (end.row === row) { + row -= end.row - start.row; + column = Math.max(0, column - end.column) + start.column; + } + } else if (delta.action == "removeLines") { + if (start.row <= row) { + if (end.row <= row) + row -= end.row - start.row; + else { + row = start.row; + column = 0; + } + } + } + + this.setPosition(row, column, true); + }; + this.setPosition = function (row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._emit("change", { + old: old, + value: pos + }); + }; + this.detach = function () { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function (doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function (row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + + }).call(Anchor.prototype); + +}); + +define('ace/lib/lang', ['require', 'exports', 'module' ], function (require, exports, module) { + "use strict"; + + exports.stringReverse = function (string) { + return string.split("").reverse().join(""); + }; + + exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; + }; + + var trimBeginRegexp = /^\s\s*/; + var trimEndRegexp = /\s\s*$/; + + exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); + }; + + exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); + }; + + exports.copyObject = function (obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; + }; + + exports.copyArray = function (array) { + var copy = []; + for (var i = 0, l = array.length; i < l; i++) { + if (array[i] && typeof array[i] == "object") + copy[i] = this.copyObject(array[i]); + else + copy[i] = array[i]; + } + return copy; + }; + + exports.deepCopy = function (obj) { + if (typeof obj !== "object" || !obj) + return obj; + var cons = obj.constructor; + if (cons === RegExp) + return obj; + + var copy = cons(); + for (var key in obj) { + if (typeof obj[key] === "object") { + copy[key] = exports.deepCopy(obj[key]); + } else { + copy[key] = obj[key]; + } + } + return copy; + }; + + exports.arrayToMap = function (arr) { + var map = {}; + for (var i = 0; i < arr.length; i++) { + map[arr[i]] = 1; + } + return map; + + }; + + exports.createMap = function (props) { + var map = Object.create(null); + for (var i in props) { + map[i] = props[i]; + } + return map; + }; + exports.arrayRemove = function (array, value) { + for (var i = 0; i <= array.length; i++) { + if (value === array[i]) { + array.splice(i, 1); + } + } + }; + + exports.escapeRegExp = function (str) { + return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); + }; + + exports.escapeHTML = function (str) { + return str.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (isNaN(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + + var hex, + i, + string = '', + uffff; + + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + + while (ch && ch <= ' ') { + next(); + } + }, + + strictWhite = function () { + + while (ch && ( ch == ' ' || ch == '\t')) { + next(); + } + }, + + newLine = function () { + if (ch == '\n') next(); + }, + + word = function () { + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + // parses and returns the method + method = function () { + switch (ch) { + case 'G': + next('G'); + next('E'); + next('T'); + return "GET"; + case 'H': + next('H'); + next('E'); + next('A'); + next('D'); + return "HEAD"; + case 'D': + next('D'); + next('E'); + next('L'); + next('E'); + next('T'); + next('E'); + return "DELETE"; + case 'P': + next('P'); + switch (ch) { + case 'U': + next('U'); + next('T'); + return "PUT"; + case 'O': + next('O'); + next('S'); + next('T'); + return "POST"; + default: + error("Unexpected '" + ch + "'"); + } + break; + default: + error("Expected one of GET/POST/PUT/DELETE/HEAD"); + } + + }, + + value, // Place holder for the value function. + + array = function () { + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + + value = function () { + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } + }; + + var url = function () { + + var url = ''; + while (ch && ch != '\n') { + url += ch; + next(); + } + if (url == '') + error('Missing url'); + return url; + }, + + request = function () { + white(); + var meth = method(); + strictWhite(); + url(); + strictWhite(); // advance to one new line + newLine(); + strictWhite(); + if (ch == '{') { + object(); + } + // multi doc request + strictWhite(); // advance to one new line + newLine(); + strictWhite(); + while (ch == '{') { + // another object + object(); + strictWhite(); + newLine(); + strictWhite(); + } + + }, + + comment = function () { + while (ch == '#') { + while (ch && ch !== '\n') { + next(); + } + white(); + } + }, + + multi_request = function () { + while (ch && ch != '') { + white(); + if (!ch) { + continue; + } + try { + comment(); + white(); + if (!ch) { + continue; + } + request(); + white(); + } + catch (e) { + annotate("error", e.message); + // snap + var substring = text.substr(at); + var nextMatch = substring.search(/^POST|HEAD|GET|PUT|DELETE/m); + if (nextMatch < 1) return; + reset(at + nextMatch); + } + } + }; + + + return function (source, reviver) { + var result; + + text = source; + at = 0; + annos = []; + next(); + multi_request(); + white(); + if (ch) { + annotate("error", "Syntax error"); + } + + result = { "annotations": annos }; + + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + })({'': result}, '') : result; + }; +}); + + +define("sense_editor/mode/worker", ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', + 'sense_editor/mode/worker_parser'], function (require, exports, module) { + "use strict"; + + + var oop = require("ace/lib/oop"); + var Mirror = require("ace/worker/mirror").Mirror; + var parse = require("sense_editor/mode/worker_parser"); + + var SenseWorker = exports.SenseWorker = function (sender) { + Mirror.call(this, sender); + this.setTimeout(200); + }; + + oop.inherits(SenseWorker, Mirror); + + (function () { + + this.onUpdate = function () { + var value = this.doc.getValue(); + var pos, result; + try { + result = parse(value); + } catch (e) { + pos = this.charToDocumentPosition(e.at - 1); + this.sender.emit("error", { + row: pos.row, + column: pos.column, + text: e.message, + type: "error" + }); + return; + } + for (var i = 0; i < result.annotations.length; i++) { + pos = this.charToDocumentPosition(result.annotations[i].at - 1); + result.annotations[i].row = pos.row; + result.annotations[i].column = pos.column; + + } + this.sender.emit("ok", result.annotations); + }; + + this.charToDocumentPosition = function (charPos) { + var i = 0; + var len = this.doc.getLength(); + var nl = this.doc.getNewLineCharacter().length; + + if (!len) { + return { row: 0, column: 0}; + } + + var lineStart = 0, line; + while (i < len) { + line = this.doc.getLine(i); + var lineLength = line.length + nl; + if (lineStart + lineLength > charPos) + return { + row: i, + column: charPos - lineStart + }; + + lineStart += lineLength; + i += 1; + } + + return { + row: i - 1, + column: line.length + }; + }; + + }).call(SenseWorker.prototype); + +}); + diff --git a/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/kibana.bundle.js b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/kibana.bundle.js new file mode 100644 index 0000000..8a35118 --- /dev/null +++ b/release/Sensitive-darwin-x64/Sensitive.app/Contents/Resources/app/sense/optimize/bundles/kibana.bundle.js @@ -0,0 +1,112731 @@ +webpackJsonp([0],[ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + + /** + * Test entry file + * + * This is programatically created and updated, do not modify + * + * context: {"env":"production","urlBasePath":"","sourceMaps":false,"kbnVersion":"4.4.0","buildNum":9689} + * includes code from: + * - elasticsearch@1.0.0 + * - kbn_vislib_vis_types@1.0.0 + * - kibana@1.0.0 + * - markdown_vis@1.0.0 + * - metric_vis@1.0.0 + * - sense@2.0.0-beta2 + * - spyModes@1.0.0 + * - statusPage@1.0.0 + * - table_vis@1.0.0 + * + */ + + 'use strict'; + + __webpack_require__(1069); + __webpack_require__(1136); + __webpack_require__(1516); + __webpack_require__(1582); + __webpack_require__(1111); + __webpack_require__(1561); + __webpack_require__(1217); + __webpack_require__(1218); + __webpack_require__(1560); + __webpack_require__(1575); + __webpack_require__(1241); + __webpack_require__(1583); + __webpack_require__(1574); + __webpack_require__(1114); + __webpack_require__(1379); + __webpack_require__(1585); + __webpack_require__(1586); + __webpack_require__(1587); + __webpack_require__(1588); + __webpack_require__(1590); + __webpack_require__(1591); + __webpack_require__(1477); + __webpack_require__(1593); + __webpack_require__(1240); + __webpack_require__(1402); + __webpack_require__(1396); + __webpack_require__(1515); + __webpack_require__(1400); + __webpack_require__(1270); + __webpack_require__(1594); + __webpack_require__(1382); + __webpack_require__(1341); + __webpack_require__(1460); + __webpack_require__(1271); + __webpack_require__(1536); + __webpack_require__(1219); + __webpack_require__(1566); + __webpack_require__(1249); + __webpack_require__(1220); + __webpack_require__(1535); + __webpack_require__(1595); + __webpack_require__(1596); + __webpack_require__(1597); + __webpack_require__(1598); + __webpack_require__(1599); + __webpack_require__(1600); + __webpack_require__(1601); + __webpack_require__(1602); + __webpack_require__(1603); + __webpack_require__(1604); + __webpack_require__(1605); + __webpack_require__(1606); + __webpack_require__(1607); + __webpack_require__(1608); + __webpack_require__(1609); + __webpack_require__(1610); + __webpack_require__(1595); + __webpack_require__(1611); + __webpack_require__(1612); + __webpack_require__(212); + __webpack_require__(1069); + __webpack_require__(1613); + __webpack_require__(1616); + __webpack_require__(1617); + __webpack_require__(1484); + __webpack_require__(1272); + __webpack_require__(1618); + __webpack_require__(1424); + __webpack_require__(1552); + __webpack_require__(1273); + __webpack_require__(1086); + __webpack_require__(1619); + __webpack_require__(1621); + __webpack_require__(1442); + __webpack_require__(1275); + __webpack_require__(1628); + __webpack_require__(1121); + __webpack_require__(1629); + __webpack_require__(1632); + __webpack_require__(1103); + __webpack_require__(1104); + __webpack_require__(1274); + __webpack_require__(1325); + __webpack_require__(1097); + __webpack_require__(1633); + __webpack_require__(1634); + __webpack_require__(1668); + __webpack_require__(1078); + __webpack_require__(1572); + __webpack_require__(1670); + __webpack_require__(1487); + __webpack_require__(1534); + __webpack_require__(1384); + __webpack_require__(1112); + __webpack_require__(1137); + __webpack_require__(1449); + __webpack_require__(1483); + __webpack_require__(1511); + __webpack_require__(1512); + __webpack_require__(1569); + __webpack_require__(1143); + __webpack_require__(1672); + __webpack_require__(1336); + __webpack_require__(423); + __webpack_require__(1705); + __webpack_require__(1729); + __webpack_require__(1736); + __webpack_require__(1741); + __webpack_require__(1753); + __webpack_require__(1755); + __webpack_require__(1069).bootstrap(); + /* xoxo */ + +/***/ }, +/* 1 */, +/* 2 */, +/* 3 */, +/* 4 */, +/* 5 */, +/* 6 */, +/* 7 */, +/* 8 */, +/* 9 */, +/* 10 */, +/* 11 */, +/* 12 */, +/* 13 */, +/* 14 */, +/* 15 */, +/* 16 */, +/* 17 */, +/* 18 */, +/* 19 */, +/* 20 */, +/* 21 */, +/* 22 */, +/* 23 */, +/* 24 */, +/* 25 */, +/* 26 */, +/* 27 */, +/* 28 */, +/* 29 */, +/* 30 */, +/* 31 */, +/* 32 */, +/* 33 */, +/* 34 */, +/* 35 */, +/* 36 */, +/* 37 */, +/* 38 */, +/* 39 */, +/* 40 */, +/* 41 */, +/* 42 */, +/* 43 */, +/* 44 */, +/* 45 */, +/* 46 */, +/* 47 */, +/* 48 */, +/* 49 */, +/* 50 */, +/* 51 */, +/* 52 */, +/* 53 */, +/* 54 */, +/* 55 */, +/* 56 */, +/* 57 */, +/* 58 */, +/* 59 */, +/* 60 */, +/* 61 */, +/* 62 */, +/* 63 */, +/* 64 */, +/* 65 */, +/* 66 */, +/* 67 */, +/* 68 */, +/* 69 */, +/* 70 */, +/* 71 */, +/* 72 */, +/* 73 */, +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */, +/* 80 */, +/* 81 */, +/* 82 */, +/* 83 */, +/* 84 */, +/* 85 */, +/* 86 */, +/* 87 */, +/* 88 */, +/* 89 */, +/* 90 */, +/* 91 */, +/* 92 */, +/* 93 */, +/* 94 */, +/* 95 */, +/* 96 */, +/* 97 */, +/* 98 */, +/* 99 */, +/* 100 */, +/* 101 */, +/* 102 */, +/* 103 */, +/* 104 */, +/* 105 */, +/* 106 */, +/* 107 */, +/* 108 */, +/* 109 */, +/* 110 */, +/* 111 */, +/* 112 */, +/* 113 */, +/* 114 */, +/* 115 */, +/* 116 */, +/* 117 */, +/* 118 */, +/* 119 */, +/* 120 */, +/* 121 */, +/* 122 */, +/* 123 */, +/* 124 */, +/* 125 */, +/* 126 */, +/* 127 */, +/* 128 */, +/* 129 */, +/* 130 */, +/* 131 */, +/* 132 */, +/* 133 */, +/* 134 */, +/* 135 */, +/* 136 */, +/* 137 */, +/* 138 */, +/* 139 */, +/* 140 */, +/* 141 */, +/* 142 */, +/* 143 */, +/* 144 */, +/* 145 */, +/* 146 */, +/* 147 */, +/* 148 */, +/* 149 */, +/* 150 */, +/* 151 */, +/* 152 */, +/* 153 */, +/* 154 */, +/* 155 */, +/* 156 */, +/* 157 */, +/* 158 */, +/* 159 */, +/* 160 */, +/* 161 */, +/* 162 */, +/* 163 */, +/* 164 */, +/* 165 */, +/* 166 */, +/* 167 */, +/* 168 */, +/* 169 */, +/* 170 */, +/* 171 */, +/* 172 */, +/* 173 */, +/* 174 */, +/* 175 */, +/* 176 */, +/* 177 */, +/* 178 */, +/* 179 */, +/* 180 */, +/* 181 */, +/* 182 */, +/* 183 */, +/* 184 */, +/* 185 */, +/* 186 */, +/* 187 */, +/* 188 */, +/* 189 */, +/* 190 */, +/* 191 */, +/* 192 */, +/* 193 */, +/* 194 */, +/* 195 */, +/* 196 */, +/* 197 */, +/* 198 */, +/* 199 */, +/* 200 */, +/* 201 */, +/* 202 */, +/* 203 */, +/* 204 */, +/* 205 */, +/* 206 */, +/* 207 */, +/* 208 */, +/* 209 */, +/* 210 */, +/* 211 */, +/* 212 */, +/* 213 */, +/* 214 */, +/* 215 */, +/* 216 */, +/* 217 */, +/* 218 */, +/* 219 */, +/* 220 */, +/* 221 */, +/* 222 */, +/* 223 */, +/* 224 */, +/* 225 */, +/* 226 */, +/* 227 */, +/* 228 */, +/* 229 */, +/* 230 */, +/* 231 */, +/* 232 */, +/* 233 */, +/* 234 */, +/* 235 */, +/* 236 */, +/* 237 */, +/* 238 */, +/* 239 */, +/* 240 */, +/* 241 */, +/* 242 */, +/* 243 */, +/* 244 */, +/* 245 */, +/* 246 */, +/* 247 */, +/* 248 */, +/* 249 */, +/* 250 */, +/* 251 */, +/* 252 */, +/* 253 */, +/* 254 */, +/* 255 */, +/* 256 */, +/* 257 */, +/* 258 */, +/* 259 */, +/* 260 */, +/* 261 */, +/* 262 */, +/* 263 */, +/* 264 */, +/* 265 */, +/* 266 */, +/* 267 */, +/* 268 */, +/* 269 */, +/* 270 */, +/* 271 */, +/* 272 */, +/* 273 */, +/* 274 */, +/* 275 */, +/* 276 */, +/* 277 */, +/* 278 */, +/* 279 */, +/* 280 */, +/* 281 */, +/* 282 */, +/* 283 */, +/* 284 */, +/* 285 */, +/* 286 */, +/* 287 */, +/* 288 */, +/* 289 */, +/* 290 */, +/* 291 */, +/* 292 */, +/* 293 */, +/* 294 */, +/* 295 */, +/* 296 */, +/* 297 */, +/* 298 */, +/* 299 */, +/* 300 */, +/* 301 */, +/* 302 */, +/* 303 */, +/* 304 */, +/* 305 */, +/* 306 */, +/* 307 */, +/* 308 */, +/* 309 */, +/* 310 */, +/* 311 */, +/* 312 */, +/* 313 */, +/* 314 */, +/* 315 */, +/* 316 */, +/* 317 */, +/* 318 */, +/* 319 */, +/* 320 */, +/* 321 */, +/* 322 */, +/* 323 */, +/* 324 */, +/* 325 */, +/* 326 */, +/* 327 */, +/* 328 */, +/* 329 */, +/* 330 */, +/* 331 */, +/* 332 */, +/* 333 */, +/* 334 */, +/* 335 */, +/* 336 */, +/* 337 */, +/* 338 */, +/* 339 */, +/* 340 */, +/* 341 */, +/* 342 */, +/* 343 */, +/* 344 */, +/* 345 */, +/* 346 */, +/* 347 */, +/* 348 */, +/* 349 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(350), __esModule: true }; + +/***/ }, +/* 350 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(351); + __webpack_require__(303); + __webpack_require__(285); + __webpack_require__(352); + module.exports = __webpack_require__(224).Promise; + +/***/ }, +/* 351 */ +/***/ function(module, exports) { + + + +/***/ }, +/* 352 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(205) + , LIBRARY = __webpack_require__(292) + , global = __webpack_require__(223) + , ctx = __webpack_require__(225) + , classof = __webpack_require__(309) + , $export = __webpack_require__(222) + , isObject = __webpack_require__(249) + , anObject = __webpack_require__(307) + , aFunction = __webpack_require__(226) + , strictNew = __webpack_require__(353) + , forOf = __webpack_require__(354) + , setProto = __webpack_require__(355).set + , same = __webpack_require__(356) + , SPECIES = __webpack_require__(300)('species') + , speciesConstructor = __webpack_require__(357) + , asap = __webpack_require__(358) + , PROMISE = 'Promise' + , process = global.process + , isNode = classof(process) == 'process' + , P = global[PROMISE] + , Wrapper; + + var testResolve = function(sub){ + var test = new P(function(){}); + if(sub)test.constructor = Object; + return P.resolve(test) === test; + }; + + var USE_NATIVE = function(){ + var works = false; + function P2(x){ + var self = new P(x); + setProto(self, P2.prototype); + return self; + } + try { + works = P && P.resolve && testResolve(); + setProto(P2, P); + P2.prototype = $.create(P.prototype, {constructor: {value: P2}}); + // actual Firefox has broken subclass support, test that + if(!(P2.resolve(5).then(function(){}) instanceof P2)){ + works = false; + } + // actual V8 bug, https://code.google.com/p/v8/issues/detail?id=4162 + if(works && __webpack_require__(296)){ + var thenableThenGotten = false; + P.resolve($.setDesc({}, 'then', { + get: function(){ thenableThenGotten = true; } + })); + works = thenableThenGotten; + } + } catch(e){ works = false; } + return works; + }(); + + // helpers + var sameConstructor = function(a, b){ + // library wrapper special case + if(LIBRARY && a === P && b === Wrapper)return true; + return same(a, b); + }; + var getConstructor = function(C){ + var S = anObject(C)[SPECIES]; + return S != undefined ? S : C; + }; + var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var PromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve), + this.reject = aFunction(reject) + }; + var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } + }; + var notify = function(record, isReject){ + if(record.n)return; + record.n = true; + var chain = record.c; + asap(function(){ + var value = record.v + , ok = record.s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , result, then; + try { + if(handler){ + if(!ok)record.h = true; + result = handler === true ? value : handler(value); + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + chain.length = 0; + record.n = false; + if(isReject)setTimeout(function(){ + var promise = record.p + , handler, console; + if(isUnhandled(promise)){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + } record.a = undefined; + }, 1); + }); + }; + var isUnhandled = function(promise){ + var record = promise._d + , chain = record.a || record.c + , i = 0 + , reaction; + if(record.h)return false; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; + }; + var $reject = function(value){ + var record = this; + if(record.d)return; + record.d = true; + record = record.r || record; // unwrap + record.v = value; + record.s = 2; + record.a = record.c.slice(); + notify(record, true); + }; + var $resolve = function(value){ + var record = this + , then; + if(record.d)return; + record.d = true; + record = record.r || record; // unwrap + try { + if(record.p === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + asap(function(){ + var wrapper = {r: record, d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + record.v = value; + record.s = 1; + notify(record, false); + } + } catch(e){ + $reject.call({r: record, d: false}, e); // wrap + } + }; + + // constructor polyfill + if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + P = function Promise(executor){ + aFunction(executor); + var record = this._d = { + p: strictNew(this, P, PROMISE), // <- promise + c: [], // <- awaiting reactions + a: undefined, // <- checked in isUnhandled reactions + s: 0, // <- state + d: false, // <- done + v: undefined, // <- value + h: false, // <- handled rejection + n: false // <- notify + }; + try { + executor(ctx($resolve, record, 1), ctx($reject, record, 1)); + } catch(err){ + $reject.call(record, err); + } + }; + __webpack_require__(363)(P.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = new PromiseCapability(speciesConstructor(this, P)) + , promise = reaction.promise + , record = this._d; + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + record.c.push(reaction); + if(record.a)record.a.push(reaction); + if(record.s)notify(record, false); + return promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: P}); + __webpack_require__(299)(P, PROMISE); + __webpack_require__(364)(PROMISE); + Wrapper = __webpack_require__(224)[PROMISE]; + + // statics + $export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = new PromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + $export($export.S + $export.F * (!USE_NATIVE || testResolve(true)), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof P && sameConstructor(x.constructor, this))return x; + var capability = new PromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } + }); + $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(344)(function(iter){ + P.all(iter)['catch'](function(){}); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = getConstructor(this) + , capability = new PromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject + , values = []; + var abrupt = perform(function(){ + forOf(iterable, false, values.push, values); + var remaining = values.length + , results = Array(remaining); + if(remaining)$.each.call(values, function(promise, index){ + var alreadyCalled = false; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + results[index] = value; + --remaining || resolve(results); + }, reject); + }); + else resolve(results); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = getConstructor(this) + , capability = new PromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } + }); + +/***/ }, +/* 353 */ +/***/ function(module, exports) { + + module.exports = function(it, Constructor, name){ + if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); + return it; + }; + +/***/ }, +/* 354 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(225) + , call = __webpack_require__(341) + , isArrayIter = __webpack_require__(342) + , anObject = __webpack_require__(307) + , toLength = __webpack_require__(343) + , getIterFn = __webpack_require__(308); + module.exports = function(iterable, entries, fn, that){ + var iterFn = getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + call(iterator, f, step.value, entries); + } + }; + +/***/ }, +/* 355 */ +/***/ function(module, exports, __webpack_require__) { + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + var getDesc = __webpack_require__(205).getDesc + , isObject = __webpack_require__(249) + , anObject = __webpack_require__(307); + var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); + }; + module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = __webpack_require__(225)(Function.call, getDesc(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + +/***/ }, +/* 356 */ +/***/ function(module, exports) { + + // 7.2.9 SameValue(x, y) + module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; + }; + +/***/ }, +/* 357 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + var anObject = __webpack_require__(307) + , aFunction = __webpack_require__(226) + , SPECIES = __webpack_require__(300)('species'); + module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); + }; + +/***/ }, +/* 358 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(223) + , macrotask = __webpack_require__(359).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = __webpack_require__(231)(process) == 'process' + , head, last, notify; + + var flush = function(){ + var parent, domain, fn; + if(isNode && (parent = process.domain)){ + process.domain = null; + parent.exit(); + } + while(head){ + domain = head.domain; + fn = head.fn; + if(domain)domain.enter(); + fn(); // <- currently we use it only for Promise - try / catch not required + if(domain)domain.exit(); + head = head.next; + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = 1 + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = -toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + notify = function(){ + Promise.resolve().then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + module.exports = function asap(fn){ + var task = {fn: fn, next: undefined, domain: isNode && process.domain}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; + +/***/ }, +/* 359 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(225) + , invoke = __webpack_require__(360) + , html = __webpack_require__(361) + , cel = __webpack_require__(362) + , global = __webpack_require__(223) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; + var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listner = function(event){ + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(__webpack_require__(231)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listner; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listner, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } + } + module.exports = { + set: setTask, + clear: clearTask + }; + +/***/ }, +/* 360 */ +/***/ function(module, exports) { + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + +/***/ }, +/* 361 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(223).document && document.documentElement; + +/***/ }, +/* 362 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(249) + , document = __webpack_require__(223).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); + module.exports = function(it){ + return is ? document.createElement(it) : {}; + }; + +/***/ }, +/* 363 */ +/***/ function(module, exports, __webpack_require__) { + + var redefine = __webpack_require__(293); + module.exports = function(target, src){ + for(var key in src)redefine(target, key, src[key]); + return target; + }; + +/***/ }, +/* 364 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var core = __webpack_require__(224) + , $ = __webpack_require__(205) + , DESCRIPTORS = __webpack_require__(296) + , SPECIES = __webpack_require__(300)('species'); + + module.exports = function(KEY){ + var C = core[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])$.setDesc(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); + }; + +/***/ }, +/* 365 */, +/* 366 */, +/* 367 */, +/* 368 */, +/* 369 */, +/* 370 */, +/* 371 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;!function() { + var d3 = { + version: "3.5.6" + }; + var d3_arraySlice = [].slice, d3_array = function(list) { + return d3_arraySlice.call(list); + }; + var d3_document = this.document; + function d3_documentElement(node) { + return node && (node.ownerDocument || node.document || node).documentElement; + } + function d3_window(node) { + return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView); + } + if (d3_document) { + try { + d3_array(d3_document.documentElement.childNodes)[0].nodeType; + } catch (e) { + d3_array = function(list) { + var i = list.length, array = new Array(i); + while (i--) array[i] = list[i]; + return array; + }; + } + } + if (!Date.now) Date.now = function() { + return +new Date(); + }; + if (d3_document) { + try { + d3_document.createElement("DIV").style.setProperty("opacity", 0, ""); + } catch (error) { + var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty; + d3_element_prototype.setAttribute = function(name, value) { + d3_element_setAttribute.call(this, name, value + ""); + }; + d3_element_prototype.setAttributeNS = function(space, local, value) { + d3_element_setAttributeNS.call(this, space, local, value + ""); + }; + d3_style_prototype.setProperty = function(name, value, priority) { + d3_style_setProperty.call(this, name, value + "", priority); + }; + } + } + d3.ascending = d3_ascending; + function d3_ascending(a, b) { + return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; + } + d3.descending = function(a, b) { + return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; + }; + d3.min = function(array, f) { + var i = -1, n = array.length, a, b; + if (arguments.length === 1) { + while (++i < n) if ((b = array[i]) != null && b >= b) { + a = b; + break; + } + while (++i < n) if ((b = array[i]) != null && a > b) a = b; + } else { + while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { + a = b; + break; + } + while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; + } + return a; + }; + d3.max = function(array, f) { + var i = -1, n = array.length, a, b; + if (arguments.length === 1) { + while (++i < n) if ((b = array[i]) != null && b >= b) { + a = b; + break; + } + while (++i < n) if ((b = array[i]) != null && b > a) a = b; + } else { + while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { + a = b; + break; + } + while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; + } + return a; + }; + d3.extent = function(array, f) { + var i = -1, n = array.length, a, b, c; + if (arguments.length === 1) { + while (++i < n) if ((b = array[i]) != null && b >= b) { + a = c = b; + break; + } + while (++i < n) if ((b = array[i]) != null) { + if (a > b) a = b; + if (c < b) c = b; + } + } else { + while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { + a = c = b; + break; + } + while (++i < n) if ((b = f.call(array, array[i], i)) != null) { + if (a > b) a = b; + if (c < b) c = b; + } + } + return [ a, c ]; + }; + function d3_number(x) { + return x === null ? NaN : +x; + } + function d3_numeric(x) { + return !isNaN(x); + } + d3.sum = function(array, f) { + var s = 0, n = array.length, a, i = -1; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = +array[i])) s += a; + } else { + while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a; + } + return s; + }; + d3.mean = function(array, f) { + var s = 0, n = array.length, a, i = -1, j = n; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j; + } else { + while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j; + } + if (j) return s / j; + }; + d3.quantile = function(values, p) { + var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h; + return e ? v + e * (values[h] - v) : v; + }; + d3.median = function(array, f) { + var numbers = [], n = array.length, a, i = -1; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a); + } else { + while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a); + } + if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5); + }; + d3.variance = function(array, f) { + var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0; + if (arguments.length === 1) { + while (++i < n) { + if (d3_numeric(a = d3_number(array[i]))) { + d = a - m; + m += d / ++j; + s += d * (a - m); + } + } + } else { + while (++i < n) { + if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) { + d = a - m; + m += d / ++j; + s += d * (a - m); + } + } + } + if (j > 1) return s / (j - 1); + }; + d3.deviation = function() { + var v = d3.variance.apply(this, arguments); + return v ? Math.sqrt(v) : v; + }; + function d3_bisector(compare) { + return { + left: function(a, x, lo, hi) { + if (arguments.length < 3) lo = 0; + if (arguments.length < 4) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid; + } + return lo; + }, + right: function(a, x, lo, hi) { + if (arguments.length < 3) lo = 0; + if (arguments.length < 4) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1; + } + return lo; + } + }; + } + var d3_bisect = d3_bisector(d3_ascending); + d3.bisectLeft = d3_bisect.left; + d3.bisect = d3.bisectRight = d3_bisect.right; + d3.bisector = function(f) { + return d3_bisector(f.length === 1 ? function(d, x) { + return d3_ascending(f(d), x); + } : f); + }; + d3.shuffle = function(array, i0, i1) { + if ((m = arguments.length) < 3) { + i1 = array.length; + if (m < 2) i0 = 0; + } + var m = i1 - i0, t, i; + while (m) { + i = Math.random() * m-- | 0; + t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t; + } + return array; + }; + d3.permute = function(array, indexes) { + var i = indexes.length, permutes = new Array(i); + while (i--) permutes[i] = array[indexes[i]]; + return permutes; + }; + d3.pairs = function(array) { + var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n); + while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ]; + return pairs; + }; + d3.zip = function() { + if (!(n = arguments.length)) return []; + for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) { + for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) { + zip[j] = arguments[j][i]; + } + } + return zips; + }; + function d3_zipLength(d) { + return d.length; + } + d3.transpose = function(matrix) { + return d3.zip.apply(d3, matrix); + }; + d3.keys = function(map) { + var keys = []; + for (var key in map) keys.push(key); + return keys; + }; + d3.values = function(map) { + var values = []; + for (var key in map) values.push(map[key]); + return values; + }; + d3.entries = function(map) { + var entries = []; + for (var key in map) entries.push({ + key: key, + value: map[key] + }); + return entries; + }; + d3.merge = function(arrays) { + var n = arrays.length, m, i = -1, j = 0, merged, array; + while (++i < n) j += arrays[i].length; + merged = new Array(j); + while (--n >= 0) { + array = arrays[n]; + m = array.length; + while (--m >= 0) { + merged[--j] = array[m]; + } + } + return merged; + }; + var abs = Math.abs; + d3.range = function(start, stop, step) { + if (arguments.length < 3) { + step = 1; + if (arguments.length < 2) { + stop = start; + start = 0; + } + } + if ((stop - start) / step === Infinity) throw new Error("infinite range"); + var range = [], k = d3_range_integerScale(abs(step)), i = -1, j; + start *= k, stop *= k, step *= k; + if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k); + return range; + }; + function d3_range_integerScale(x) { + var k = 1; + while (x * k % 1) k *= 10; + return k; + } + function d3_class(ctor, properties) { + for (var key in properties) { + Object.defineProperty(ctor.prototype, key, { + value: properties[key], + enumerable: false + }); + } + } + d3.map = function(object, f) { + var map = new d3_Map(); + if (object instanceof d3_Map) { + object.forEach(function(key, value) { + map.set(key, value); + }); + } else if (Array.isArray(object)) { + var i = -1, n = object.length, o; + if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o); + } else { + for (var key in object) map.set(key, object[key]); + } + return map; + }; + function d3_Map() { + this._ = Object.create(null); + } + var d3_map_proto = "__proto__", d3_map_zero = "\x00"; + d3_class(d3_Map, { + has: d3_map_has, + get: function(key) { + return this._[d3_map_escape(key)]; + }, + set: function(key, value) { + return this._[d3_map_escape(key)] = value; + }, + remove: d3_map_remove, + keys: d3_map_keys, + values: function() { + var values = []; + for (var key in this._) values.push(this._[key]); + return values; + }, + entries: function() { + var entries = []; + for (var key in this._) entries.push({ + key: d3_map_unescape(key), + value: this._[key] + }); + return entries; + }, + size: d3_map_size, + empty: d3_map_empty, + forEach: function(f) { + for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]); + } + }); + function d3_map_escape(key) { + return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key; + } + function d3_map_unescape(key) { + return (key += "")[0] === d3_map_zero ? key.slice(1) : key; + } + function d3_map_has(key) { + return d3_map_escape(key) in this._; + } + function d3_map_remove(key) { + return (key = d3_map_escape(key)) in this._ && delete this._[key]; + } + function d3_map_keys() { + var keys = []; + for (var key in this._) keys.push(d3_map_unescape(key)); + return keys; + } + function d3_map_size() { + var size = 0; + for (var key in this._) ++size; + return size; + } + function d3_map_empty() { + for (var key in this._) return false; + return true; + } + d3.nest = function() { + var nest = {}, keys = [], sortKeys = [], sortValues, rollup; + function map(mapType, array, depth) { + if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array; + var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values; + while (++i < n) { + if (values = valuesByKey.get(keyValue = key(object = array[i]))) { + values.push(object); + } else { + valuesByKey.set(keyValue, [ object ]); + } + } + if (mapType) { + object = mapType(); + setter = function(keyValue, values) { + object.set(keyValue, map(mapType, values, depth)); + }; + } else { + object = {}; + setter = function(keyValue, values) { + object[keyValue] = map(mapType, values, depth); + }; + } + valuesByKey.forEach(setter); + return object; + } + function entries(map, depth) { + if (depth >= keys.length) return map; + var array = [], sortKey = sortKeys[depth++]; + map.forEach(function(key, keyMap) { + array.push({ + key: key, + values: entries(keyMap, depth) + }); + }); + return sortKey ? array.sort(function(a, b) { + return sortKey(a.key, b.key); + }) : array; + } + nest.map = function(array, mapType) { + return map(mapType, array, 0); + }; + nest.entries = function(array) { + return entries(map(d3.map, array, 0), 0); + }; + nest.key = function(d) { + keys.push(d); + return nest; + }; + nest.sortKeys = function(order) { + sortKeys[keys.length - 1] = order; + return nest; + }; + nest.sortValues = function(order) { + sortValues = order; + return nest; + }; + nest.rollup = function(f) { + rollup = f; + return nest; + }; + return nest; + }; + d3.set = function(array) { + var set = new d3_Set(); + if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]); + return set; + }; + function d3_Set() { + this._ = Object.create(null); + } + d3_class(d3_Set, { + has: d3_map_has, + add: function(key) { + this._[d3_map_escape(key += "")] = true; + return key; + }, + remove: d3_map_remove, + values: d3_map_keys, + size: d3_map_size, + empty: d3_map_empty, + forEach: function(f) { + for (var key in this._) f.call(this, d3_map_unescape(key)); + } + }); + d3.behavior = {}; + function d3_identity(d) { + return d; + } + d3.rebind = function(target, source) { + var i = 1, n = arguments.length, method; + while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]); + return target; + }; + function d3_rebind(target, source, method) { + return function() { + var value = method.apply(source, arguments); + return value === source ? target : value; + }; + } + function d3_vendorSymbol(object, name) { + if (name in object) return name; + name = name.charAt(0).toUpperCase() + name.slice(1); + for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) { + var prefixName = d3_vendorPrefixes[i] + name; + if (prefixName in object) return prefixName; + } + } + var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ]; + function d3_noop() {} + d3.dispatch = function() { + var dispatch = new d3_dispatch(), i = -1, n = arguments.length; + while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); + return dispatch; + }; + function d3_dispatch() {} + d3_dispatch.prototype.on = function(type, listener) { + var i = type.indexOf("."), name = ""; + if (i >= 0) { + name = type.slice(i + 1); + type = type.slice(0, i); + } + if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener); + if (arguments.length === 2) { + if (listener == null) for (type in this) { + if (this.hasOwnProperty(type)) this[type].on(name, null); + } + return this; + } + }; + function d3_dispatch_event(dispatch) { + var listeners = [], listenerByName = new d3_Map(); + function event() { + var z = listeners, i = -1, n = z.length, l; + while (++i < n) if (l = z[i].on) l.apply(this, arguments); + return dispatch; + } + event.on = function(name, listener) { + var l = listenerByName.get(name), i; + if (arguments.length < 2) return l && l.on; + if (l) { + l.on = null; + listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1)); + listenerByName.remove(name); + } + if (listener) listeners.push(listenerByName.set(name, { + on: listener + })); + return dispatch; + }; + return event; + } + d3.event = null; + function d3_eventPreventDefault() { + d3.event.preventDefault(); + } + function d3_eventSource() { + var e = d3.event, s; + while (s = e.sourceEvent) e = s; + return e; + } + function d3_eventDispatch(target) { + var dispatch = new d3_dispatch(), i = 0, n = arguments.length; + while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); + dispatch.of = function(thiz, argumentz) { + return function(e1) { + try { + var e0 = e1.sourceEvent = d3.event; + e1.target = target; + d3.event = e1; + dispatch[e1.type].apply(thiz, argumentz); + } finally { + d3.event = e0; + } + }; + }; + return dispatch; + } + d3.requote = function(s) { + return s.replace(d3_requote_re, "\\$&"); + }; + var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; + var d3_subclass = {}.__proto__ ? function(object, prototype) { + object.__proto__ = prototype; + } : function(object, prototype) { + for (var property in prototype) object[property] = prototype[property]; + }; + function d3_selection(groups) { + d3_subclass(groups, d3_selectionPrototype); + return groups; + } + var d3_select = function(s, n) { + return n.querySelector(s); + }, d3_selectAll = function(s, n) { + return n.querySelectorAll(s); + }, d3_selectMatches = function(n, s) { + var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, "matchesSelector")]; + d3_selectMatches = function(n, s) { + return d3_selectMatcher.call(n, s); + }; + return d3_selectMatches(n, s); + }; + if (typeof Sizzle === "function") { + d3_select = function(s, n) { + return Sizzle(s, n)[0] || null; + }; + d3_selectAll = Sizzle; + d3_selectMatches = Sizzle.matchesSelector; + } + d3.selection = function() { + return d3.select(d3_document.documentElement); + }; + var d3_selectionPrototype = d3.selection.prototype = []; + d3_selectionPrototype.select = function(selector) { + var subgroups = [], subgroup, subnode, group, node; + selector = d3_selection_selector(selector); + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + subgroup.parentNode = (group = this[j]).parentNode; + for (var i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroup.push(subnode = selector.call(node, node.__data__, i, j)); + if (subnode && "__data__" in node) subnode.__data__ = node.__data__; + } else { + subgroup.push(null); + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_selector(selector) { + return typeof selector === "function" ? selector : function() { + return d3_select(selector, this); + }; + } + d3_selectionPrototype.selectAll = function(selector) { + var subgroups = [], subgroup, node; + selector = d3_selection_selectorAll(selector); + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j))); + subgroup.parentNode = node; + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_selectorAll(selector) { + return typeof selector === "function" ? selector : function() { + return d3_selectAll(selector, this); + }; + } + var d3_nsPrefix = { + 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/" + }; + d3.ns = { + prefix: d3_nsPrefix, + qualify: function(name) { + var i = name.indexOf(":"), prefix = name; + if (i >= 0) { + prefix = name.slice(0, i); + name = name.slice(i + 1); + } + return d3_nsPrefix.hasOwnProperty(prefix) ? { + space: d3_nsPrefix[prefix], + local: name + } : name; + } + }; + d3_selectionPrototype.attr = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") { + var node = this.node(); + name = d3.ns.qualify(name); + return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name); + } + for (value in name) this.each(d3_selection_attr(value, name[value])); + return this; + } + return this.each(d3_selection_attr(name, value)); + }; + function d3_selection_attr(name, value) { + name = d3.ns.qualify(name); + function attrNull() { + this.removeAttribute(name); + } + function attrNullNS() { + this.removeAttributeNS(name.space, name.local); + } + function attrConstant() { + this.setAttribute(name, value); + } + function attrConstantNS() { + this.setAttributeNS(name.space, name.local, value); + } + function attrFunction() { + var x = value.apply(this, arguments); + if (x == null) this.removeAttribute(name); else this.setAttribute(name, x); + } + function attrFunctionNS() { + var x = value.apply(this, arguments); + if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x); + } + return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant; + } + function d3_collapse(s) { + return s.trim().replace(/\s+/g, " "); + } + d3_selectionPrototype.classed = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") { + var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1; + if (value = node.classList) { + while (++i < n) if (!value.contains(name[i])) return false; + } else { + value = node.getAttribute("class"); + while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false; + } + return true; + } + for (value in name) this.each(d3_selection_classed(value, name[value])); + return this; + } + return this.each(d3_selection_classed(name, value)); + }; + function d3_selection_classedRe(name) { + return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g"); + } + function d3_selection_classes(name) { + return (name + "").trim().split(/^|\s+/); + } + function d3_selection_classed(name, value) { + name = d3_selection_classes(name).map(d3_selection_classedName); + var n = name.length; + function classedConstant() { + var i = -1; + while (++i < n) name[i](this, value); + } + function classedFunction() { + var i = -1, x = value.apply(this, arguments); + while (++i < n) name[i](this, x); + } + return typeof value === "function" ? classedFunction : classedConstant; + } + function d3_selection_classedName(name) { + var re = d3_selection_classedRe(name); + return function(node, value) { + if (c = node.classList) return value ? c.add(name) : c.remove(name); + var c = node.getAttribute("class") || ""; + if (value) { + re.lastIndex = 0; + if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name)); + } else { + node.setAttribute("class", d3_collapse(c.replace(re, " "))); + } + }; + } + d3_selectionPrototype.style = function(name, value, priority) { + var n = arguments.length; + if (n < 3) { + if (typeof name !== "string") { + if (n < 2) value = ""; + for (priority in name) this.each(d3_selection_style(priority, name[priority], value)); + return this; + } + if (n < 2) { + var node = this.node(); + return d3_window(node).getComputedStyle(node, null).getPropertyValue(name); + } + priority = ""; + } + return this.each(d3_selection_style(name, value, priority)); + }; + function d3_selection_style(name, value, priority) { + function styleNull() { + this.style.removeProperty(name); + } + function styleConstant() { + this.style.setProperty(name, value, priority); + } + function styleFunction() { + var x = value.apply(this, arguments); + if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority); + } + return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant; + } + d3_selectionPrototype.property = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") return this.node()[name]; + for (value in name) this.each(d3_selection_property(value, name[value])); + return this; + } + return this.each(d3_selection_property(name, value)); + }; + function d3_selection_property(name, value) { + function propertyNull() { + delete this[name]; + } + function propertyConstant() { + this[name] = value; + } + function propertyFunction() { + var x = value.apply(this, arguments); + if (x == null) delete this[name]; else this[name] = x; + } + return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; + } + d3_selectionPrototype.text = function(value) { + return arguments.length ? this.each(typeof value === "function" ? function() { + var v = value.apply(this, arguments); + this.textContent = v == null ? "" : v; + } : value == null ? function() { + this.textContent = ""; + } : function() { + this.textContent = value; + }) : this.node().textContent; + }; + d3_selectionPrototype.html = function(value) { + return arguments.length ? this.each(typeof value === "function" ? function() { + var v = value.apply(this, arguments); + this.innerHTML = v == null ? "" : v; + } : value == null ? function() { + this.innerHTML = ""; + } : function() { + this.innerHTML = value; + }) : this.node().innerHTML; + }; + d3_selectionPrototype.append = function(name) { + name = d3_selection_creator(name); + return this.select(function() { + return this.appendChild(name.apply(this, arguments)); + }); + }; + function d3_selection_creator(name) { + function create() { + var document = this.ownerDocument, namespace = this.namespaceURI; + return namespace ? document.createElementNS(namespace, name) : document.createElement(name); + } + function createNS() { + return this.ownerDocument.createElementNS(name.space, name.local); + } + return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? createNS : create; + } + d3_selectionPrototype.insert = function(name, before) { + name = d3_selection_creator(name); + before = d3_selection_selector(before); + return this.select(function() { + return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null); + }); + }; + d3_selectionPrototype.remove = function() { + return this.each(d3_selectionRemove); + }; + function d3_selectionRemove() { + var parent = this.parentNode; + if (parent) parent.removeChild(this); + } + d3_selectionPrototype.data = function(value, key) { + var i = -1, n = this.length, group, node; + if (!arguments.length) { + value = new Array(n = (group = this[0]).length); + while (++i < n) { + if (node = group[i]) { + value[i] = node.__data__; + } + } + return value; + } + function bind(group, groupData) { + var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData; + if (key) { + var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue; + for (i = -1; ++i < n; ) { + if (nodeByKeyValue.has(keyValue = key.call(node = group[i], node.__data__, i))) { + exitNodes[i] = node; + } else { + nodeByKeyValue.set(keyValue, node); + } + keyValues[i] = keyValue; + } + for (i = -1; ++i < m; ) { + if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) { + enterNodes[i] = d3_selection_dataNode(nodeData); + } else if (node !== true) { + updateNodes[i] = node; + node.__data__ = nodeData; + } + nodeByKeyValue.set(keyValue, true); + } + for (i = -1; ++i < n; ) { + if (nodeByKeyValue.get(keyValues[i]) !== true) { + exitNodes[i] = group[i]; + } + } + } else { + for (i = -1; ++i < n0; ) { + node = group[i]; + nodeData = groupData[i]; + if (node) { + node.__data__ = nodeData; + updateNodes[i] = node; + } else { + enterNodes[i] = d3_selection_dataNode(nodeData); + } + } + for (;i < m; ++i) { + enterNodes[i] = d3_selection_dataNode(groupData[i]); + } + for (;i < n; ++i) { + exitNodes[i] = group[i]; + } + } + enterNodes.update = updateNodes; + enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode; + enter.push(enterNodes); + update.push(updateNodes); + exit.push(exitNodes); + } + var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]); + if (typeof value === "function") { + while (++i < n) { + bind(group = this[i], value.call(group, group.parentNode.__data__, i)); + } + } else { + while (++i < n) { + bind(group = this[i], value); + } + } + update.enter = function() { + return enter; + }; + update.exit = function() { + return exit; + }; + return update; + }; + function d3_selection_dataNode(data) { + return { + __data__: data + }; + } + d3_selectionPrototype.datum = function(value) { + return arguments.length ? this.property("__data__", value) : this.property("__data__"); + }; + d3_selectionPrototype.filter = function(filter) { + var subgroups = [], subgroup, group, node; + if (typeof filter !== "function") filter = d3_selection_filter(filter); + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + subgroup.parentNode = (group = this[j]).parentNode; + for (var i = 0, n = group.length; i < n; i++) { + if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { + subgroup.push(node); + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_filter(selector) { + return function() { + return d3_selectMatches(this, selector); + }; + } + d3_selectionPrototype.order = function() { + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) { + if (node = group[i]) { + if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); + next = node; + } + } + } + return this; + }; + d3_selectionPrototype.sort = function(comparator) { + comparator = d3_selection_sortComparator.apply(this, arguments); + for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator); + return this.order(); + }; + function d3_selection_sortComparator(comparator) { + if (!arguments.length) comparator = d3_ascending; + return function(a, b) { + return a && b ? comparator(a.__data__, b.__data__) : !a - !b; + }; + } + d3_selectionPrototype.each = function(callback) { + return d3_selection_each(this, function(node, i, j) { + callback.call(node, node.__data__, i, j); + }); + }; + function d3_selection_each(groups, callback) { + for (var j = 0, m = groups.length; j < m; j++) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) { + if (node = group[i]) callback(node, i, j); + } + } + return groups; + } + d3_selectionPrototype.call = function(callback) { + var args = d3_array(arguments); + callback.apply(args[0] = this, args); + return this; + }; + d3_selectionPrototype.empty = function() { + return !this.node(); + }; + d3_selectionPrototype.node = function() { + for (var j = 0, m = this.length; j < m; j++) { + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + var node = group[i]; + if (node) return node; + } + } + return null; + }; + d3_selectionPrototype.size = function() { + var n = 0; + d3_selection_each(this, function() { + ++n; + }); + return n; + }; + function d3_selection_enter(selection) { + d3_subclass(selection, d3_selection_enterPrototype); + return selection; + } + var d3_selection_enterPrototype = []; + d3.selection.enter = d3_selection_enter; + d3.selection.enter.prototype = d3_selection_enterPrototype; + d3_selection_enterPrototype.append = d3_selectionPrototype.append; + d3_selection_enterPrototype.empty = d3_selectionPrototype.empty; + d3_selection_enterPrototype.node = d3_selectionPrototype.node; + d3_selection_enterPrototype.call = d3_selectionPrototype.call; + d3_selection_enterPrototype.size = d3_selectionPrototype.size; + d3_selection_enterPrototype.select = function(selector) { + var subgroups = [], subgroup, subnode, upgroup, group, node; + for (var j = -1, m = this.length; ++j < m; ) { + upgroup = (group = this[j]).update; + subgroups.push(subgroup = []); + subgroup.parentNode = group.parentNode; + for (var i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j)); + subnode.__data__ = node.__data__; + } else { + subgroup.push(null); + } + } + } + return d3_selection(subgroups); + }; + d3_selection_enterPrototype.insert = function(name, before) { + if (arguments.length < 2) before = d3_selection_enterInsertBefore(this); + return d3_selectionPrototype.insert.call(this, name, before); + }; + function d3_selection_enterInsertBefore(enter) { + var i0, j0; + return function(d, i, j) { + var group = enter[j].update, n = group.length, node; + if (j != j0) j0 = j, i0 = 0; + if (i >= i0) i0 = i + 1; + while (!(node = group[i0]) && ++i0 < n) ; + return node; + }; + } + d3.select = function(node) { + var group; + if (typeof node === "string") { + group = [ d3_select(node, d3_document) ]; + group.parentNode = d3_document.documentElement; + } else { + group = [ node ]; + group.parentNode = d3_documentElement(node); + } + return d3_selection([ group ]); + }; + d3.selectAll = function(nodes) { + var group; + if (typeof nodes === "string") { + group = d3_array(d3_selectAll(nodes, d3_document)); + group.parentNode = d3_document.documentElement; + } else { + group = nodes; + group.parentNode = null; + } + return d3_selection([ group ]); + }; + d3_selectionPrototype.on = function(type, listener, capture) { + var n = arguments.length; + if (n < 3) { + if (typeof type !== "string") { + if (n < 2) listener = false; + for (capture in type) this.each(d3_selection_on(capture, type[capture], listener)); + return this; + } + if (n < 2) return (n = this.node()["__on" + type]) && n._; + capture = false; + } + return this.each(d3_selection_on(type, listener, capture)); + }; + function d3_selection_on(type, listener, capture) { + var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener; + if (i > 0) type = type.slice(0, i); + var filter = d3_selection_onFilters.get(type); + if (filter) type = filter, wrap = d3_selection_onFilter; + function onRemove() { + var l = this[name]; + if (l) { + this.removeEventListener(type, l, l.$); + delete this[name]; + } + } + function onAdd() { + var l = wrap(listener, d3_array(arguments)); + onRemove.call(this); + this.addEventListener(type, this[name] = l, l.$ = capture); + l._ = listener; + } + function removeAll() { + var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match; + for (var name in this) { + if (match = name.match(re)) { + var l = this[name]; + this.removeEventListener(match[1], l, l.$); + delete this[name]; + } + } + } + return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll; + } + var d3_selection_onFilters = d3.map({ + mouseenter: "mouseover", + mouseleave: "mouseout" + }); + if (d3_document) { + d3_selection_onFilters.forEach(function(k) { + if ("on" + k in d3_document) d3_selection_onFilters.remove(k); + }); + } + function d3_selection_onListener(listener, argumentz) { + return function(e) { + var o = d3.event; + d3.event = e; + argumentz[0] = this.__data__; + try { + listener.apply(this, argumentz); + } finally { + d3.event = o; + } + }; + } + function d3_selection_onFilter(listener, argumentz) { + var l = d3_selection_onListener(listener, argumentz); + return function(e) { + var target = this, related = e.relatedTarget; + if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) { + l.call(target, e); + } + }; + } + var d3_event_dragSelect, d3_event_dragId = 0; + function d3_event_dragSuppress(node) { + var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window(node)).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault); + if (d3_event_dragSelect == null) { + d3_event_dragSelect = "onselectstart" in node ? false : d3_vendorSymbol(node.style, "userSelect"); + } + if (d3_event_dragSelect) { + var style = d3_documentElement(node).style, select = style[d3_event_dragSelect]; + style[d3_event_dragSelect] = "none"; + } + return function(suppressClick) { + w.on(name, null); + if (d3_event_dragSelect) style[d3_event_dragSelect] = select; + if (suppressClick) { + var off = function() { + w.on(click, null); + }; + w.on(click, function() { + d3_eventPreventDefault(); + off(); + }, true); + setTimeout(off, 0); + } + }; + } + d3.mouse = function(container) { + return d3_mousePoint(container, d3_eventSource()); + }; + var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0; + function d3_mousePoint(container, e) { + if (e.changedTouches) e = e.changedTouches[0]; + var svg = container.ownerSVGElement || container; + if (svg.createSVGPoint) { + var point = svg.createSVGPoint(); + if (d3_mouse_bug44083 < 0) { + var window = d3_window(container); + if (window.scrollX || window.scrollY) { + svg = d3.select("body").append("svg").style({ + position: "absolute", + top: 0, + left: 0, + margin: 0, + padding: 0, + border: "none" + }, "important"); + var ctm = svg[0][0].getScreenCTM(); + d3_mouse_bug44083 = !(ctm.f || ctm.e); + svg.remove(); + } + } + if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, + point.y = e.clientY; + point = point.matrixTransform(container.getScreenCTM().inverse()); + return [ point.x, point.y ]; + } + var rect = container.getBoundingClientRect(); + return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ]; + } + d3.touch = function(container, touches, identifier) { + if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches; + if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) { + if ((touch = touches[i]).identifier === identifier) { + return d3_mousePoint(container, touch); + } + } + }; + d3.behavior.drag = function() { + var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, "touchmove", "touchend"); + function drag() { + this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart); + } + function dragstart(id, position, subject, move, end) { + return function() { + var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId); + if (origin) { + dragOffset = origin.apply(that, arguments); + dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ]; + } else { + dragOffset = [ 0, 0 ]; + } + dispatch({ + type: "dragstart" + }); + function moved() { + var position1 = position(parent, dragId), dx, dy; + if (!position1) return; + dx = position1[0] - position0[0]; + dy = position1[1] - position0[1]; + dragged |= dx | dy; + position0 = position1; + dispatch({ + type: "drag", + x: position1[0] + dragOffset[0], + y: position1[1] + dragOffset[1], + dx: dx, + dy: dy + }); + } + function ended() { + if (!position(parent, dragId)) return; + dragSubject.on(move + dragName, null).on(end + dragName, null); + dragRestore(dragged && d3.event.target === target); + dispatch({ + type: "dragend" + }); + } + }; + } + drag.origin = function(x) { + if (!arguments.length) return origin; + origin = x; + return drag; + }; + return d3.rebind(drag, event, "on"); + }; + function d3_behavior_dragTouchId() { + return d3.event.changedTouches[0].identifier; + } + d3.touches = function(container, touches) { + if (arguments.length < 2) touches = d3_eventSource().touches; + return touches ? d3_array(touches).map(function(touch) { + var point = d3_mousePoint(container, touch); + point.identifier = touch.identifier; + return point; + }) : []; + }; + var ε = 1e-6, ε2 = ε * ε, Ï€ = Math.PI, Ï„ = 2 * Ï€, τε = Ï„ - ε, halfÏ€ = Ï€ / 2, d3_radians = Ï€ / 180, d3_degrees = 180 / Ï€; + function d3_sgn(x) { + return x > 0 ? 1 : x < 0 ? -1 : 0; + } + function d3_cross2d(a, b, c) { + return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); + } + function d3_acos(x) { + return x > 1 ? 0 : x < -1 ? Ï€ : Math.acos(x); + } + function d3_asin(x) { + return x > 1 ? halfÏ€ : x < -1 ? -halfÏ€ : Math.asin(x); + } + function d3_sinh(x) { + return ((x = Math.exp(x)) - 1 / x) / 2; + } + function d3_cosh(x) { + return ((x = Math.exp(x)) + 1 / x) / 2; + } + function d3_tanh(x) { + return ((x = Math.exp(2 * x)) - 1) / (x + 1); + } + function d3_haversin(x) { + return (x = Math.sin(x / 2)) * x; + } + var Ï = Math.SQRT2, Ï2 = 2, Ï4 = 4; + d3.interpolateZoom = function(p0, p1) { + var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2]; + var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + Ï4 * d2) / (2 * w0 * Ï2 * d1), b1 = (w1 * w1 - w0 * w0 - Ï4 * d2) / (2 * w1 * Ï2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / Ï; + function interpolate(t) { + var s = t * S; + if (dr) { + var coshr0 = d3_cosh(r0), u = w0 / (Ï2 * d1) * (coshr0 * d3_tanh(Ï * s + r0) - d3_sinh(r0)); + return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(Ï * s + r0) ]; + } + return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(Ï * s) ]; + } + interpolate.duration = S * 1e3; + return interpolate; + }; + d3.behavior.zoom = function() { + var view = { + x: 0, + y: 0, + k: 1 + }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1; + if (!d3_behavior_zoomWheel) { + d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() { + return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); + }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() { + return d3.event.wheelDelta; + }, "mousewheel") : (d3_behavior_zoomDelta = function() { + return -d3.event.detail; + }, "MozMousePixelScroll"); + } + function zoom(g) { + g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted); + } + zoom.event = function(g) { + g.each(function() { + var dispatch = event.of(this, arguments), view1 = view; + if (d3_transitionInheritId) { + d3.select(this).transition().each("start.zoom", function() { + view = this.__chart__ || { + x: 0, + y: 0, + k: 1 + }; + zoomstarted(dispatch); + }).tween("zoom:zoom", function() { + var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]); + return function(t) { + var l = i(t), k = dx / l[2]; + this.__chart__ = view = { + x: cx - l[0] * k, + y: cy - l[1] * k, + k: k + }; + zoomed(dispatch); + }; + }).each("interrupt.zoom", function() { + zoomended(dispatch); + }).each("end.zoom", function() { + zoomended(dispatch); + }); + } else { + this.__chart__ = view; + zoomstarted(dispatch); + zoomed(dispatch); + zoomended(dispatch); + } + }); + }; + zoom.translate = function(_) { + if (!arguments.length) return [ view.x, view.y ]; + view = { + x: +_[0], + y: +_[1], + k: view.k + }; + rescale(); + return zoom; + }; + zoom.scale = function(_) { + if (!arguments.length) return view.k; + view = { + x: view.x, + y: view.y, + k: +_ + }; + rescale(); + return zoom; + }; + zoom.scaleExtent = function(_) { + if (!arguments.length) return scaleExtent; + scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ]; + return zoom; + }; + zoom.center = function(_) { + if (!arguments.length) return center; + center = _ && [ +_[0], +_[1] ]; + return zoom; + }; + zoom.size = function(_) { + if (!arguments.length) return size; + size = _ && [ +_[0], +_[1] ]; + return zoom; + }; + zoom.duration = function(_) { + if (!arguments.length) return duration; + duration = +_; + return zoom; + }; + zoom.x = function(z) { + if (!arguments.length) return x1; + x1 = z; + x0 = z.copy(); + view = { + x: 0, + y: 0, + k: 1 + }; + return zoom; + }; + zoom.y = function(z) { + if (!arguments.length) return y1; + y1 = z; + y0 = z.copy(); + view = { + x: 0, + y: 0, + k: 1 + }; + return zoom; + }; + function location(p) { + return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ]; + } + function point(l) { + return [ l[0] * view.k + view.x, l[1] * view.k + view.y ]; + } + function scaleTo(s) { + view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s)); + } + function translateTo(p, l) { + l = point(l); + view.x += p[0] - l[0]; + view.y += p[1] - l[1]; + } + function zoomTo(that, p, l, k) { + that.__chart__ = { + x: view.x, + y: view.y, + k: view.k + }; + scaleTo(Math.pow(2, k)); + translateTo(center0 = p, l); + that = d3.select(that); + if (duration > 0) that = that.transition().duration(duration); + that.call(zoom.event); + } + function rescale() { + if (x1) x1.domain(x0.range().map(function(x) { + return (x - view.x) / view.k; + }).map(x0.invert)); + if (y1) y1.domain(y0.range().map(function(y) { + return (y - view.y) / view.k; + }).map(y0.invert)); + } + function zoomstarted(dispatch) { + if (!zooming++) dispatch({ + type: "zoomstart" + }); + } + function zoomed(dispatch) { + rescale(); + dispatch({ + type: "zoom", + scale: view.k, + translate: [ view.x, view.y ] + }); + } + function zoomended(dispatch) { + if (!--zooming) dispatch({ + type: "zoomend" + }), center0 = null; + } + function mousedowned() { + var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that); + d3_selection_interrupt.call(that); + zoomstarted(dispatch); + function moved() { + dragged = 1; + translateTo(d3.mouse(that), location0); + zoomed(dispatch); + } + function ended() { + subject.on(mousemove, null).on(mouseup, null); + dragRestore(dragged && d3.event.target === target); + zoomended(dispatch); + } + } + function touchstarted() { + var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that); + started(); + zoomstarted(dispatch); + subject.on(mousedown, null).on(touchstart, started); + function relocate() { + var touches = d3.touches(that); + scale0 = view.k; + touches.forEach(function(t) { + if (t.identifier in locations0) locations0[t.identifier] = location(t); + }); + return touches; + } + function started() { + var target = d3.event.target; + d3.select(target).on(touchmove, moved).on(touchend, ended); + targets.push(target); + var changed = d3.event.changedTouches; + for (var i = 0, n = changed.length; i < n; ++i) { + locations0[changed[i].identifier] = null; + } + var touches = relocate(), now = Date.now(); + if (touches.length === 1) { + if (now - touchtime < 500) { + var p = touches[0]; + zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1); + d3_eventPreventDefault(); + } + touchtime = now; + } else if (touches.length > 1) { + var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1]; + distance0 = dx * dx + dy * dy; + } + } + function moved() { + var touches = d3.touches(that), p0, l0, p1, l1; + d3_selection_interrupt.call(that); + for (var i = 0, n = touches.length; i < n; ++i, l1 = null) { + p1 = touches[i]; + if (l1 = locations0[p1.identifier]) { + if (l0) break; + p0 = p1, l0 = l1; + } + } + if (l1) { + var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0); + p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ]; + l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ]; + scaleTo(scale1 * scale0); + } + touchtime = null; + translateTo(p0, l0); + zoomed(dispatch); + } + function ended() { + if (d3.event.touches.length) { + var changed = d3.event.changedTouches; + for (var i = 0, n = changed.length; i < n; ++i) { + delete locations0[changed[i].identifier]; + } + for (var identifier in locations0) { + return void relocate(); + } + } + d3.selectAll(targets).on(zoomName, null); + subject.on(mousedown, mousedowned).on(touchstart, touchstarted); + dragRestore(); + zoomended(dispatch); + } + } + function mousewheeled() { + var dispatch = event.of(this, arguments); + if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), + translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch); + mousewheelTimer = setTimeout(function() { + mousewheelTimer = null; + zoomended(dispatch); + }, 50); + d3_eventPreventDefault(); + scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k); + translateTo(center0, translate0); + zoomed(dispatch); + } + function dblclicked() { + var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2; + zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1); + } + return d3.rebind(zoom, event, "on"); + }; + var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel; + d3.color = d3_color; + function d3_color() {} + d3_color.prototype.toString = function() { + return this.rgb() + ""; + }; + d3.hsl = d3_hsl; + function d3_hsl(h, s, l) { + return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l); + } + var d3_hslPrototype = d3_hsl.prototype = new d3_color(); + d3_hslPrototype.brighter = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_hsl(this.h, this.s, this.l / k); + }; + d3_hslPrototype.darker = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_hsl(this.h, this.s, k * this.l); + }; + d3_hslPrototype.rgb = function() { + return d3_hsl_rgb(this.h, this.s, this.l); + }; + function d3_hsl_rgb(h, s, l) { + var m1, m2; + h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h; + s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s; + l = l < 0 ? 0 : l > 1 ? 1 : l; + m2 = l <= .5 ? l * (1 + s) : l + s - l * s; + m1 = 2 * l - m2; + function v(h) { + if (h > 360) h -= 360; else if (h < 0) h += 360; + if (h < 60) return m1 + (m2 - m1) * h / 60; + if (h < 180) return m2; + if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60; + return m1; + } + function vv(h) { + return Math.round(v(h) * 255); + } + return new d3_rgb(vv(h + 120), vv(h), vv(h - 120)); + } + d3.hcl = d3_hcl; + function d3_hcl(h, c, l) { + return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l); + } + var d3_hclPrototype = d3_hcl.prototype = new d3_color(); + d3_hclPrototype.brighter = function(k) { + return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1))); + }; + d3_hclPrototype.darker = function(k) { + return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1))); + }; + d3_hclPrototype.rgb = function() { + return d3_hcl_lab(this.h, this.c, this.l).rgb(); + }; + function d3_hcl_lab(h, c, l) { + if (isNaN(h)) h = 0; + if (isNaN(c)) c = 0; + return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c); + } + d3.lab = d3_lab; + function d3_lab(l, a, b) { + return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b); + } + var d3_lab_K = 18; + var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883; + var d3_labPrototype = d3_lab.prototype = new d3_color(); + d3_labPrototype.brighter = function(k) { + return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); + }; + d3_labPrototype.darker = function(k) { + return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); + }; + d3_labPrototype.rgb = function() { + return d3_lab_rgb(this.l, this.a, this.b); + }; + function d3_lab_rgb(l, a, b) { + var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200; + x = d3_lab_xyz(x) * d3_lab_X; + y = d3_lab_xyz(y) * d3_lab_Y; + z = d3_lab_xyz(z) * d3_lab_Z; + return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z)); + } + function d3_lab_hcl(l, a, b) { + return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l); + } + function d3_lab_xyz(x) { + return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037; + } + function d3_xyz_lab(x) { + return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29; + } + function d3_xyz_rgb(r) { + return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055)); + } + d3.rgb = d3_rgb; + function d3_rgb(r, g, b) { + return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b); + } + function d3_rgbNumber(value) { + return new d3_rgb(value >> 16, value >> 8 & 255, value & 255); + } + function d3_rgbString(value) { + return d3_rgbNumber(value) + ""; + } + var d3_rgbPrototype = d3_rgb.prototype = new d3_color(); + d3_rgbPrototype.brighter = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + var r = this.r, g = this.g, b = this.b, i = 30; + if (!r && !g && !b) return new d3_rgb(i, i, i); + if (r && r < i) r = i; + if (g && g < i) g = i; + if (b && b < i) b = i; + return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k)); + }; + d3_rgbPrototype.darker = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_rgb(k * this.r, k * this.g, k * this.b); + }; + d3_rgbPrototype.hsl = function() { + return d3_rgb_hsl(this.r, this.g, this.b); + }; + d3_rgbPrototype.toString = function() { + return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b); + }; + function d3_rgb_hex(v) { + return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16); + } + function d3_rgb_parse(format, rgb, hsl) { + format = format.toLowerCase(); + var r = 0, g = 0, b = 0, m1, m2, color; + m1 = /([a-z]+)\((.*)\)/.exec(format); + if (m1) { + m2 = m1[2].split(","); + switch (m1[1]) { + case "hsl": + { + return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100); + } + + case "rgb": + { + return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2])); + } + } + } + if (color = d3_rgb_names.get(format)) { + return rgb(color.r, color.g, color.b); + } + if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) { + if (format.length === 4) { + r = (color & 3840) >> 4; + r = r >> 4 | r; + g = color & 240; + g = g >> 4 | g; + b = color & 15; + b = b << 4 | b; + } else if (format.length === 7) { + r = (color & 16711680) >> 16; + g = (color & 65280) >> 8; + b = color & 255; + } + } + return rgb(r, g, b); + } + function d3_rgb_hsl(r, g, b) { + var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2; + if (d) { + s = l < .5 ? d / (max + min) : d / (2 - max - min); + if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4; + h *= 60; + } else { + h = NaN; + s = l > 0 && l < 1 ? 0 : h; + } + return new d3_hsl(h, s, l); + } + function d3_rgb_lab(r, g, b) { + r = d3_rgb_xyz(r); + g = d3_rgb_xyz(g); + b = d3_rgb_xyz(b); + var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z); + return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z)); + } + function d3_rgb_xyz(r) { + return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4); + } + function d3_rgb_parseNumber(c) { + var f = parseFloat(c); + return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f; + } + var d3_rgb_names = d3.map({ + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + rebeccapurple: 6697881, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 + }); + d3_rgb_names.forEach(function(key, value) { + d3_rgb_names.set(key, d3_rgbNumber(value)); + }); + function d3_functor(v) { + return typeof v === "function" ? v : function() { + return v; + }; + } + d3.functor = d3_functor; + d3.xhr = d3_xhrType(d3_identity); + function d3_xhrType(response) { + return function(url, mimeType, callback) { + if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, + mimeType = null; + return d3_xhr(url, mimeType, response, callback); + }; + } + function d3_xhr(url, mimeType, response, callback) { + var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null; + if (this.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest(); + "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() { + request.readyState > 3 && respond(); + }; + function respond() { + var status = request.status, result; + if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) { + try { + result = response.call(xhr, request); + } catch (e) { + dispatch.error.call(xhr, e); + return; + } + dispatch.load.call(xhr, result); + } else { + dispatch.error.call(xhr, request); + } + } + request.onprogress = function(event) { + var o = d3.event; + d3.event = event; + try { + dispatch.progress.call(xhr, request); + } finally { + d3.event = o; + } + }; + xhr.header = function(name, value) { + name = (name + "").toLowerCase(); + if (arguments.length < 2) return headers[name]; + if (value == null) delete headers[name]; else headers[name] = value + ""; + return xhr; + }; + xhr.mimeType = function(value) { + if (!arguments.length) return mimeType; + mimeType = value == null ? null : value + ""; + return xhr; + }; + xhr.responseType = function(value) { + if (!arguments.length) return responseType; + responseType = value; + return xhr; + }; + xhr.response = function(value) { + response = value; + return xhr; + }; + [ "get", "post" ].forEach(function(method) { + xhr[method] = function() { + return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments))); + }; + }); + xhr.send = function(method, data, callback) { + if (arguments.length === 2 && typeof data === "function") callback = data, data = null; + request.open(method, url, true); + if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*"; + if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]); + if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType); + if (responseType != null) request.responseType = responseType; + if (callback != null) xhr.on("error", callback).on("load", function(request) { + callback(null, request); + }); + dispatch.beforesend.call(xhr, request); + request.send(data == null ? null : data); + return xhr; + }; + xhr.abort = function() { + request.abort(); + return xhr; + }; + d3.rebind(xhr, dispatch, "on"); + return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback)); + } + function d3_xhr_fixCallback(callback) { + return callback.length === 1 ? function(error, request) { + callback(error == null ? request : null); + } : callback; + } + function d3_xhrHasResponse(request) { + var type = request.responseType; + return type && type !== "text" ? request.response : request.responseText; + } + d3.dsv = function(delimiter, mimeType) { + var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0); + function dsv(url, row, callback) { + if (arguments.length < 3) callback = row, row = null; + var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback); + xhr.row = function(_) { + return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row; + }; + return xhr; + } + function response(request) { + return dsv.parse(request.responseText); + } + function typedResponse(f) { + return function(request) { + return dsv.parse(request.responseText, f); + }; + } + dsv.parse = function(text, f) { + var o; + return dsv.parseRows(text, function(row, i) { + if (o) return o(row, i - 1); + var a = new Function("d", "return {" + row.map(function(name, i) { + return JSON.stringify(name) + ": d[" + i + "]"; + }).join(",") + "}"); + o = f ? function(row, i) { + return f(a(row), i); + } : a; + }); + }; + dsv.parseRows = function(text, f) { + var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; + function token() { + if (I >= N) return EOF; + if (eol) return eol = false, EOL; + var j = I; + if (text.charCodeAt(j) === 34) { + var i = j; + while (i++ < N) { + if (text.charCodeAt(i) === 34) { + if (text.charCodeAt(i + 1) !== 34) break; + ++i; + } + } + I = i + 2; + var c = text.charCodeAt(i + 1); + if (c === 13) { + eol = true; + if (text.charCodeAt(i + 2) === 10) ++I; + } else if (c === 10) { + eol = true; + } + return text.slice(j + 1, i).replace(/""/g, '"'); + } + while (I < N) { + var c = text.charCodeAt(I++), k = 1; + if (c === 10) eol = true; else if (c === 13) { + eol = true; + if (text.charCodeAt(I) === 10) ++I, ++k; + } else if (c !== delimiterCode) continue; + return text.slice(j, I - k); + } + return text.slice(j); + } + while ((t = token()) !== EOF) { + var a = []; + while (t !== EOL && t !== EOF) { + a.push(t); + t = token(); + } + if (f && (a = f(a, n++)) == null) continue; + rows.push(a); + } + return rows; + }; + dsv.format = function(rows) { + if (Array.isArray(rows[0])) return dsv.formatRows(rows); + var fieldSet = new d3_Set(), fields = []; + rows.forEach(function(row) { + for (var field in row) { + if (!fieldSet.has(field)) { + fields.push(fieldSet.add(field)); + } + } + }); + return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) { + return fields.map(function(field) { + return formatValue(row[field]); + }).join(delimiter); + })).join("\n"); + }; + dsv.formatRows = function(rows) { + return rows.map(formatRow).join("\n"); + }; + function formatRow(row) { + return row.map(formatValue).join(delimiter); + } + function formatValue(text) { + return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text; + } + return dsv; + }; + d3.csv = d3.dsv(",", "text/csv"); + d3.tsv = d3.dsv(" ", "text/tab-separated-values"); + var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) { + setTimeout(callback, 17); + }; + d3.timer = function(callback, delay, then) { + var n = arguments.length; + if (n < 2) delay = 0; + if (n < 3) then = Date.now(); + var time = then + delay, timer = { + c: callback, + t: time, + f: false, + n: null + }; + if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer; + d3_timer_queueTail = timer; + if (!d3_timer_interval) { + d3_timer_timeout = clearTimeout(d3_timer_timeout); + d3_timer_interval = 1; + d3_timer_frame(d3_timer_step); + } + }; + function d3_timer_step() { + var now = d3_timer_mark(), delay = d3_timer_sweep() - now; + if (delay > 24) { + if (isFinite(delay)) { + clearTimeout(d3_timer_timeout); + d3_timer_timeout = setTimeout(d3_timer_step, delay); + } + d3_timer_interval = 0; + } else { + d3_timer_interval = 1; + d3_timer_frame(d3_timer_step); + } + } + d3.timer.flush = function() { + d3_timer_mark(); + d3_timer_sweep(); + }; + function d3_timer_mark() { + var now = Date.now(); + d3_timer_active = d3_timer_queueHead; + while (d3_timer_active) { + if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t); + d3_timer_active = d3_timer_active.n; + } + return now; + } + function d3_timer_sweep() { + var t0, t1 = d3_timer_queueHead, time = Infinity; + while (t1) { + if (t1.f) { + t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n; + } else { + if (t1.t < time) time = t1.t; + t1 = (t0 = t1).n; + } + } + d3_timer_queueTail = t0; + return time; + } + function d3_format_precision(x, p) { + return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1); + } + d3.round = function(x, n) { + return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x); + }; + var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix); + d3.formatPrefix = function(value, precision) { + var i = 0; + if (value) { + if (value < 0) value *= -1; + if (precision) value = d3.round(value, d3_format_precision(value, precision)); + i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); + i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3)); + } + return d3_formatPrefixes[8 + i / 3]; + }; + function d3_formatPrefix(d, i) { + var k = Math.pow(10, abs(8 - i) * 3); + return { + scale: i > 8 ? function(d) { + return d / k; + } : function(d) { + return d * k; + }, + symbol: d + }; + } + function d3_locale_numberFormat(locale) { + var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) { + var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0; + while (i > 0 && g > 0) { + if (length + g + 1 > width) g = Math.max(1, width - length); + t.push(value.substring(i -= g, i + g)); + if ((length += g + 1) > width) break; + g = locale_grouping[j = (j + 1) % locale_grouping.length]; + } + return t.reverse().join(locale_thousands); + } : d3_identity; + return function(specifier) { + var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true; + if (precision) precision = +precision.substring(1); + if (zfill || fill === "0" && align === "=") { + zfill = fill = "0"; + align = "="; + } + switch (type) { + case "n": + comma = true; + type = "g"; + break; + + case "%": + scale = 100; + suffix = "%"; + type = "f"; + break; + + case "p": + scale = 100; + suffix = "%"; + type = "r"; + break; + + case "b": + case "o": + case "x": + case "X": + if (symbol === "#") prefix = "0" + type.toLowerCase(); + + case "c": + exponent = false; + + case "d": + integer = true; + precision = 0; + break; + + case "s": + scale = -1; + type = "r"; + break; + } + if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1]; + if (type == "r" && !precision) type = "g"; + if (precision != null) { + if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision)); + } + type = d3_format_types.get(type) || d3_format_typeDefault; + var zcomma = zfill && comma; + return function(value) { + var fullSuffix = suffix; + if (integer && value % 1) return ""; + var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign; + if (scale < 0) { + var unit = d3.formatPrefix(value, precision); + value = unit.scale(value); + fullSuffix = unit.symbol + suffix; + } else { + value *= scale; + } + value = type(value, precision); + var i = value.lastIndexOf("."), before, after; + if (i < 0) { + var j = exponent ? value.lastIndexOf("e") : -1; + if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j); + } else { + before = value.substring(0, i); + after = locale_decimal + value.substring(i + 1); + } + if (!zfill && comma) before = formatGroup(before, Infinity); + var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : ""; + if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity); + negative += prefix; + value = before + after; + return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix; + }; + }; + } + var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i; + var d3_format_types = d3.map({ + b: function(x) { + return x.toString(2); + }, + c: function(x) { + return String.fromCharCode(x); + }, + o: function(x) { + return x.toString(8); + }, + x: function(x) { + return x.toString(16); + }, + X: function(x) { + return x.toString(16).toUpperCase(); + }, + g: function(x, p) { + return x.toPrecision(p); + }, + e: function(x, p) { + return x.toExponential(p); + }, + f: function(x, p) { + return x.toFixed(p); + }, + r: function(x, p) { + return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p)))); + } + }); + function d3_format_typeDefault(x) { + return x + ""; + } + var d3_time = d3.time = {}, d3_date = Date; + function d3_date_utc() { + this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]); + } + d3_date_utc.prototype = { + getDate: function() { + return this._.getUTCDate(); + }, + getDay: function() { + return this._.getUTCDay(); + }, + getFullYear: function() { + return this._.getUTCFullYear(); + }, + getHours: function() { + return this._.getUTCHours(); + }, + getMilliseconds: function() { + return this._.getUTCMilliseconds(); + }, + getMinutes: function() { + return this._.getUTCMinutes(); + }, + getMonth: function() { + return this._.getUTCMonth(); + }, + getSeconds: function() { + return this._.getUTCSeconds(); + }, + getTime: function() { + return this._.getTime(); + }, + getTimezoneOffset: function() { + return 0; + }, + valueOf: function() { + return this._.valueOf(); + }, + setDate: function() { + d3_time_prototype.setUTCDate.apply(this._, arguments); + }, + setDay: function() { + d3_time_prototype.setUTCDay.apply(this._, arguments); + }, + setFullYear: function() { + d3_time_prototype.setUTCFullYear.apply(this._, arguments); + }, + setHours: function() { + d3_time_prototype.setUTCHours.apply(this._, arguments); + }, + setMilliseconds: function() { + d3_time_prototype.setUTCMilliseconds.apply(this._, arguments); + }, + setMinutes: function() { + d3_time_prototype.setUTCMinutes.apply(this._, arguments); + }, + setMonth: function() { + d3_time_prototype.setUTCMonth.apply(this._, arguments); + }, + setSeconds: function() { + d3_time_prototype.setUTCSeconds.apply(this._, arguments); + }, + setTime: function() { + d3_time_prototype.setTime.apply(this._, arguments); + } + }; + var d3_time_prototype = Date.prototype; + function d3_time_interval(local, step, number) { + function round(date) { + var d0 = local(date), d1 = offset(d0, 1); + return date - d0 < d1 - date ? d0 : d1; + } + function ceil(date) { + step(date = local(new d3_date(date - 1)), 1); + return date; + } + function offset(date, k) { + step(date = new d3_date(+date), k); + return date; + } + function range(t0, t1, dt) { + var time = ceil(t0), times = []; + if (dt > 1) { + while (time < t1) { + if (!(number(time) % dt)) times.push(new Date(+time)); + step(time, 1); + } + } else { + while (time < t1) times.push(new Date(+time)), step(time, 1); + } + return times; + } + function range_utc(t0, t1, dt) { + try { + d3_date = d3_date_utc; + var utc = new d3_date_utc(); + utc._ = t0; + return range(utc, t1, dt); + } finally { + d3_date = Date; + } + } + local.floor = local; + local.round = round; + local.ceil = ceil; + local.offset = offset; + local.range = range; + var utc = local.utc = d3_time_interval_utc(local); + utc.floor = utc; + utc.round = d3_time_interval_utc(round); + utc.ceil = d3_time_interval_utc(ceil); + utc.offset = d3_time_interval_utc(offset); + utc.range = range_utc; + return local; + } + function d3_time_interval_utc(method) { + return function(date, k) { + try { + d3_date = d3_date_utc; + var utc = new d3_date_utc(); + utc._ = date; + return method(utc, k)._; + } finally { + d3_date = Date; + } + }; + } + d3_time.year = d3_time_interval(function(date) { + date = d3_time.day(date); + date.setMonth(0, 1); + return date; + }, function(date, offset) { + date.setFullYear(date.getFullYear() + offset); + }, function(date) { + return date.getFullYear(); + }); + d3_time.years = d3_time.year.range; + d3_time.years.utc = d3_time.year.utc.range; + d3_time.day = d3_time_interval(function(date) { + var day = new d3_date(2e3, 0); + day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); + return day; + }, function(date, offset) { + date.setDate(date.getDate() + offset); + }, function(date) { + return date.getDate() - 1; + }); + d3_time.days = d3_time.day.range; + d3_time.days.utc = d3_time.day.utc.range; + d3_time.dayOfYear = function(date) { + var year = d3_time.year(date); + return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5); + }; + [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) { + i = 7 - i; + var interval = d3_time[day] = d3_time_interval(function(date) { + (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7); + return date; + }, function(date, offset) { + date.setDate(date.getDate() + Math.floor(offset) * 7); + }, function(date) { + var day = d3_time.year(date).getDay(); + return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i); + }); + d3_time[day + "s"] = interval.range; + d3_time[day + "s"].utc = interval.utc.range; + d3_time[day + "OfYear"] = function(date) { + var day = d3_time.year(date).getDay(); + return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7); + }; + }); + d3_time.week = d3_time.sunday; + d3_time.weeks = d3_time.sunday.range; + d3_time.weeks.utc = d3_time.sunday.utc.range; + d3_time.weekOfYear = d3_time.sundayOfYear; + function d3_locale_timeFormat(locale) { + var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths; + function d3_time_format(template) { + var n = template.length; + function format(date) { + var string = [], i = -1, j = 0, c, p, f; + while (++i < n) { + if (template.charCodeAt(i) === 37) { + string.push(template.slice(j, i)); + if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); + if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); + string.push(c); + j = i + 1; + } + } + string.push(template.slice(j, i)); + return string.join(""); + } + format.parse = function(string) { + var d = { + y: 1900, + m: 0, + d: 1, + H: 0, + M: 0, + S: 0, + L: 0, + Z: null + }, i = d3_time_parse(d, template, string, 0); + if (i != string.length) return null; + if ("p" in d) d.H = d.H % 12 + d.p * 12; + var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)(); + if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) { + date.setFullYear(d.y, 0, 1); + date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7); + } else date.setFullYear(d.y, d.m, d.d); + date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L); + return localZ ? date._ : date; + }; + format.toString = function() { + return template; + }; + return format; + } + function d3_time_parse(date, template, string, j) { + var c, p, t, i = 0, n = template.length, m = string.length; + while (i < n) { + if (j >= m) return -1; + c = template.charCodeAt(i++); + if (c === 37) { + t = template.charAt(i++); + p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t]; + if (!p || (j = p(date, string, j)) < 0) return -1; + } else if (c != string.charCodeAt(j++)) { + return -1; + } + } + return j; + } + d3_time_format.utc = function(template) { + var local = d3_time_format(template); + function format(date) { + try { + d3_date = d3_date_utc; + var utc = new d3_date(); + utc._ = date; + return local(utc); + } finally { + d3_date = Date; + } + } + format.parse = function(string) { + try { + d3_date = d3_date_utc; + var date = local.parse(string); + return date && date._; + } finally { + d3_date = Date; + } + }; + format.toString = local.toString; + return format; + }; + d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti; + var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths); + locale_periods.forEach(function(p, i) { + d3_time_periodLookup.set(p.toLowerCase(), i); + }); + var d3_time_formats = { + a: function(d) { + return locale_shortDays[d.getDay()]; + }, + A: function(d) { + return locale_days[d.getDay()]; + }, + b: function(d) { + return locale_shortMonths[d.getMonth()]; + }, + B: function(d) { + return locale_months[d.getMonth()]; + }, + c: d3_time_format(locale_dateTime), + d: function(d, p) { + return d3_time_formatPad(d.getDate(), p, 2); + }, + e: function(d, p) { + return d3_time_formatPad(d.getDate(), p, 2); + }, + H: function(d, p) { + return d3_time_formatPad(d.getHours(), p, 2); + }, + I: function(d, p) { + return d3_time_formatPad(d.getHours() % 12 || 12, p, 2); + }, + j: function(d, p) { + return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3); + }, + L: function(d, p) { + return d3_time_formatPad(d.getMilliseconds(), p, 3); + }, + m: function(d, p) { + return d3_time_formatPad(d.getMonth() + 1, p, 2); + }, + M: function(d, p) { + return d3_time_formatPad(d.getMinutes(), p, 2); + }, + p: function(d) { + return locale_periods[+(d.getHours() >= 12)]; + }, + S: function(d, p) { + return d3_time_formatPad(d.getSeconds(), p, 2); + }, + U: function(d, p) { + return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2); + }, + w: function(d) { + return d.getDay(); + }, + W: function(d, p) { + return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2); + }, + x: d3_time_format(locale_date), + X: d3_time_format(locale_time), + y: function(d, p) { + return d3_time_formatPad(d.getFullYear() % 100, p, 2); + }, + Y: function(d, p) { + return d3_time_formatPad(d.getFullYear() % 1e4, p, 4); + }, + Z: d3_time_zone, + "%": function() { + return "%"; + } + }; + var d3_time_parsers = { + a: d3_time_parseWeekdayAbbrev, + A: d3_time_parseWeekday, + b: d3_time_parseMonthAbbrev, + B: d3_time_parseMonth, + c: d3_time_parseLocaleFull, + d: d3_time_parseDay, + e: d3_time_parseDay, + H: d3_time_parseHour24, + I: d3_time_parseHour24, + j: d3_time_parseDayOfYear, + L: d3_time_parseMilliseconds, + m: d3_time_parseMonthNumber, + M: d3_time_parseMinutes, + p: d3_time_parseAmPm, + S: d3_time_parseSeconds, + U: d3_time_parseWeekNumberSunday, + w: d3_time_parseWeekdayNumber, + W: d3_time_parseWeekNumberMonday, + x: d3_time_parseLocaleDate, + X: d3_time_parseLocaleTime, + y: d3_time_parseYear, + Y: d3_time_parseFullYear, + Z: d3_time_parseZone, + "%": d3_time_parseLiteralPercent + }; + function d3_time_parseWeekdayAbbrev(date, string, i) { + d3_time_dayAbbrevRe.lastIndex = 0; + var n = d3_time_dayAbbrevRe.exec(string.slice(i)); + return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseWeekday(date, string, i) { + d3_time_dayRe.lastIndex = 0; + var n = d3_time_dayRe.exec(string.slice(i)); + return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseMonthAbbrev(date, string, i) { + d3_time_monthAbbrevRe.lastIndex = 0; + var n = d3_time_monthAbbrevRe.exec(string.slice(i)); + return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseMonth(date, string, i) { + d3_time_monthRe.lastIndex = 0; + var n = d3_time_monthRe.exec(string.slice(i)); + return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseLocaleFull(date, string, i) { + return d3_time_parse(date, d3_time_formats.c.toString(), string, i); + } + function d3_time_parseLocaleDate(date, string, i) { + return d3_time_parse(date, d3_time_formats.x.toString(), string, i); + } + function d3_time_parseLocaleTime(date, string, i) { + return d3_time_parse(date, d3_time_formats.X.toString(), string, i); + } + function d3_time_parseAmPm(date, string, i) { + var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase()); + return n == null ? -1 : (date.p = n, i); + } + return d3_time_format; + } + var d3_time_formatPads = { + "-": "", + _: " ", + "0": "0" + }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/; + function d3_time_formatPad(value, fill, width) { + var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length; + return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); + } + function d3_time_formatRe(names) { + return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i"); + } + function d3_time_formatLookup(names) { + var map = new d3_Map(), i = -1, n = names.length; + while (++i < n) map.set(names[i].toLowerCase(), i); + return map; + } + function d3_time_parseWeekdayNumber(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 1)); + return n ? (date.w = +n[0], i + n[0].length) : -1; + } + function d3_time_parseWeekNumberSunday(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i)); + return n ? (date.U = +n[0], i + n[0].length) : -1; + } + function d3_time_parseWeekNumberMonday(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i)); + return n ? (date.W = +n[0], i + n[0].length) : -1; + } + function d3_time_parseFullYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 4)); + return n ? (date.y = +n[0], i + n[0].length) : -1; + } + function d3_time_parseYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; + } + function d3_time_parseZone(date, string, i) { + return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, + i + 5) : -1; + } + function d3_time_expandYear(d) { + return d + (d > 68 ? 1900 : 2e3); + } + function d3_time_parseMonthNumber(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.m = n[0] - 1, i + n[0].length) : -1; + } + function d3_time_parseDay(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.d = +n[0], i + n[0].length) : -1; + } + function d3_time_parseDayOfYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); + return n ? (date.j = +n[0], i + n[0].length) : -1; + } + function d3_time_parseHour24(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.H = +n[0], i + n[0].length) : -1; + } + function d3_time_parseMinutes(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.M = +n[0], i + n[0].length) : -1; + } + function d3_time_parseSeconds(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.S = +n[0], i + n[0].length) : -1; + } + function d3_time_parseMilliseconds(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); + return n ? (date.L = +n[0], i + n[0].length) : -1; + } + function d3_time_zone(d) { + var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60; + return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2); + } + function d3_time_parseLiteralPercent(date, string, i) { + d3_time_percentRe.lastIndex = 0; + var n = d3_time_percentRe.exec(string.slice(i, i + 1)); + return n ? i + n[0].length : -1; + } + function d3_time_formatMulti(formats) { + var n = formats.length, i = -1; + while (++i < n) formats[i][0] = this(formats[i][0]); + return function(date) { + var i = 0, f = formats[i]; + while (!f[1](date)) f = formats[++i]; + return f[0](date); + }; + } + d3.locale = function(locale) { + return { + numberFormat: d3_locale_numberFormat(locale), + timeFormat: d3_locale_timeFormat(locale) + }; + }; + var d3_locale_enUS = d3.locale({ + decimal: ".", + thousands: ",", + grouping: [ 3 ], + currency: [ "$", "" ], + dateTime: "%a %b %e %X %Y", + date: "%m/%d/%Y", + time: "%H:%M:%S", + periods: [ "AM", "PM" ], + days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], + shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], + months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], + shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] + }); + d3.format = d3_locale_enUS.numberFormat; + d3.geo = {}; + function d3_adder() {} + d3_adder.prototype = { + s: 0, + t: 0, + add: function(y) { + d3_adderSum(y, this.t, d3_adderTemp); + d3_adderSum(d3_adderTemp.s, this.s, this); + if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t; + }, + reset: function() { + this.s = this.t = 0; + }, + valueOf: function() { + return this.s; + } + }; + var d3_adderTemp = new d3_adder(); + function d3_adderSum(a, b, o) { + var x = o.s = a + b, bv = x - a, av = x - bv; + o.t = a - av + (b - bv); + } + d3.geo.stream = function(object, listener) { + if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) { + d3_geo_streamObjectType[object.type](object, listener); + } else { + d3_geo_streamGeometry(object, listener); + } + }; + function d3_geo_streamGeometry(geometry, listener) { + if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) { + d3_geo_streamGeometryType[geometry.type](geometry, listener); + } + } + var d3_geo_streamObjectType = { + Feature: function(feature, listener) { + d3_geo_streamGeometry(feature.geometry, listener); + }, + FeatureCollection: function(object, listener) { + var features = object.features, i = -1, n = features.length; + while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener); + } + }; + var d3_geo_streamGeometryType = { + Sphere: function(object, listener) { + listener.sphere(); + }, + Point: function(object, listener) { + object = object.coordinates; + listener.point(object[0], object[1], object[2]); + }, + MultiPoint: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]); + }, + LineString: function(object, listener) { + d3_geo_streamLine(object.coordinates, listener, 0); + }, + MultiLineString: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0); + }, + Polygon: function(object, listener) { + d3_geo_streamPolygon(object.coordinates, listener); + }, + MultiPolygon: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) d3_geo_streamPolygon(coordinates[i], listener); + }, + GeometryCollection: function(object, listener) { + var geometries = object.geometries, i = -1, n = geometries.length; + while (++i < n) d3_geo_streamGeometry(geometries[i], listener); + } + }; + function d3_geo_streamLine(coordinates, listener, closed) { + var i = -1, n = coordinates.length - closed, coordinate; + listener.lineStart(); + while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]); + listener.lineEnd(); + } + function d3_geo_streamPolygon(coordinates, listener) { + var i = -1, n = coordinates.length; + listener.polygonStart(); + while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1); + listener.polygonEnd(); + } + d3.geo.area = function(object) { + d3_geo_areaSum = 0; + d3.geo.stream(object, d3_geo_area); + return d3_geo_areaSum; + }; + var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder(); + var d3_geo_area = { + sphere: function() { + d3_geo_areaSum += 4 * Ï€; + }, + point: d3_noop, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: function() { + d3_geo_areaRingSum.reset(); + d3_geo_area.lineStart = d3_geo_areaRingStart; + }, + polygonEnd: function() { + var area = 2 * d3_geo_areaRingSum; + d3_geo_areaSum += area < 0 ? 4 * Ï€ + area : area; + d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop; + } + }; + function d3_geo_areaRingStart() { + var λ00, φ00, λ0, cosφ0, sinφ0; + d3_geo_area.point = function(λ, φ) { + d3_geo_area.point = nextPoint; + λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + Ï€ / 4), + sinφ0 = Math.sin(φ); + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + φ = φ * d3_radians / 2 + Ï€ / 4; + var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ); + d3_geo_areaRingSum.add(Math.atan2(v, u)); + λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ; + } + d3_geo_area.lineEnd = function() { + nextPoint(λ00, φ00); + }; + } + function d3_geo_cartesian(spherical) { + var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ); + return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ]; + } + function d3_geo_cartesianDot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + function d3_geo_cartesianCross(a, b) { + return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ]; + } + function d3_geo_cartesianAdd(a, b) { + a[0] += b[0]; + a[1] += b[1]; + a[2] += b[2]; + } + function d3_geo_cartesianScale(vector, k) { + return [ vector[0] * k, vector[1] * k, vector[2] * k ]; + } + function d3_geo_cartesianNormalize(d) { + var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); + d[0] /= l; + d[1] /= l; + d[2] /= l; + } + function d3_geo_spherical(cartesian) { + return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ]; + } + function d3_geo_sphericalEqual(a, b) { + return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε; + } + d3.geo.bounds = function() { + var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range; + var bound = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + bound.point = ringPoint; + bound.lineStart = ringStart; + bound.lineEnd = ringEnd; + dλSum = 0; + d3_geo_area.polygonStart(); + }, + polygonEnd: function() { + d3_geo_area.polygonEnd(); + bound.point = point; + bound.lineStart = lineStart; + bound.lineEnd = lineEnd; + if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90; + range[0] = λ0, range[1] = λ1; + } + }; + function point(λ, φ) { + ranges.push(range = [ λ0 = λ, λ1 = λ ]); + if (φ < φ0) φ0 = φ; + if (φ > φ1) φ1 = φ; + } + function linePoint(λ, φ) { + var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]); + if (p0) { + var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal); + d3_geo_cartesianNormalize(inflection); + inflection = d3_geo_spherical(inflection); + var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180; + if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) { + var φi = inflection[1] * d3_degrees; + if (φi > φ1) φ1 = φi; + } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) { + var φi = -inflection[1] * d3_degrees; + if (φi < φ0) φ0 = φi; + } else { + if (φ < φ0) φ0 = φ; + if (φ > φ1) φ1 = φ; + } + if (antimeridian) { + if (λ < λ_) { + if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; + } else { + if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; + } + } else { + if (λ1 >= λ0) { + if (λ < λ0) λ0 = λ; + if (λ > λ1) λ1 = λ; + } else { + if (λ > λ_) { + if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; + } else { + if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; + } + } + } + } else { + point(λ, φ); + } + p0 = p, λ_ = λ; + } + function lineStart() { + bound.point = linePoint; + } + function lineEnd() { + range[0] = λ0, range[1] = λ1; + bound.point = point; + p0 = null; + } + function ringPoint(λ, φ) { + if (p0) { + var dλ = λ - λ_; + dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ; + } else λ__ = λ, φ__ = φ; + d3_geo_area.point(λ, φ); + linePoint(λ, φ); + } + function ringStart() { + d3_geo_area.lineStart(); + } + function ringEnd() { + ringPoint(λ__, φ__); + d3_geo_area.lineEnd(); + if (abs(dλSum) > ε) λ0 = -(λ1 = 180); + range[0] = λ0, range[1] = λ1; + p0 = null; + } + function angle(λ0, λ1) { + return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1; + } + function compareRanges(a, b) { + return a[0] - b[0]; + } + function withinRange(x, range) { + return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; + } + return function(feature) { + φ1 = λ1 = -(λ0 = φ0 = Infinity); + ranges = []; + d3.geo.stream(feature, bound); + var n = ranges.length; + if (n) { + ranges.sort(compareRanges); + for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) { + b = ranges[i]; + if (withinRange(b[0], a) || withinRange(b[1], a)) { + if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; + if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; + } else { + merged.push(a = b); + } + } + var best = -Infinity, dλ; + for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) { + b = merged[i]; + if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1]; + } + } + ranges = range = null; + return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ]; + }; + }(); + d3.geo.centroid = function(object) { + d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; + d3.geo.stream(object, d3_geo_centroid); + var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z; + if (m < ε2) { + x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1; + if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0; + m = x * x + y * y + z * z; + if (m < ε2) return [ NaN, NaN ]; + } + return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ]; + }; + var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2; + var d3_geo_centroid = { + sphere: d3_noop, + point: d3_geo_centroidPoint, + lineStart: d3_geo_centroidLineStart, + lineEnd: d3_geo_centroidLineEnd, + polygonStart: function() { + d3_geo_centroid.lineStart = d3_geo_centroidRingStart; + }, + polygonEnd: function() { + d3_geo_centroid.lineStart = d3_geo_centroidLineStart; + } + }; + function d3_geo_centroidPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ)); + } + function d3_geo_centroidPointXYZ(x, y, z) { + ++d3_geo_centroidW0; + d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0; + d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0; + d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0; + } + function d3_geo_centroidLineStart() { + var x0, y0, z0; + d3_geo_centroid.point = function(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + x0 = cosφ * Math.cos(λ); + y0 = cosφ * Math.sin(λ); + z0 = Math.sin(φ); + d3_geo_centroid.point = nextPoint; + d3_geo_centroidPointXYZ(x0, y0, z0); + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); + d3_geo_centroidW1 += w; + d3_geo_centroidX1 += w * (x0 + (x0 = x)); + d3_geo_centroidY1 += w * (y0 + (y0 = y)); + d3_geo_centroidZ1 += w * (z0 + (z0 = z)); + d3_geo_centroidPointXYZ(x0, y0, z0); + } + } + function d3_geo_centroidLineEnd() { + d3_geo_centroid.point = d3_geo_centroidPoint; + } + function d3_geo_centroidRingStart() { + var λ00, φ00, x0, y0, z0; + d3_geo_centroid.point = function(λ, φ) { + λ00 = λ, φ00 = φ; + d3_geo_centroid.point = nextPoint; + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + x0 = cosφ * Math.cos(λ); + y0 = cosφ * Math.sin(λ); + z0 = Math.sin(φ); + d3_geo_centroidPointXYZ(x0, y0, z0); + }; + d3_geo_centroid.lineEnd = function() { + nextPoint(λ00, φ00); + d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd; + d3_geo_centroid.point = d3_geo_centroidPoint; + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u); + d3_geo_centroidX2 += v * cx; + d3_geo_centroidY2 += v * cy; + d3_geo_centroidZ2 += v * cz; + d3_geo_centroidW1 += w; + d3_geo_centroidX1 += w * (x0 + (x0 = x)); + d3_geo_centroidY1 += w * (y0 + (y0 = y)); + d3_geo_centroidZ1 += w * (z0 + (z0 = z)); + d3_geo_centroidPointXYZ(x0, y0, z0); + } + } + function d3_geo_compose(a, b) { + function compose(x, y) { + return x = a(x, y), b(x[0], x[1]); + } + if (a.invert && b.invert) compose.invert = function(x, y) { + return x = b.invert(x, y), x && a.invert(x[0], x[1]); + }; + return compose; + } + function d3_true() { + return true; + } + function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) { + var subject = [], clip = []; + segments.forEach(function(segment) { + if ((n = segment.length - 1) <= 0) return; + var n, p0 = segment[0], p1 = segment[n]; + if (d3_geo_sphericalEqual(p0, p1)) { + listener.lineStart(); + for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]); + listener.lineEnd(); + return; + } + var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false); + a.o = b; + subject.push(a); + clip.push(b); + a = new d3_geo_clipPolygonIntersection(p1, segment, null, false); + b = new d3_geo_clipPolygonIntersection(p1, null, a, true); + a.o = b; + subject.push(a); + clip.push(b); + }); + clip.sort(compare); + d3_geo_clipPolygonLinkCircular(subject); + d3_geo_clipPolygonLinkCircular(clip); + if (!subject.length) return; + for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) { + clip[i].e = entry = !entry; + } + var start = subject[0], points, point; + while (1) { + var current = start, isSubject = true; + while (current.v) if ((current = current.n) === start) return; + points = current.z; + listener.lineStart(); + do { + current.v = current.o.v = true; + if (current.e) { + if (isSubject) { + for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.n.x, 1, listener); + } + current = current.n; + } else { + if (isSubject) { + points = current.p.z; + for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.p.x, -1, listener); + } + current = current.p; + } + current = current.o; + points = current.z; + isSubject = !isSubject; + } while (!current.v); + listener.lineEnd(); + } + } + function d3_geo_clipPolygonLinkCircular(array) { + if (!(n = array.length)) return; + var n, i = 0, a = array[0], b; + while (++i < n) { + a.n = b = array[i]; + b.p = a; + a = b; + } + a.n = b = array[0]; + b.p = a; + } + function d3_geo_clipPolygonIntersection(point, points, other, entry) { + this.x = point; + this.z = points; + this.o = other; + this.e = entry; + this.v = false; + this.n = this.p = null; + } + function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) { + return function(rotate, listener) { + var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]); + var clip = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + clip.point = pointRing; + clip.lineStart = ringStart; + clip.lineEnd = ringEnd; + segments = []; + polygon = []; + }, + polygonEnd: function() { + clip.point = point; + clip.lineStart = lineStart; + clip.lineEnd = lineEnd; + segments = d3.merge(segments); + var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon); + if (segments.length) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener); + } else if (clipStartInside) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + } + if (polygonStarted) listener.polygonEnd(), polygonStarted = false; + segments = polygon = null; + }, + sphere: function() { + listener.polygonStart(); + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + listener.polygonEnd(); + } + }; + function point(λ, φ) { + var point = rotate(λ, φ); + if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ); + } + function pointLine(λ, φ) { + var point = rotate(λ, φ); + line.point(point[0], point[1]); + } + function lineStart() { + clip.point = pointLine; + line.lineStart(); + } + function lineEnd() { + clip.point = point; + line.lineEnd(); + } + var segments; + var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring; + function pointRing(λ, φ) { + ring.push([ λ, φ ]); + var point = rotate(λ, φ); + ringListener.point(point[0], point[1]); + } + function ringStart() { + ringListener.lineStart(); + ring = []; + } + function ringEnd() { + pointRing(ring[0][0], ring[0][1]); + ringListener.lineEnd(); + var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length; + ring.pop(); + polygon.push(ring); + ring = null; + if (!n) return; + if (clean & 1) { + segment = ringSegments[0]; + var n = segment.length - 1, i = -1, point; + if (n > 0) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + listener.lineStart(); + while (++i < n) listener.point((point = segment[i])[0], point[1]); + listener.lineEnd(); + } + return; + } + if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); + segments.push(ringSegments.filter(d3_geo_clipSegmentLength1)); + } + return clip; + }; + } + function d3_geo_clipSegmentLength1(segment) { + return segment.length > 1; + } + function d3_geo_clipBufferListener() { + var lines = [], line; + return { + lineStart: function() { + lines.push(line = []); + }, + point: function(λ, φ) { + line.push([ λ, φ ]); + }, + lineEnd: d3_noop, + buffer: function() { + var buffer = lines; + lines = []; + line = null; + return buffer; + }, + rejoin: function() { + if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); + } + }; + } + function d3_geo_clipSort(a, b) { + return ((a = a.x)[0] < 0 ? a[1] - halfÏ€ - ε : halfÏ€ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfÏ€ - ε : halfÏ€ - b[1]); + } + var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -Ï€, -Ï€ / 2 ]); + function d3_geo_clipAntimeridianLine(listener) { + var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean; + return { + lineStart: function() { + listener.lineStart(); + clean = 1; + }, + point: function(λ1, φ1) { + var sλ1 = λ1 > 0 ? Ï€ : -Ï€, dλ = abs(λ1 - λ0); + if (abs(dλ - Ï€) < ε) { + listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfÏ€ : -halfÏ€); + listener.point(sλ0, φ0); + listener.lineEnd(); + listener.lineStart(); + listener.point(sλ1, φ0); + listener.point(λ1, φ0); + clean = 0; + } else if (sλ0 !== sλ1 && dλ >= Ï€) { + if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε; + if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε; + φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1); + listener.point(sλ0, φ0); + listener.lineEnd(); + listener.lineStart(); + listener.point(sλ1, φ0); + clean = 0; + } + listener.point(λ0 = λ1, φ0 = φ1); + sλ0 = sλ1; + }, + lineEnd: function() { + listener.lineEnd(); + λ0 = φ0 = NaN; + }, + clean: function() { + return 2 - clean; + } + }; + } + function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) { + var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1); + return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2; + } + function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) { + var φ; + if (from == null) { + φ = direction * halfÏ€; + listener.point(-Ï€, φ); + listener.point(0, φ); + listener.point(Ï€, φ); + listener.point(Ï€, 0); + listener.point(Ï€, -φ); + listener.point(0, -φ); + listener.point(-Ï€, -φ); + listener.point(-Ï€, 0); + listener.point(-Ï€, φ); + } else if (abs(from[0] - to[0]) > ε) { + var s = from[0] < to[0] ? Ï€ : -Ï€; + φ = direction * s / 2; + listener.point(-s, φ); + listener.point(0, φ); + listener.point(s, φ); + } else { + listener.point(to[0], to[1]); + } + } + function d3_geo_pointInPolygon(point, polygon) { + var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0; + d3_geo_areaRingSum.reset(); + for (var i = 0, n = polygon.length; i < n; ++i) { + var ring = polygon[i], m = ring.length; + if (!m) continue; + var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + Ï€ / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1; + while (true) { + if (j === m) j = 0; + point = ring[j]; + var λ = point[0], φ = point[1] / 2 + Ï€ / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > Ï€, k = sinφ0 * sinφ; + d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ))); + polarAngle += antimeridian ? dλ + sdλ * Ï„ : dλ; + if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) { + var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point)); + d3_geo_cartesianNormalize(arc); + var intersection = d3_geo_cartesianCross(meridianNormal, arc); + d3_geo_cartesianNormalize(intersection); + var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]); + if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) { + winding += antimeridian ^ dλ >= 0 ? 1 : -1; + } + } + if (!j++) break; + λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point; + } + } + return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1; + } + function d3_geo_clipCircle(radius) { + var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians); + return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -Ï€, radius - Ï€ ]); + function visible(λ, φ) { + return Math.cos(λ) * Math.cos(φ) > cr; + } + function clipLine(listener) { + var point0, c0, v0, v00, clean; + return { + lineStart: function() { + v00 = v0 = false; + clean = 1; + }, + point: function(λ, φ) { + var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? Ï€ : -Ï€), φ) : 0; + if (!point0 && (v00 = v0 = v)) listener.lineStart(); + if (v !== v0) { + point2 = intersect(point0, point1); + if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) { + point1[0] += ε; + point1[1] += ε; + v = visible(point1[0], point1[1]); + } + } + if (v !== v0) { + clean = 0; + if (v) { + listener.lineStart(); + point2 = intersect(point1, point0); + listener.point(point2[0], point2[1]); + } else { + point2 = intersect(point0, point1); + listener.point(point2[0], point2[1]); + listener.lineEnd(); + } + point0 = point2; + } else if (notHemisphere && point0 && smallRadius ^ v) { + var t; + if (!(c & c0) && (t = intersect(point1, point0, true))) { + clean = 0; + if (smallRadius) { + listener.lineStart(); + listener.point(t[0][0], t[0][1]); + listener.point(t[1][0], t[1][1]); + listener.lineEnd(); + } else { + listener.point(t[1][0], t[1][1]); + listener.lineEnd(); + listener.lineStart(); + listener.point(t[0][0], t[0][1]); + } + } + } + if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) { + listener.point(point1[0], point1[1]); + } + point0 = point1, v0 = v, c0 = c; + }, + lineEnd: function() { + if (v0) listener.lineEnd(); + point0 = null; + }, + clean: function() { + return clean | (v00 && v0) << 1; + } + }; + } + function intersect(a, b, two) { + var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b); + var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2; + if (!determinant) return !two && a; + var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2); + d3_geo_cartesianAdd(A, B); + var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1); + if (t2 < 0) return; + var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu); + d3_geo_cartesianAdd(q, A); + q = d3_geo_spherical(q); + if (!two) return q; + var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z; + if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z; + var δλ = λ1 - λ0, polar = abs(δλ - Ï€) < ε, meridian = polar || δλ < ε; + if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z; + if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > Ï€ ^ (λ0 <= q[0] && q[0] <= λ1)) { + var q1 = d3_geo_cartesianScale(u, (-w + t) / uu); + d3_geo_cartesianAdd(q1, A); + return [ q, d3_geo_spherical(q1) ]; + } + } + function code(λ, φ) { + var r = smallRadius ? radius : Ï€ - radius, code = 0; + if (λ < -r) code |= 1; else if (λ > r) code |= 2; + if (φ < -r) code |= 4; else if (φ > r) code |= 8; + return code; + } + } + function d3_geom_clipLine(x0, y0, x1, y1) { + return function(line) { + var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r; + r = x0 - ax; + if (!dx && r > 0) return; + r /= dx; + if (dx < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dx > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + r = x1 - ax; + if (!dx && r < 0) return; + r /= dx; + if (dx < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dx > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + r = y0 - ay; + if (!dy && r > 0) return; + r /= dy; + if (dy < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dy > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + r = y1 - ay; + if (!dy && r < 0) return; + r /= dy; + if (dy < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dy > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + if (t0 > 0) line.a = { + x: ax + t0 * dx, + y: ay + t0 * dy + }; + if (t1 < 1) line.b = { + x: ax + t1 * dx, + y: ay + t1 * dy + }; + return line; + }; + } + var d3_geo_clipExtentMAX = 1e9; + d3.geo.clipExtent = function() { + var x0, y0, x1, y1, stream, clip, clipExtent = { + stream: function(output) { + if (stream) stream.valid = false; + stream = clip(output); + stream.valid = true; + return stream; + }, + extent: function(_) { + if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; + clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]); + if (stream) stream.valid = false, stream = null; + return clipExtent; + } + }; + return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]); + }; + function d3_geo_clipExtent(x0, y0, x1, y1) { + return function(listener) { + var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring; + var clip = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + listener = bufferListener; + segments = []; + polygon = []; + clean = true; + }, + polygonEnd: function() { + listener = listener_; + segments = d3.merge(segments); + var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length; + if (inside || visible) { + listener.polygonStart(); + if (inside) { + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + } + if (visible) { + d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener); + } + listener.polygonEnd(); + } + segments = polygon = ring = null; + } + }; + function insidePolygon(p) { + var wn = 0, n = polygon.length, y = p[1]; + for (var i = 0; i < n; ++i) { + for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) { + b = v[j]; + if (a[1] <= y) { + if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn; + } else { + if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn; + } + a = b; + } + } + return wn !== 0; + } + function interpolate(from, to, direction, listener) { + var a = 0, a1 = 0; + if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) { + do { + listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); + } while ((a = (a + direction + 4) % 4) !== a1); + } else { + listener.point(to[0], to[1]); + } + } + function pointVisible(x, y) { + return x0 <= x && x <= x1 && y0 <= y && y <= y1; + } + function point(x, y) { + if (pointVisible(x, y)) listener.point(x, y); + } + var x__, y__, v__, x_, y_, v_, first, clean; + function lineStart() { + clip.point = linePoint; + if (polygon) polygon.push(ring = []); + first = true; + v_ = false; + x_ = y_ = NaN; + } + function lineEnd() { + if (segments) { + linePoint(x__, y__); + if (v__ && v_) bufferListener.rejoin(); + segments.push(bufferListener.buffer()); + } + clip.point = point; + if (v_) listener.lineEnd(); + } + function linePoint(x, y) { + x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x)); + y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y)); + var v = pointVisible(x, y); + if (polygon) ring.push([ x, y ]); + if (first) { + x__ = x, y__ = y, v__ = v; + first = false; + if (v) { + listener.lineStart(); + listener.point(x, y); + } + } else { + if (v && v_) listener.point(x, y); else { + var l = { + a: { + x: x_, + y: y_ + }, + b: { + x: x, + y: y + } + }; + if (clipLine(l)) { + if (!v_) { + listener.lineStart(); + listener.point(l.a.x, l.a.y); + } + listener.point(l.b.x, l.b.y); + if (!v) listener.lineEnd(); + clean = false; + } else if (v) { + listener.lineStart(); + listener.point(x, y); + clean = false; + } + } + } + x_ = x, y_ = y, v_ = v; + } + return clip; + }; + function corner(p, direction) { + return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2; + } + function compare(a, b) { + return comparePoints(a.x, b.x); + } + function comparePoints(a, b) { + var ca = corner(a, 1), cb = corner(b, 1); + return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0]; + } + } + function d3_geo_conic(projectAt) { + var φ0 = 0, φ1 = Ï€ / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1); + p.parallels = function(_) { + if (!arguments.length) return [ φ0 / Ï€ * 180, φ1 / Ï€ * 180 ]; + return m(φ0 = _[0] * Ï€ / 180, φ1 = _[1] * Ï€ / 180); + }; + return p; + } + function d3_geo_conicEqualArea(φ0, φ1) { + var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), Ï0 = Math.sqrt(C) / n; + function forward(λ, φ) { + var Ï = Math.sqrt(C - 2 * n * Math.sin(φ)) / n; + return [ Ï * Math.sin(λ *= n), Ï0 - Ï * Math.cos(λ) ]; + } + forward.invert = function(x, y) { + var Ï0_y = Ï0 - y; + return [ Math.atan2(x, Ï0_y) / n, d3_asin((C - (x * x + Ï0_y * Ï0_y) * n * n) / (2 * n)) ]; + }; + return forward; + } + (d3.geo.conicEqualArea = function() { + return d3_geo_conic(d3_geo_conicEqualArea); + }).raw = d3_geo_conicEqualArea; + d3.geo.albers = function() { + return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070); + }; + d3.geo.albersUsa = function() { + var lower48 = d3.geo.albers(); + var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]); + var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]); + var point, pointStream = { + point: function(x, y) { + point = [ x, y ]; + } + }, lower48Point, alaskaPoint, hawaiiPoint; + function albersUsa(coordinates) { + var x = coordinates[0], y = coordinates[1]; + point = null; + (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y); + return point; + } + albersUsa.invert = function(coordinates) { + var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k; + return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates); + }; + albersUsa.stream = function(stream) { + var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream); + return { + point: function(x, y) { + lower48Stream.point(x, y); + alaskaStream.point(x, y); + hawaiiStream.point(x, y); + }, + sphere: function() { + lower48Stream.sphere(); + alaskaStream.sphere(); + hawaiiStream.sphere(); + }, + lineStart: function() { + lower48Stream.lineStart(); + alaskaStream.lineStart(); + hawaiiStream.lineStart(); + }, + lineEnd: function() { + lower48Stream.lineEnd(); + alaskaStream.lineEnd(); + hawaiiStream.lineEnd(); + }, + polygonStart: function() { + lower48Stream.polygonStart(); + alaskaStream.polygonStart(); + hawaiiStream.polygonStart(); + }, + polygonEnd: function() { + lower48Stream.polygonEnd(); + alaskaStream.polygonEnd(); + hawaiiStream.polygonEnd(); + } + }; + }; + albersUsa.precision = function(_) { + if (!arguments.length) return lower48.precision(); + lower48.precision(_); + alaska.precision(_); + hawaii.precision(_); + return albersUsa; + }; + albersUsa.scale = function(_) { + if (!arguments.length) return lower48.scale(); + lower48.scale(_); + alaska.scale(_ * .35); + hawaii.scale(_); + return albersUsa.translate(lower48.translate()); + }; + albersUsa.translate = function(_) { + if (!arguments.length) return lower48.translate(); + var k = lower48.scale(), x = +_[0], y = +_[1]; + lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point; + alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; + hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; + return albersUsa; + }; + return albersUsa.scale(1070); + }; + var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = { + point: d3_noop, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: function() { + d3_geo_pathAreaPolygon = 0; + d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart; + }, + polygonEnd: function() { + d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop; + d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2); + } + }; + function d3_geo_pathAreaRingStart() { + var x00, y00, x0, y0; + d3_geo_pathArea.point = function(x, y) { + d3_geo_pathArea.point = nextPoint; + x00 = x0 = x, y00 = y0 = y; + }; + function nextPoint(x, y) { + d3_geo_pathAreaPolygon += y0 * x - x0 * y; + x0 = x, y0 = y; + } + d3_geo_pathArea.lineEnd = function() { + nextPoint(x00, y00); + }; + } + var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1; + var d3_geo_pathBounds = { + point: d3_geo_pathBoundsPoint, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: d3_noop, + polygonEnd: d3_noop + }; + function d3_geo_pathBoundsPoint(x, y) { + if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x; + if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x; + if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y; + if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y; + } + function d3_geo_pathBuffer() { + var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = []; + var stream = { + point: point, + lineStart: function() { + stream.point = pointLineStart; + }, + lineEnd: lineEnd, + polygonStart: function() { + stream.lineEnd = lineEndPolygon; + }, + polygonEnd: function() { + stream.lineEnd = lineEnd; + stream.point = point; + }, + pointRadius: function(_) { + pointCircle = d3_geo_pathBufferCircle(_); + return stream; + }, + result: function() { + if (buffer.length) { + var result = buffer.join(""); + buffer = []; + return result; + } + } + }; + function point(x, y) { + buffer.push("M", x, ",", y, pointCircle); + } + function pointLineStart(x, y) { + buffer.push("M", x, ",", y); + stream.point = pointLine; + } + function pointLine(x, y) { + buffer.push("L", x, ",", y); + } + function lineEnd() { + stream.point = point; + } + function lineEndPolygon() { + buffer.push("Z"); + } + return stream; + } + function d3_geo_pathBufferCircle(radius) { + return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z"; + } + var d3_geo_pathCentroid = { + point: d3_geo_pathCentroidPoint, + lineStart: d3_geo_pathCentroidLineStart, + lineEnd: d3_geo_pathCentroidLineEnd, + polygonStart: function() { + d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart; + }, + polygonEnd: function() { + d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; + d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart; + d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd; + } + }; + function d3_geo_pathCentroidPoint(x, y) { + d3_geo_centroidX0 += x; + d3_geo_centroidY0 += y; + ++d3_geo_centroidZ0; + } + function d3_geo_pathCentroidLineStart() { + var x0, y0; + d3_geo_pathCentroid.point = function(x, y) { + d3_geo_pathCentroid.point = nextPoint; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + }; + function nextPoint(x, y) { + var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); + d3_geo_centroidX1 += z * (x0 + x) / 2; + d3_geo_centroidY1 += z * (y0 + y) / 2; + d3_geo_centroidZ1 += z; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + } + } + function d3_geo_pathCentroidLineEnd() { + d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; + } + function d3_geo_pathCentroidRingStart() { + var x00, y00, x0, y0; + d3_geo_pathCentroid.point = function(x, y) { + d3_geo_pathCentroid.point = nextPoint; + d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y); + }; + function nextPoint(x, y) { + var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); + d3_geo_centroidX1 += z * (x0 + x) / 2; + d3_geo_centroidY1 += z * (y0 + y) / 2; + d3_geo_centroidZ1 += z; + z = y0 * x - x0 * y; + d3_geo_centroidX2 += z * (x0 + x); + d3_geo_centroidY2 += z * (y0 + y); + d3_geo_centroidZ2 += z * 3; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + } + d3_geo_pathCentroid.lineEnd = function() { + nextPoint(x00, y00); + }; + } + function d3_geo_pathContext(context) { + var pointRadius = 4.5; + var stream = { + point: point, + lineStart: function() { + stream.point = pointLineStart; + }, + lineEnd: lineEnd, + polygonStart: function() { + stream.lineEnd = lineEndPolygon; + }, + polygonEnd: function() { + stream.lineEnd = lineEnd; + stream.point = point; + }, + pointRadius: function(_) { + pointRadius = _; + return stream; + }, + result: d3_noop + }; + function point(x, y) { + context.moveTo(x + pointRadius, y); + context.arc(x, y, pointRadius, 0, Ï„); + } + function pointLineStart(x, y) { + context.moveTo(x, y); + stream.point = pointLine; + } + function pointLine(x, y) { + context.lineTo(x, y); + } + function lineEnd() { + stream.point = point; + } + function lineEndPolygon() { + context.closePath(); + } + return stream; + } + function d3_geo_resample(project) { + var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16; + function resample(stream) { + return (maxDepth ? resampleRecursive : resampleNone)(stream); + } + function resampleNone(stream) { + return d3_geo_transformPoint(stream, function(x, y) { + x = project(x, y); + stream.point(x[0], x[1]); + }); + } + function resampleRecursive(stream) { + var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0; + var resample = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + stream.polygonStart(); + resample.lineStart = ringStart; + }, + polygonEnd: function() { + stream.polygonEnd(); + resample.lineStart = lineStart; + } + }; + function point(x, y) { + x = project(x, y); + stream.point(x[0], x[1]); + } + function lineStart() { + x0 = NaN; + resample.point = linePoint; + stream.lineStart(); + } + function linePoint(λ, φ) { + var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ); + resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); + stream.point(x0, y0); + } + function lineEnd() { + resample.point = point; + stream.lineEnd(); + } + function ringStart() { + lineStart(); + resample.point = ringPoint; + resample.lineEnd = ringEnd; + } + function ringPoint(λ, φ) { + linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; + resample.point = linePoint; + } + function ringEnd() { + resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream); + resample.lineEnd = lineEnd; + lineEnd(); + } + return resample; + } + function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) { + var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy; + if (d2 > 4 * δ2 && depth--) { + var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2; + if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { + resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream); + stream.point(x2, y2); + resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream); + } + } + } + resample.precision = function(_) { + if (!arguments.length) return Math.sqrt(δ2); + maxDepth = (δ2 = _ * _) > 0 && 16; + return resample; + }; + return resample; + } + d3.geo.path = function() { + var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream; + function path(object) { + if (object) { + if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); + if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream); + d3.geo.stream(object, cacheStream); + } + return contextStream.result(); + } + path.area = function(object) { + d3_geo_pathAreaSum = 0; + d3.geo.stream(object, projectStream(d3_geo_pathArea)); + return d3_geo_pathAreaSum; + }; + path.centroid = function(object) { + d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; + d3.geo.stream(object, projectStream(d3_geo_pathCentroid)); + return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ]; + }; + path.bounds = function(object) { + d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity); + d3.geo.stream(object, projectStream(d3_geo_pathBounds)); + return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ]; + }; + path.projection = function(_) { + if (!arguments.length) return projection; + projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity; + return reset(); + }; + path.context = function(_) { + if (!arguments.length) return context; + contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_); + if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); + return reset(); + }; + path.pointRadius = function(_) { + if (!arguments.length) return pointRadius; + pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); + return path; + }; + function reset() { + cacheStream = null; + return path; + } + return path.projection(d3.geo.albersUsa()).context(null); + }; + function d3_geo_pathProjectStream(project) { + var resample = d3_geo_resample(function(x, y) { + return project([ x * d3_degrees, y * d3_degrees ]); + }); + return function(stream) { + return d3_geo_projectionRadians(resample(stream)); + }; + } + d3.geo.transform = function(methods) { + return { + stream: function(stream) { + var transform = new d3_geo_transform(stream); + for (var k in methods) transform[k] = methods[k]; + return transform; + } + }; + }; + function d3_geo_transform(stream) { + this.stream = stream; + } + d3_geo_transform.prototype = { + point: function(x, y) { + this.stream.point(x, y); + }, + sphere: function() { + this.stream.sphere(); + }, + lineStart: function() { + this.stream.lineStart(); + }, + lineEnd: function() { + this.stream.lineEnd(); + }, + polygonStart: function() { + this.stream.polygonStart(); + }, + polygonEnd: function() { + this.stream.polygonEnd(); + } + }; + function d3_geo_transformPoint(stream, point) { + return { + point: point, + sphere: function() { + stream.sphere(); + }, + lineStart: function() { + stream.lineStart(); + }, + lineEnd: function() { + stream.lineEnd(); + }, + polygonStart: function() { + stream.polygonStart(); + }, + polygonEnd: function() { + stream.polygonEnd(); + } + }; + } + d3.geo.projection = d3_geo_projection; + d3.geo.projectionMutator = d3_geo_projectionMutator; + function d3_geo_projection(project) { + return d3_geo_projectionMutator(function() { + return project; + })(); + } + function d3_geo_projectionMutator(projectAt) { + var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) { + x = project(x, y); + return [ x[0] * k + δx, δy - x[1] * k ]; + }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream; + function projection(point) { + point = projectRotate(point[0] * d3_radians, point[1] * d3_radians); + return [ point[0] * k + δx, δy - point[1] * k ]; + } + function invert(point) { + point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k); + return point && [ point[0] * d3_degrees, point[1] * d3_degrees ]; + } + projection.stream = function(output) { + if (stream) stream.valid = false; + stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output)))); + stream.valid = true; + return stream; + }; + projection.clipAngle = function(_) { + if (!arguments.length) return clipAngle; + preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians); + return invalidate(); + }; + projection.clipExtent = function(_) { + if (!arguments.length) return clipExtent; + clipExtent = _; + postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity; + return invalidate(); + }; + projection.scale = function(_) { + if (!arguments.length) return k; + k = +_; + return reset(); + }; + projection.translate = function(_) { + if (!arguments.length) return [ x, y ]; + x = +_[0]; + y = +_[1]; + return reset(); + }; + projection.center = function(_) { + if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ]; + λ = _[0] % 360 * d3_radians; + φ = _[1] % 360 * d3_radians; + return reset(); + }; + projection.rotate = function(_) { + if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ]; + δλ = _[0] % 360 * d3_radians; + δφ = _[1] % 360 * d3_radians; + δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0; + return reset(); + }; + d3.rebind(projection, projectResample, "precision"); + function reset() { + projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); + var center = project(λ, φ); + δx = x - center[0] * k; + δy = y + center[1] * k; + return invalidate(); + } + function invalidate() { + if (stream) stream.valid = false, stream = null; + return projection; + } + return function() { + project = projectAt.apply(this, arguments); + projection.invert = project.invert && invert; + return reset(); + }; + } + function d3_geo_projectionRadians(stream) { + return d3_geo_transformPoint(stream, function(x, y) { + stream.point(x * d3_radians, y * d3_radians); + }); + } + function d3_geo_equirectangular(λ, φ) { + return [ λ, φ ]; + } + (d3.geo.equirectangular = function() { + return d3_geo_projection(d3_geo_equirectangular); + }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular; + d3.geo.rotation = function(rotate) { + rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0); + function forward(coordinates) { + coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); + return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; + } + forward.invert = function(coordinates) { + coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians); + return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; + }; + return forward; + }; + function d3_geo_identityRotation(λ, φ) { + return [ λ > Ï€ ? λ - Ï„ : λ < -Ï€ ? λ + Ï„ : λ, φ ]; + } + d3_geo_identityRotation.invert = d3_geo_equirectangular; + function d3_geo_rotation(δλ, δφ, δγ) { + return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation; + } + function d3_geo_forwardRotationλ(δλ) { + return function(λ, φ) { + return λ += δλ, [ λ > Ï€ ? λ - Ï„ : λ < -Ï€ ? λ + Ï„ : λ, φ ]; + }; + } + function d3_geo_rotationλ(δλ) { + var rotation = d3_geo_forwardRotationλ(δλ); + rotation.invert = d3_geo_forwardRotationλ(-δλ); + return rotation; + } + function d3_geo_rotationφγ(δφ, δγ) { + var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ); + function rotation(λ, φ) { + var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ; + return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ]; + } + rotation.invert = function(λ, φ) { + var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ; + return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ]; + }; + return rotation; + } + d3.geo.circle = function() { + var origin = [ 0, 0 ], angle, precision = 6, interpolate; + function circle() { + var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = []; + interpolate(null, null, 1, { + point: function(x, y) { + ring.push(x = rotate(x, y)); + x[0] *= d3_degrees, x[1] *= d3_degrees; + } + }); + return { + type: "Polygon", + coordinates: [ ring ] + }; + } + circle.origin = function(x) { + if (!arguments.length) return origin; + origin = x; + return circle; + }; + circle.angle = function(x) { + if (!arguments.length) return angle; + interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians); + return circle; + }; + circle.precision = function(_) { + if (!arguments.length) return precision; + interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians); + return circle; + }; + return circle.angle(90); + }; + function d3_geo_circleInterpolate(radius, precision) { + var cr = Math.cos(radius), sr = Math.sin(radius); + return function(from, to, direction, listener) { + var step = direction * precision; + if (from != null) { + from = d3_geo_circleAngle(cr, from); + to = d3_geo_circleAngle(cr, to); + if (direction > 0 ? from < to : from > to) from += direction * Ï„; + } else { + from = radius + direction * Ï„; + to = radius - .5 * step; + } + for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) { + listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]); + } + }; + } + function d3_geo_circleAngle(cr, point) { + var a = d3_geo_cartesian(point); + a[0] -= cr; + d3_geo_cartesianNormalize(a); + var angle = d3_acos(-a[1]); + return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI); + } + d3.geo.distance = function(a, b) { + var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t; + return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ); + }; + d3.geo.graticule = function() { + var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5; + function graticule() { + return { + type: "MultiLineString", + coordinates: lines() + }; + } + function lines() { + return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) { + return abs(x % DX) > ε; + }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) { + return abs(y % DY) > ε; + }).map(y)); + } + graticule.lines = function() { + return lines().map(function(coordinates) { + return { + type: "LineString", + coordinates: coordinates + }; + }); + }; + graticule.outline = function() { + return { + type: "Polygon", + coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ] + }; + }; + graticule.extent = function(_) { + if (!arguments.length) return graticule.minorExtent(); + return graticule.majorExtent(_).minorExtent(_); + }; + graticule.majorExtent = function(_) { + if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ]; + X0 = +_[0][0], X1 = +_[1][0]; + Y0 = +_[0][1], Y1 = +_[1][1]; + if (X0 > X1) _ = X0, X0 = X1, X1 = _; + if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; + return graticule.precision(precision); + }; + graticule.minorExtent = function(_) { + if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; + x0 = +_[0][0], x1 = +_[1][0]; + y0 = +_[0][1], y1 = +_[1][1]; + if (x0 > x1) _ = x0, x0 = x1, x1 = _; + if (y0 > y1) _ = y0, y0 = y1, y1 = _; + return graticule.precision(precision); + }; + graticule.step = function(_) { + if (!arguments.length) return graticule.minorStep(); + return graticule.majorStep(_).minorStep(_); + }; + graticule.majorStep = function(_) { + if (!arguments.length) return [ DX, DY ]; + DX = +_[0], DY = +_[1]; + return graticule; + }; + graticule.minorStep = function(_) { + if (!arguments.length) return [ dx, dy ]; + dx = +_[0], dy = +_[1]; + return graticule; + }; + graticule.precision = function(_) { + if (!arguments.length) return precision; + precision = +_; + x = d3_geo_graticuleX(y0, y1, 90); + y = d3_geo_graticuleY(x0, x1, precision); + X = d3_geo_graticuleX(Y0, Y1, 90); + Y = d3_geo_graticuleY(X0, X1, precision); + return graticule; + }; + return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]); + }; + function d3_geo_graticuleX(y0, y1, dy) { + var y = d3.range(y0, y1 - ε, dy).concat(y1); + return function(x) { + return y.map(function(y) { + return [ x, y ]; + }); + }; + } + function d3_geo_graticuleY(x0, x1, dx) { + var x = d3.range(x0, x1 - ε, dx).concat(x1); + return function(y) { + return x.map(function(x) { + return [ x, y ]; + }); + }; + } + function d3_source(d) { + return d.source; + } + function d3_target(d) { + return d.target; + } + d3.geo.greatArc = function() { + var source = d3_source, source_, target = d3_target, target_; + function greatArc() { + return { + type: "LineString", + coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ] + }; + } + greatArc.distance = function() { + return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments)); + }; + greatArc.source = function(_) { + if (!arguments.length) return source; + source = _, source_ = typeof _ === "function" ? null : _; + return greatArc; + }; + greatArc.target = function(_) { + if (!arguments.length) return target; + target = _, target_ = typeof _ === "function" ? null : _; + return greatArc; + }; + greatArc.precision = function() { + return arguments.length ? greatArc : 0; + }; + return greatArc; + }; + d3.geo.interpolate = function(source, target) { + return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians); + }; + function d3_geo_interpolate(x0, y0, x1, y1) { + var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d); + var interpolate = d ? function(t) { + var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1; + return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ]; + } : function() { + return [ x0 * d3_degrees, y0 * d3_degrees ]; + }; + interpolate.distance = d; + return interpolate; + } + d3.geo.length = function(object) { + d3_geo_lengthSum = 0; + d3.geo.stream(object, d3_geo_length); + return d3_geo_lengthSum; + }; + var d3_geo_lengthSum; + var d3_geo_length = { + sphere: d3_noop, + point: d3_noop, + lineStart: d3_geo_lengthLineStart, + lineEnd: d3_noop, + polygonStart: d3_noop, + polygonEnd: d3_noop + }; + function d3_geo_lengthLineStart() { + var λ0, sinφ0, cosφ0; + d3_geo_length.point = function(λ, φ) { + λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ); + d3_geo_length.point = nextPoint; + }; + d3_geo_length.lineEnd = function() { + d3_geo_length.point = d3_geo_length.lineEnd = d3_noop; + }; + function nextPoint(λ, φ) { + var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t); + d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ); + λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ; + } + } + function d3_geo_azimuthal(scale, angle) { + function azimuthal(λ, φ) { + var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ); + return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ]; + } + azimuthal.invert = function(x, y) { + var Ï = Math.sqrt(x * x + y * y), c = angle(Ï), sinc = Math.sin(c), cosc = Math.cos(c); + return [ Math.atan2(x * sinc, Ï * cosc), Math.asin(Ï && y * sinc / Ï) ]; + }; + return azimuthal; + } + var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) { + return Math.sqrt(2 / (1 + cosλcosφ)); + }, function(Ï) { + return 2 * Math.asin(Ï / 2); + }); + (d3.geo.azimuthalEqualArea = function() { + return d3_geo_projection(d3_geo_azimuthalEqualArea); + }).raw = d3_geo_azimuthalEqualArea; + var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) { + var c = Math.acos(cosλcosφ); + return c && c / Math.sin(c); + }, d3_identity); + (d3.geo.azimuthalEquidistant = function() { + return d3_geo_projection(d3_geo_azimuthalEquidistant); + }).raw = d3_geo_azimuthalEquidistant; + function d3_geo_conicConformal(φ0, φ1) { + var cosφ0 = Math.cos(φ0), t = function(φ) { + return Math.tan(Ï€ / 4 + φ / 2); + }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n; + if (!n) return d3_geo_mercator; + function forward(λ, φ) { + if (F > 0) { + if (φ < -halfÏ€ + ε) φ = -halfÏ€ + ε; + } else { + if (φ > halfÏ€ - ε) φ = halfÏ€ - ε; + } + var Ï = F / Math.pow(t(φ), n); + return [ Ï * Math.sin(n * λ), F - Ï * Math.cos(n * λ) ]; + } + forward.invert = function(x, y) { + var Ï0_y = F - y, Ï = d3_sgn(n) * Math.sqrt(x * x + Ï0_y * Ï0_y); + return [ Math.atan2(x, Ï0_y) / n, 2 * Math.atan(Math.pow(F / Ï, 1 / n)) - halfÏ€ ]; + }; + return forward; + } + (d3.geo.conicConformal = function() { + return d3_geo_conic(d3_geo_conicConformal); + }).raw = d3_geo_conicConformal; + function d3_geo_conicEquidistant(φ0, φ1) { + var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0; + if (abs(n) < ε) return d3_geo_equirectangular; + function forward(λ, φ) { + var Ï = G - φ; + return [ Ï * Math.sin(n * λ), G - Ï * Math.cos(n * λ) ]; + } + forward.invert = function(x, y) { + var Ï0_y = G - y; + return [ Math.atan2(x, Ï0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + Ï0_y * Ï0_y) ]; + }; + return forward; + } + (d3.geo.conicEquidistant = function() { + return d3_geo_conic(d3_geo_conicEquidistant); + }).raw = d3_geo_conicEquidistant; + var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) { + return 1 / cosλcosφ; + }, Math.atan); + (d3.geo.gnomonic = function() { + return d3_geo_projection(d3_geo_gnomonic); + }).raw = d3_geo_gnomonic; + function d3_geo_mercator(λ, φ) { + return [ λ, Math.log(Math.tan(Ï€ / 4 + φ / 2)) ]; + } + d3_geo_mercator.invert = function(x, y) { + return [ x, 2 * Math.atan(Math.exp(y)) - halfÏ€ ]; + }; + function d3_geo_mercatorProjection(project) { + var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto; + m.scale = function() { + var v = scale.apply(m, arguments); + return v === m ? clipAuto ? m.clipExtent(null) : m : v; + }; + m.translate = function() { + var v = translate.apply(m, arguments); + return v === m ? clipAuto ? m.clipExtent(null) : m : v; + }; + m.clipExtent = function(_) { + var v = clipExtent.apply(m, arguments); + if (v === m) { + if (clipAuto = _ == null) { + var k = Ï€ * scale(), t = translate(); + clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]); + } + } else if (clipAuto) { + v = null; + } + return v; + }; + return m.clipExtent(null); + } + (d3.geo.mercator = function() { + return d3_geo_mercatorProjection(d3_geo_mercator); + }).raw = d3_geo_mercator; + var d3_geo_orthographic = d3_geo_azimuthal(function() { + return 1; + }, Math.asin); + (d3.geo.orthographic = function() { + return d3_geo_projection(d3_geo_orthographic); + }).raw = d3_geo_orthographic; + var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) { + return 1 / (1 + cosλcosφ); + }, function(Ï) { + return 2 * Math.atan(Ï); + }); + (d3.geo.stereographic = function() { + return d3_geo_projection(d3_geo_stereographic); + }).raw = d3_geo_stereographic; + function d3_geo_transverseMercator(λ, φ) { + return [ Math.log(Math.tan(Ï€ / 4 + φ / 2)), -λ ]; + } + d3_geo_transverseMercator.invert = function(x, y) { + return [ -y, 2 * Math.atan(Math.exp(x)) - halfÏ€ ]; + }; + (d3.geo.transverseMercator = function() { + var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate; + projection.center = function(_) { + return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]); + }; + projection.rotate = function(_) { + return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), + [ _[0], _[1], _[2] - 90 ]); + }; + return rotate([ 0, 0, 90 ]); + }).raw = d3_geo_transverseMercator; + d3.geom = {}; + function d3_geom_pointX(d) { + return d[0]; + } + function d3_geom_pointY(d) { + return d[1]; + } + d3.geom.hull = function(vertices) { + var x = d3_geom_pointX, y = d3_geom_pointY; + if (arguments.length) return hull(vertices); + function hull(data) { + if (data.length < 3) return []; + var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = []; + for (i = 0; i < n; i++) { + points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]); + } + points.sort(d3_geom_hullOrder); + for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]); + var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints); + var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = []; + for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]); + for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]); + return polygon; + } + hull.x = function(_) { + return arguments.length ? (x = _, hull) : x; + }; + hull.y = function(_) { + return arguments.length ? (y = _, hull) : y; + }; + return hull; + }; + function d3_geom_hullUpper(points) { + var n = points.length, hull = [ 0, 1 ], hs = 2; + for (var i = 2; i < n; i++) { + while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs; + hull[hs++] = i; + } + return hull.slice(0, hs); + } + function d3_geom_hullOrder(a, b) { + return a[0] - b[0] || a[1] - b[1]; + } + d3.geom.polygon = function(coordinates) { + d3_subclass(coordinates, d3_geom_polygonPrototype); + return coordinates; + }; + var d3_geom_polygonPrototype = d3.geom.polygon.prototype = []; + d3_geom_polygonPrototype.area = function() { + var i = -1, n = this.length, a, b = this[n - 1], area = 0; + while (++i < n) { + a = b; + b = this[i]; + area += a[1] * b[0] - a[0] * b[1]; + } + return area * .5; + }; + d3_geom_polygonPrototype.centroid = function(k) { + var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c; + if (!arguments.length) k = -1 / (6 * this.area()); + while (++i < n) { + a = b; + b = this[i]; + c = a[0] * b[1] - b[0] * a[1]; + x += (a[0] + b[0]) * c; + y += (a[1] + b[1]) * c; + } + return [ x * k, y * k ]; + }; + d3_geom_polygonPrototype.clip = function(subject) { + var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d; + while (++i < n) { + input = subject.slice(); + subject.length = 0; + b = this[i]; + c = input[(m = input.length - closed) - 1]; + j = -1; + while (++j < m) { + d = input[j]; + if (d3_geom_polygonInside(d, a, b)) { + if (!d3_geom_polygonInside(c, a, b)) { + subject.push(d3_geom_polygonIntersect(c, d, a, b)); + } + subject.push(d); + } else if (d3_geom_polygonInside(c, a, b)) { + subject.push(d3_geom_polygonIntersect(c, d, a, b)); + } + c = d; + } + if (closed) subject.push(subject[0]); + a = b; + } + return subject; + }; + function d3_geom_polygonInside(p, a, b) { + return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]); + } + function d3_geom_polygonIntersect(c, d, a, b) { + var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21); + return [ x1 + ua * x21, y1 + ua * y21 ]; + } + function d3_geom_polygonClosed(coordinates) { + var a = coordinates[0], b = coordinates[coordinates.length - 1]; + return !(a[0] - b[0] || a[1] - b[1]); + } + var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = []; + function d3_geom_voronoiBeach() { + d3_geom_voronoiRedBlackNode(this); + this.edge = this.site = this.circle = null; + } + function d3_geom_voronoiCreateBeach(site) { + var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach(); + beach.site = site; + return beach; + } + function d3_geom_voronoiDetachBeach(beach) { + d3_geom_voronoiDetachCircle(beach); + d3_geom_voronoiBeaches.remove(beach); + d3_geom_voronoiBeachPool.push(beach); + d3_geom_voronoiRedBlackNode(beach); + } + function d3_geom_voronoiRemoveBeach(beach) { + var circle = beach.circle, x = circle.x, y = circle.cy, vertex = { + x: x, + y: y + }, previous = beach.P, next = beach.N, disappearing = [ beach ]; + d3_geom_voronoiDetachBeach(beach); + var lArc = previous; + while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) { + previous = lArc.P; + disappearing.unshift(lArc); + d3_geom_voronoiDetachBeach(lArc); + lArc = previous; + } + disappearing.unshift(lArc); + d3_geom_voronoiDetachCircle(lArc); + var rArc = next; + while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) { + next = rArc.N; + disappearing.push(rArc); + d3_geom_voronoiDetachBeach(rArc); + rArc = next; + } + disappearing.push(rArc); + d3_geom_voronoiDetachCircle(rArc); + var nArcs = disappearing.length, iArc; + for (iArc = 1; iArc < nArcs; ++iArc) { + rArc = disappearing[iArc]; + lArc = disappearing[iArc - 1]; + d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex); + } + lArc = disappearing[0]; + rArc = disappearing[nArcs - 1]; + rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + } + function d3_geom_voronoiAddBeach(site) { + var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._; + while (node) { + dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x; + if (dxl > ε) node = node.L; else { + dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix); + if (dxr > ε) { + if (!node.R) { + lArc = node; + break; + } + node = node.R; + } else { + if (dxl > -ε) { + lArc = node.P; + rArc = node; + } else if (dxr > -ε) { + lArc = node; + rArc = node.N; + } else { + lArc = rArc = node; + } + break; + } + } + } + var newArc = d3_geom_voronoiCreateBeach(site); + d3_geom_voronoiBeaches.insert(lArc, newArc); + if (!lArc && !rArc) return; + if (lArc === rArc) { + d3_geom_voronoiDetachCircle(lArc); + rArc = d3_geom_voronoiCreateBeach(lArc.site); + d3_geom_voronoiBeaches.insert(newArc, rArc); + newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + return; + } + if (!rArc) { + newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); + return; + } + d3_geom_voronoiDetachCircle(lArc); + d3_geom_voronoiDetachCircle(rArc); + var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = { + x: (cy * hb - by * hc) / d + ax, + y: (bx * hc - cx * hb) / d + ay + }; + d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex); + newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex); + rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + } + function d3_geom_voronoiLeftBreakPoint(arc, directrix) { + var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix; + if (!pby2) return rfocx; + var lArc = arc.P; + if (!lArc) return -Infinity; + site = lArc.site; + var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix; + if (!plby2) return lfocx; + var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2; + if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; + return (rfocx + lfocx) / 2; + } + function d3_geom_voronoiRightBreakPoint(arc, directrix) { + var rArc = arc.N; + if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix); + var site = arc.site; + return site.y === directrix ? site.x : Infinity; + } + function d3_geom_voronoiCell(site) { + this.site = site; + this.edges = []; + } + d3_geom_voronoiCell.prototype.prepare = function() { + var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge; + while (iHalfEdge--) { + edge = halfEdges[iHalfEdge].edge; + if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1); + } + halfEdges.sort(d3_geom_voronoiHalfEdgeOrder); + return halfEdges.length; + }; + function d3_geom_voronoiCloseCells(extent) { + var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end; + while (iCell--) { + cell = cells[iCell]; + if (!cell || !cell.prepare()) continue; + halfEdges = cell.edges; + nHalfEdges = halfEdges.length; + iHalfEdge = 0; + while (iHalfEdge < nHalfEdges) { + end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y; + start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y; + if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) { + halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? { + x: x0, + y: abs(x2 - x0) < ε ? y2 : y1 + } : abs(y3 - y1) < ε && x1 - x3 > ε ? { + x: abs(y2 - y1) < ε ? x2 : x1, + y: y1 + } : abs(x3 - x1) < ε && y3 - y0 > ε ? { + x: x1, + y: abs(x2 - x1) < ε ? y2 : y0 + } : abs(y3 - y0) < ε && x3 - x0 > ε ? { + x: abs(y2 - y0) < ε ? x2 : x0, + y: y0 + } : null), cell.site, null)); + ++nHalfEdges; + } + } + } + } + function d3_geom_voronoiHalfEdgeOrder(a, b) { + return b.angle - a.angle; + } + function d3_geom_voronoiCircle() { + d3_geom_voronoiRedBlackNode(this); + this.x = this.y = this.arc = this.site = this.cy = null; + } + function d3_geom_voronoiAttachCircle(arc) { + var lArc = arc.P, rArc = arc.N; + if (!lArc || !rArc) return; + var lSite = lArc.site, cSite = arc.site, rSite = rArc.site; + if (lSite === rSite) return; + var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by; + var d = 2 * (ax * cy - ay * cx); + if (d >= -ε2) return; + var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by; + var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle(); + circle.arc = arc; + circle.site = cSite; + circle.x = x + bx; + circle.y = cy + Math.sqrt(x * x + y * y); + circle.cy = cy; + arc.circle = circle; + var before = null, node = d3_geom_voronoiCircles._; + while (node) { + if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) { + if (node.L) node = node.L; else { + before = node.P; + break; + } + } else { + if (node.R) node = node.R; else { + before = node; + break; + } + } + } + d3_geom_voronoiCircles.insert(before, circle); + if (!before) d3_geom_voronoiFirstCircle = circle; + } + function d3_geom_voronoiDetachCircle(arc) { + var circle = arc.circle; + if (circle) { + if (!circle.P) d3_geom_voronoiFirstCircle = circle.N; + d3_geom_voronoiCircles.remove(circle); + d3_geom_voronoiCirclePool.push(circle); + d3_geom_voronoiRedBlackNode(circle); + arc.circle = null; + } + } + function d3_geom_voronoiClipEdges(extent) { + var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e; + while (i--) { + e = edges[i]; + if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) { + e.a = e.b = null; + edges.splice(i, 1); + } + } + } + function d3_geom_voronoiConnectEdge(edge, extent) { + var vb = edge.b; + if (vb) return true; + var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb; + if (ry === ly) { + if (fx < x0 || fx >= x1) return; + if (lx > rx) { + if (!va) va = { + x: fx, + y: y0 + }; else if (va.y >= y1) return; + vb = { + x: fx, + y: y1 + }; + } else { + if (!va) va = { + x: fx, + y: y1 + }; else if (va.y < y0) return; + vb = { + x: fx, + y: y0 + }; + } + } else { + fm = (lx - rx) / (ry - ly); + fb = fy - fm * fx; + if (fm < -1 || fm > 1) { + if (lx > rx) { + if (!va) va = { + x: (y0 - fb) / fm, + y: y0 + }; else if (va.y >= y1) return; + vb = { + x: (y1 - fb) / fm, + y: y1 + }; + } else { + if (!va) va = { + x: (y1 - fb) / fm, + y: y1 + }; else if (va.y < y0) return; + vb = { + x: (y0 - fb) / fm, + y: y0 + }; + } + } else { + if (ly < ry) { + if (!va) va = { + x: x0, + y: fm * x0 + fb + }; else if (va.x >= x1) return; + vb = { + x: x1, + y: fm * x1 + fb + }; + } else { + if (!va) va = { + x: x1, + y: fm * x1 + fb + }; else if (va.x < x0) return; + vb = { + x: x0, + y: fm * x0 + fb + }; + } + } + } + edge.a = va; + edge.b = vb; + return true; + } + function d3_geom_voronoiEdge(lSite, rSite) { + this.l = lSite; + this.r = rSite; + this.a = this.b = null; + } + function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) { + var edge = new d3_geom_voronoiEdge(lSite, rSite); + d3_geom_voronoiEdges.push(edge); + if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va); + if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb); + d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite)); + d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite)); + return edge; + } + function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) { + var edge = new d3_geom_voronoiEdge(lSite, null); + edge.a = va; + edge.b = vb; + d3_geom_voronoiEdges.push(edge); + return edge; + } + function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) { + if (!edge.a && !edge.b) { + edge.a = vertex; + edge.l = lSite; + edge.r = rSite; + } else if (edge.l === rSite) { + edge.b = vertex; + } else { + edge.a = vertex; + } + } + function d3_geom_voronoiHalfEdge(edge, lSite, rSite) { + var va = edge.a, vb = edge.b; + this.edge = edge; + this.site = lSite; + this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y); + } + d3_geom_voronoiHalfEdge.prototype = { + start: function() { + return this.edge.l === this.site ? this.edge.a : this.edge.b; + }, + end: function() { + return this.edge.l === this.site ? this.edge.b : this.edge.a; + } + }; + function d3_geom_voronoiRedBlackTree() { + this._ = null; + } + function d3_geom_voronoiRedBlackNode(node) { + node.U = node.C = node.L = node.R = node.P = node.N = null; + } + d3_geom_voronoiRedBlackTree.prototype = { + insert: function(after, node) { + var parent, grandpa, uncle; + if (after) { + node.P = after; + node.N = after.N; + if (after.N) after.N.P = node; + after.N = node; + if (after.R) { + after = after.R; + while (after.L) after = after.L; + after.L = node; + } else { + after.R = node; + } + parent = after; + } else if (this._) { + after = d3_geom_voronoiRedBlackFirst(this._); + node.P = null; + node.N = after; + after.P = after.L = node; + parent = after; + } else { + node.P = node.N = null; + this._ = node; + parent = null; + } + node.L = node.R = null; + node.U = parent; + node.C = true; + after = node; + while (parent && parent.C) { + grandpa = parent.U; + if (parent === grandpa.L) { + uncle = grandpa.R; + if (uncle && uncle.C) { + parent.C = uncle.C = false; + grandpa.C = true; + after = grandpa; + } else { + if (after === parent.R) { + d3_geom_voronoiRedBlackRotateLeft(this, parent); + after = parent; + parent = after.U; + } + parent.C = false; + grandpa.C = true; + d3_geom_voronoiRedBlackRotateRight(this, grandpa); + } + } else { + uncle = grandpa.L; + if (uncle && uncle.C) { + parent.C = uncle.C = false; + grandpa.C = true; + after = grandpa; + } else { + if (after === parent.L) { + d3_geom_voronoiRedBlackRotateRight(this, parent); + after = parent; + parent = after.U; + } + parent.C = false; + grandpa.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, grandpa); + } + } + parent = after.U; + } + this._.C = false; + }, + remove: function(node) { + if (node.N) node.N.P = node.P; + if (node.P) node.P.N = node.N; + node.N = node.P = null; + var parent = node.U, sibling, left = node.L, right = node.R, next, red; + if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right); + if (parent) { + if (parent.L === node) parent.L = next; else parent.R = next; + } else { + this._ = next; + } + if (left && right) { + red = next.C; + next.C = node.C; + next.L = left; + left.U = next; + if (next !== right) { + parent = next.U; + next.U = node.U; + node = next.R; + parent.L = node; + next.R = right; + right.U = next; + } else { + next.U = parent; + parent = next; + node = next.R; + } + } else { + red = node.C; + node = next; + } + if (node) node.U = parent; + if (red) return; + if (node && node.C) { + node.C = false; + return; + } + do { + if (node === this._) break; + if (node === parent.L) { + sibling = parent.R; + if (sibling.C) { + sibling.C = false; + parent.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, parent); + sibling = parent.R; + } + if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { + if (!sibling.R || !sibling.R.C) { + sibling.L.C = false; + sibling.C = true; + d3_geom_voronoiRedBlackRotateRight(this, sibling); + sibling = parent.R; + } + sibling.C = parent.C; + parent.C = sibling.R.C = false; + d3_geom_voronoiRedBlackRotateLeft(this, parent); + node = this._; + break; + } + } else { + sibling = parent.L; + if (sibling.C) { + sibling.C = false; + parent.C = true; + d3_geom_voronoiRedBlackRotateRight(this, parent); + sibling = parent.L; + } + if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { + if (!sibling.L || !sibling.L.C) { + sibling.R.C = false; + sibling.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, sibling); + sibling = parent.L; + } + sibling.C = parent.C; + parent.C = sibling.L.C = false; + d3_geom_voronoiRedBlackRotateRight(this, parent); + node = this._; + break; + } + } + sibling.C = true; + node = parent; + parent = parent.U; + } while (!node.C); + if (node) node.C = false; + } + }; + function d3_geom_voronoiRedBlackRotateLeft(tree, node) { + var p = node, q = node.R, parent = p.U; + if (parent) { + if (parent.L === p) parent.L = q; else parent.R = q; + } else { + tree._ = q; + } + q.U = parent; + p.U = q; + p.R = q.L; + if (p.R) p.R.U = p; + q.L = p; + } + function d3_geom_voronoiRedBlackRotateRight(tree, node) { + var p = node, q = node.L, parent = p.U; + if (parent) { + if (parent.L === p) parent.L = q; else parent.R = q; + } else { + tree._ = q; + } + q.U = parent; + p.U = q; + p.L = q.R; + if (p.L) p.L.U = p; + q.R = p; + } + function d3_geom_voronoiRedBlackFirst(node) { + while (node.L) node = node.L; + return node; + } + function d3_geom_voronoi(sites, bbox) { + var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle; + d3_geom_voronoiEdges = []; + d3_geom_voronoiCells = new Array(sites.length); + d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree(); + d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree(); + while (true) { + circle = d3_geom_voronoiFirstCircle; + if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) { + if (site.x !== x0 || site.y !== y0) { + d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site); + d3_geom_voronoiAddBeach(site); + x0 = site.x, y0 = site.y; + } + site = sites.pop(); + } else if (circle) { + d3_geom_voronoiRemoveBeach(circle.arc); + } else { + break; + } + } + if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox); + var diagram = { + cells: d3_geom_voronoiCells, + edges: d3_geom_voronoiEdges + }; + d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null; + return diagram; + } + function d3_geom_voronoiVertexOrder(a, b) { + return b.y - a.y || b.x - a.x; + } + d3.geom.voronoi = function(points) { + var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent; + if (points) return voronoi(points); + function voronoi(data) { + var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1]; + d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) { + var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) { + var s = e.start(); + return [ s.x, s.y ]; + }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : []; + polygon.point = data[i]; + }); + return polygons; + } + function sites(data) { + return data.map(function(d, i) { + return { + x: Math.round(fx(d, i) / ε) * ε, + y: Math.round(fy(d, i) / ε) * ε, + i: i + }; + }); + } + voronoi.links = function(data) { + return d3_geom_voronoi(sites(data)).edges.filter(function(edge) { + return edge.l && edge.r; + }).map(function(edge) { + return { + source: data[edge.l.i], + target: data[edge.r.i] + }; + }); + }; + voronoi.triangles = function(data) { + var triangles = []; + d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) { + var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l; + while (++j < m) { + e0 = e1; + s0 = s1; + e1 = edges[j].edge; + s1 = e1.l === site ? e1.r : e1.l; + if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) { + triangles.push([ data[i], data[s0.i], data[s1.i] ]); + } + } + }); + return triangles; + }; + voronoi.x = function(_) { + return arguments.length ? (fx = d3_functor(x = _), voronoi) : x; + }; + voronoi.y = function(_) { + return arguments.length ? (fy = d3_functor(y = _), voronoi) : y; + }; + voronoi.clipExtent = function(_) { + if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent; + clipExtent = _ == null ? d3_geom_voronoiClipExtent : _; + return voronoi; + }; + voronoi.size = function(_) { + if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1]; + return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]); + }; + return voronoi; + }; + var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ]; + function d3_geom_voronoiTriangleArea(a, b, c) { + return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y); + } + d3.geom.delaunay = function(vertices) { + return d3.geom.voronoi().triangles(vertices); + }; + d3.geom.quadtree = function(points, x1, y1, x2, y2) { + var x = d3_geom_pointX, y = d3_geom_pointY, compat; + if (compat = arguments.length) { + x = d3_geom_quadtreeCompatX; + y = d3_geom_quadtreeCompatY; + if (compat === 3) { + y2 = y1; + x2 = x1; + y1 = x1 = 0; + } + return quadtree(points); + } + function quadtree(data) { + var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_; + if (x1 != null) { + x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2; + } else { + x2_ = y2_ = -(x1_ = y1_ = Infinity); + xs = [], ys = []; + n = data.length; + if (compat) for (i = 0; i < n; ++i) { + d = data[i]; + if (d.x < x1_) x1_ = d.x; + if (d.y < y1_) y1_ = d.y; + if (d.x > x2_) x2_ = d.x; + if (d.y > y2_) y2_ = d.y; + xs.push(d.x); + ys.push(d.y); + } else for (i = 0; i < n; ++i) { + var x_ = +fx(d = data[i], i), y_ = +fy(d, i); + if (x_ < x1_) x1_ = x_; + if (y_ < y1_) y1_ = y_; + if (x_ > x2_) x2_ = x_; + if (y_ > y2_) y2_ = y_; + xs.push(x_); + ys.push(y_); + } + } + var dx = x2_ - x1_, dy = y2_ - y1_; + if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy; + function insert(n, d, x, y, x1, y1, x2, y2) { + if (isNaN(x) || isNaN(y)) return; + if (n.leaf) { + var nx = n.x, ny = n.y; + if (nx != null) { + if (abs(nx - x) + abs(ny - y) < .01) { + insertChild(n, d, x, y, x1, y1, x2, y2); + } else { + var nPoint = n.point; + n.x = n.y = n.point = null; + insertChild(n, nPoint, nx, ny, x1, y1, x2, y2); + insertChild(n, d, x, y, x1, y1, x2, y2); + } + } else { + n.x = x, n.y = y, n.point = d; + } + } else { + insertChild(n, d, x, y, x1, y1, x2, y2); + } + } + function insertChild(n, d, x, y, x1, y1, x2, y2) { + var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right; + n.leaf = false; + n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode()); + if (right) x1 = xm; else x2 = xm; + if (below) y1 = ym; else y2 = ym; + insert(n, d, x, y, x1, y1, x2, y2); + } + var root = d3_geom_quadtreeNode(); + root.add = function(d) { + insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_); + }; + root.visit = function(f) { + d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_); + }; + root.find = function(point) { + return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_); + }; + i = -1; + if (x1 == null) { + while (++i < n) { + insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_); + } + --i; + } else data.forEach(root.add); + xs = ys = data = d = null; + return root; + } + quadtree.x = function(_) { + return arguments.length ? (x = _, quadtree) : x; + }; + quadtree.y = function(_) { + return arguments.length ? (y = _, quadtree) : y; + }; + quadtree.extent = function(_) { + if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ]; + if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], + y2 = +_[1][1]; + return quadtree; + }; + quadtree.size = function(_) { + if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ]; + if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1]; + return quadtree; + }; + return quadtree; + }; + function d3_geom_quadtreeCompatX(d) { + return d.x; + } + function d3_geom_quadtreeCompatY(d) { + return d.y; + } + function d3_geom_quadtreeNode() { + return { + leaf: true, + nodes: [], + point: null, + x: null, + y: null + }; + } + function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) { + if (!f(node, x1, y1, x2, y2)) { + var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes; + if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy); + if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy); + if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2); + if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2); + } + } + function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) { + var minDistance2 = Infinity, closestPoint; + (function find(node, x1, y1, x2, y2) { + if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return; + if (point = node.point) { + var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy; + if (distance2 < minDistance2) { + var distance = Math.sqrt(minDistance2 = distance2); + x0 = x - distance, y0 = y - distance; + x3 = x + distance, y3 = y + distance; + closestPoint = point; + } + } + var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym; + for (var i = below << 1 | right, j = i + 4; i < j; ++i) { + if (node = children[i & 3]) switch (i & 3) { + case 0: + find(node, x1, y1, xm, ym); + break; + + case 1: + find(node, xm, y1, x2, ym); + break; + + case 2: + find(node, x1, ym, xm, y2); + break; + + case 3: + find(node, xm, ym, x2, y2); + break; + } + } + })(root, x0, y0, x3, y3); + return closestPoint; + } + d3.interpolateRgb = d3_interpolateRgb; + function d3_interpolateRgb(a, b) { + a = d3.rgb(a); + b = d3.rgb(b); + var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab; + return function(t) { + return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t)); + }; + } + d3.interpolateObject = d3_interpolateObject; + function d3_interpolateObject(a, b) { + var i = {}, c = {}, k; + for (k in a) { + if (k in b) { + i[k] = d3_interpolate(a[k], b[k]); + } else { + c[k] = a[k]; + } + } + for (k in b) { + if (!(k in a)) { + c[k] = b[k]; + } + } + return function(t) { + for (k in i) c[k] = i[k](t); + return c; + }; + } + d3.interpolateNumber = d3_interpolateNumber; + function d3_interpolateNumber(a, b) { + a = +a, b = +b; + return function(t) { + return a * (1 - t) + b * t; + }; + } + d3.interpolateString = d3_interpolateString; + function d3_interpolateString(a, b) { + var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = []; + a = a + "", b = b + ""; + while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) { + if ((bs = bm.index) > bi) { + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { + if (s[i]) s[i] += bm; else s[++i] = bm; + } else { + s[++i] = null; + q.push({ + i: i, + x: d3_interpolateNumber(am, bm) + }); + } + bi = d3_interpolate_numberB.lastIndex; + } + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; else s[++i] = bs; + } + return s.length < 2 ? q[0] ? (b = q[0].x, function(t) { + return b(t) + ""; + }) : function() { + return b; + } : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); + } + var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g"); + d3.interpolate = d3_interpolate; + function d3_interpolate(a, b) { + var i = d3.interpolators.length, f; + while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ; + return f; + } + d3.interpolators = [ function(a, b) { + var t = typeof b; + return (t === "string" ? d3_rgb_names.has(b.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b); + } ]; + d3.interpolateArray = d3_interpolateArray; + function d3_interpolateArray(a, b) { + var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i; + for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i])); + for (;i < na; ++i) c[i] = a[i]; + for (;i < nb; ++i) c[i] = b[i]; + return function(t) { + for (i = 0; i < n0; ++i) c[i] = x[i](t); + return c; + }; + } + var d3_ease_default = function() { + return d3_identity; + }; + var d3_ease = d3.map({ + linear: d3_ease_default, + poly: d3_ease_poly, + quad: function() { + return d3_ease_quad; + }, + cubic: function() { + return d3_ease_cubic; + }, + sin: function() { + return d3_ease_sin; + }, + exp: function() { + return d3_ease_exp; + }, + circle: function() { + return d3_ease_circle; + }, + elastic: d3_ease_elastic, + back: d3_ease_back, + bounce: function() { + return d3_ease_bounce; + } + }); + var d3_ease_mode = d3.map({ + "in": d3_identity, + out: d3_ease_reverse, + "in-out": d3_ease_reflect, + "out-in": function(f) { + return d3_ease_reflect(d3_ease_reverse(f)); + } + }); + d3.ease = function(name) { + var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in"; + t = d3_ease.get(t) || d3_ease_default; + m = d3_ease_mode.get(m) || d3_identity; + return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1)))); + }; + function d3_ease_clamp(f) { + return function(t) { + return t <= 0 ? 0 : t >= 1 ? 1 : f(t); + }; + } + function d3_ease_reverse(f) { + return function(t) { + return 1 - f(1 - t); + }; + } + function d3_ease_reflect(f) { + return function(t) { + return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t)); + }; + } + function d3_ease_quad(t) { + return t * t; + } + function d3_ease_cubic(t) { + return t * t * t; + } + function d3_ease_cubicInOut(t) { + if (t <= 0) return 0; + if (t >= 1) return 1; + var t2 = t * t, t3 = t2 * t; + return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75); + } + function d3_ease_poly(e) { + return function(t) { + return Math.pow(t, e); + }; + } + function d3_ease_sin(t) { + return 1 - Math.cos(t * halfÏ€); + } + function d3_ease_exp(t) { + return Math.pow(2, 10 * (t - 1)); + } + function d3_ease_circle(t) { + return 1 - Math.sqrt(1 - t * t); + } + function d3_ease_elastic(a, p) { + var s; + if (arguments.length < 2) p = .45; + if (arguments.length) s = p / Ï„ * Math.asin(1 / a); else a = 1, s = p / 4; + return function(t) { + return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * Ï„ / p); + }; + } + function d3_ease_back(s) { + if (!s) s = 1.70158; + return function(t) { + return t * t * ((s + 1) * t - s); + }; + } + function d3_ease_bounce(t) { + return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375; + } + d3.interpolateHcl = d3_interpolateHcl; + function d3_interpolateHcl(a, b) { + a = d3.hcl(a); + b = d3.hcl(b); + var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al; + if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac; + if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; + return function(t) { + return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + ""; + }; + } + d3.interpolateHsl = d3_interpolateHsl; + function d3_interpolateHsl(a, b) { + a = d3.hsl(a); + b = d3.hsl(b); + var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al; + if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as; + if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; + return function(t) { + return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + ""; + }; + } + d3.interpolateLab = d3_interpolateLab; + function d3_interpolateLab(a, b) { + a = d3.lab(a); + b = d3.lab(b); + var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab; + return function(t) { + return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + ""; + }; + } + d3.interpolateRound = d3_interpolateRound; + function d3_interpolateRound(a, b) { + b -= a; + return function(t) { + return Math.round(a + b * t); + }; + } + d3.transform = function(string) { + var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); + return (d3.transform = function(string) { + if (string != null) { + g.setAttribute("transform", string); + var t = g.transform.baseVal.consolidate(); + } + return new d3_transform(t ? t.matrix : d3_transformIdentity); + })(string); + }; + function d3_transform(m) { + var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0; + if (r0[0] * r1[1] < r1[0] * r0[1]) { + r0[0] *= -1; + r0[1] *= -1; + kx *= -1; + kz *= -1; + } + this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees; + this.translate = [ m.e, m.f ]; + this.scale = [ kx, ky ]; + this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0; + } + d3_transform.prototype.toString = function() { + return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; + }; + function d3_transformDot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + function d3_transformNormalize(a) { + var k = Math.sqrt(d3_transformDot(a, a)); + if (k) { + a[0] /= k; + a[1] /= k; + } + return k; + } + function d3_transformCombine(a, b, k) { + a[0] += k * b[0]; + a[1] += k * b[1]; + return a; + } + var d3_transformIdentity = { + a: 1, + b: 0, + c: 0, + d: 1, + e: 0, + f: 0 + }; + d3.interpolateTransform = d3_interpolateTransform; + function d3_interpolateTransform(a, b) { + var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale; + if (ta[0] != tb[0] || ta[1] != tb[1]) { + s.push("translate(", null, ",", null, ")"); + q.push({ + i: 1, + x: d3_interpolateNumber(ta[0], tb[0]) + }, { + i: 3, + x: d3_interpolateNumber(ta[1], tb[1]) + }); + } else if (tb[0] || tb[1]) { + s.push("translate(" + tb + ")"); + } else { + s.push(""); + } + if (ra != rb) { + if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360; + q.push({ + i: s.push(s.pop() + "rotate(", null, ")") - 2, + x: d3_interpolateNumber(ra, rb) + }); + } else if (rb) { + s.push(s.pop() + "rotate(" + rb + ")"); + } + if (wa != wb) { + q.push({ + i: s.push(s.pop() + "skewX(", null, ")") - 2, + x: d3_interpolateNumber(wa, wb) + }); + } else if (wb) { + s.push(s.pop() + "skewX(" + wb + ")"); + } + if (ka[0] != kb[0] || ka[1] != kb[1]) { + n = s.push(s.pop() + "scale(", null, ",", null, ")"); + q.push({ + i: n - 4, + x: d3_interpolateNumber(ka[0], kb[0]) + }, { + i: n - 2, + x: d3_interpolateNumber(ka[1], kb[1]) + }); + } else if (kb[0] != 1 || kb[1] != 1) { + s.push(s.pop() + "scale(" + kb + ")"); + } + n = q.length; + return function(t) { + var i = -1, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + } + function d3_uninterpolateNumber(a, b) { + b = (b -= a = +a) || 1 / b; + return function(x) { + return (x - a) / b; + }; + } + function d3_uninterpolateClamp(a, b) { + b = (b -= a = +a) || 1 / b; + return function(x) { + return Math.max(0, Math.min(1, (x - a) / b)); + }; + } + d3.layout = {}; + d3.layout.bundle = function() { + return function(links) { + var paths = [], i = -1, n = links.length; + while (++i < n) paths.push(d3_layout_bundlePath(links[i])); + return paths; + }; + }; + function d3_layout_bundlePath(link) { + var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ]; + while (start !== lca) { + start = start.parent; + points.push(start); + } + var k = points.length; + while (end !== lca) { + points.splice(k, 0, end); + end = end.parent; + } + return points; + } + function d3_layout_bundleAncestors(node) { + var ancestors = [], parent = node.parent; + while (parent != null) { + ancestors.push(node); + node = parent; + parent = parent.parent; + } + ancestors.push(node); + return ancestors; + } + function d3_layout_bundleLeastCommonAncestor(a, b) { + if (a === b) return a; + var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null; + while (aNode === bNode) { + sharedNode = aNode; + aNode = aNodes.pop(); + bNode = bNodes.pop(); + } + return sharedNode; + } + d3.layout.chord = function() { + var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords; + function relayout() { + var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j; + chords = []; + groups = []; + k = 0, i = -1; + while (++i < n) { + x = 0, j = -1; + while (++j < n) { + x += matrix[i][j]; + } + groupSums.push(x); + subgroupIndex.push(d3.range(n)); + k += x; + } + if (sortGroups) { + groupIndex.sort(function(a, b) { + return sortGroups(groupSums[a], groupSums[b]); + }); + } + if (sortSubgroups) { + subgroupIndex.forEach(function(d, i) { + d.sort(function(a, b) { + return sortSubgroups(matrix[i][a], matrix[i][b]); + }); + }); + } + k = (Ï„ - padding * n) / k; + x = 0, i = -1; + while (++i < n) { + x0 = x, j = -1; + while (++j < n) { + var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k; + subgroups[di + "-" + dj] = { + index: di, + subindex: dj, + startAngle: a0, + endAngle: a1, + value: v + }; + } + groups[di] = { + index: di, + startAngle: x0, + endAngle: x, + value: (x - x0) / k + }; + x += padding; + } + i = -1; + while (++i < n) { + j = i - 1; + while (++j < n) { + var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i]; + if (source.value || target.value) { + chords.push(source.value < target.value ? { + source: target, + target: source + } : { + source: source, + target: target + }); + } + } + } + if (sortChords) resort(); + } + function resort() { + chords.sort(function(a, b) { + return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2); + }); + } + chord.matrix = function(x) { + if (!arguments.length) return matrix; + n = (matrix = x) && matrix.length; + chords = groups = null; + return chord; + }; + chord.padding = function(x) { + if (!arguments.length) return padding; + padding = x; + chords = groups = null; + return chord; + }; + chord.sortGroups = function(x) { + if (!arguments.length) return sortGroups; + sortGroups = x; + chords = groups = null; + return chord; + }; + chord.sortSubgroups = function(x) { + if (!arguments.length) return sortSubgroups; + sortSubgroups = x; + chords = null; + return chord; + }; + chord.sortChords = function(x) { + if (!arguments.length) return sortChords; + sortChords = x; + if (chords) resort(); + return chord; + }; + chord.chords = function() { + if (!chords) relayout(); + return chords; + }; + chord.groups = function() { + if (!groups) relayout(); + return groups; + }; + return chord; + }; + d3.layout.force = function() { + var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges; + function repulse(node) { + return function(quad, x1, _, x2) { + if (quad.point !== node) { + var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy; + if (dw * dw / theta2 < dn) { + if (dn < chargeDistance2) { + var k = quad.charge / dn; + node.px -= dx * k; + node.py -= dy * k; + } + return true; + } + if (quad.point && dn && dn < chargeDistance2) { + var k = quad.pointCharge / dn; + node.px -= dx * k; + node.py -= dy * k; + } + } + return !quad.charge; + }; + } + force.tick = function() { + if ((alpha *= .99) < .005) { + event.end({ + type: "end", + alpha: alpha = 0 + }); + return true; + } + var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y; + for (i = 0; i < m; ++i) { + o = links[i]; + s = o.source; + t = o.target; + x = t.x - s.x; + y = t.y - s.y; + if (l = x * x + y * y) { + l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; + x *= l; + y *= l; + t.x -= x * (k = s.weight / (t.weight + s.weight)); + t.y -= y * k; + s.x += x * (k = 1 - k); + s.y += y * k; + } + } + if (k = alpha * gravity) { + x = size[0] / 2; + y = size[1] / 2; + i = -1; + if (k) while (++i < n) { + o = nodes[i]; + o.x += (x - o.x) * k; + o.y += (y - o.y) * k; + } + } + if (charge) { + d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges); + i = -1; + while (++i < n) { + if (!(o = nodes[i]).fixed) { + q.visit(repulse(o)); + } + } + } + i = -1; + while (++i < n) { + o = nodes[i]; + if (o.fixed) { + o.x = o.px; + o.y = o.py; + } else { + o.x -= (o.px - (o.px = o.x)) * friction; + o.y -= (o.py - (o.py = o.y)) * friction; + } + } + event.tick({ + type: "tick", + alpha: alpha + }); + }; + force.nodes = function(x) { + if (!arguments.length) return nodes; + nodes = x; + return force; + }; + force.links = function(x) { + if (!arguments.length) return links; + links = x; + return force; + }; + force.size = function(x) { + if (!arguments.length) return size; + size = x; + return force; + }; + force.linkDistance = function(x) { + if (!arguments.length) return linkDistance; + linkDistance = typeof x === "function" ? x : +x; + return force; + }; + force.distance = force.linkDistance; + force.linkStrength = function(x) { + if (!arguments.length) return linkStrength; + linkStrength = typeof x === "function" ? x : +x; + return force; + }; + force.friction = function(x) { + if (!arguments.length) return friction; + friction = +x; + return force; + }; + force.charge = function(x) { + if (!arguments.length) return charge; + charge = typeof x === "function" ? x : +x; + return force; + }; + force.chargeDistance = function(x) { + if (!arguments.length) return Math.sqrt(chargeDistance2); + chargeDistance2 = x * x; + return force; + }; + force.gravity = function(x) { + if (!arguments.length) return gravity; + gravity = +x; + return force; + }; + force.theta = function(x) { + if (!arguments.length) return Math.sqrt(theta2); + theta2 = x * x; + return force; + }; + force.alpha = function(x) { + if (!arguments.length) return alpha; + x = +x; + if (alpha) { + if (x > 0) alpha = x; else alpha = 0; + } else if (x > 0) { + event.start({ + type: "start", + alpha: alpha = x + }); + d3.timer(force.tick); + } + return force; + }; + force.start = function() { + var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o; + for (i = 0; i < n; ++i) { + (o = nodes[i]).index = i; + o.weight = 0; + } + for (i = 0; i < m; ++i) { + o = links[i]; + if (typeof o.source == "number") o.source = nodes[o.source]; + if (typeof o.target == "number") o.target = nodes[o.target]; + ++o.source.weight; + ++o.target.weight; + } + for (i = 0; i < n; ++i) { + o = nodes[i]; + if (isNaN(o.x)) o.x = position("x", w); + if (isNaN(o.y)) o.y = position("y", h); + if (isNaN(o.px)) o.px = o.x; + if (isNaN(o.py)) o.py = o.y; + } + distances = []; + if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance; + strengths = []; + if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength; + charges = []; + if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge; + function position(dimension, size) { + if (!neighbors) { + neighbors = new Array(n); + for (j = 0; j < n; ++j) { + neighbors[j] = []; + } + for (j = 0; j < m; ++j) { + var o = links[j]; + neighbors[o.source.index].push(o.target); + neighbors[o.target.index].push(o.source); + } + } + var candidates = neighbors[i], j = -1, l = candidates.length, x; + while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x; + return Math.random() * size; + } + return force.resume(); + }; + force.resume = function() { + return force.alpha(.1); + }; + force.stop = function() { + return force.alpha(0); + }; + force.drag = function() { + if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend); + if (!arguments.length) return drag; + this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag); + }; + function dragmove(d) { + d.px = d3.event.x, d.py = d3.event.y; + force.resume(); + } + return d3.rebind(force, event, "on"); + }; + function d3_layout_forceDragstart(d) { + d.fixed |= 2; + } + function d3_layout_forceDragend(d) { + d.fixed &= ~6; + } + function d3_layout_forceMouseover(d) { + d.fixed |= 4; + d.px = d.x, d.py = d.y; + } + function d3_layout_forceMouseout(d) { + d.fixed &= ~4; + } + function d3_layout_forceAccumulate(quad, alpha, charges) { + var cx = 0, cy = 0; + quad.charge = 0; + if (!quad.leaf) { + var nodes = quad.nodes, n = nodes.length, i = -1, c; + while (++i < n) { + c = nodes[i]; + if (c == null) continue; + d3_layout_forceAccumulate(c, alpha, charges); + quad.charge += c.charge; + cx += c.charge * c.cx; + cy += c.charge * c.cy; + } + } + if (quad.point) { + if (!quad.leaf) { + quad.point.x += Math.random() - .5; + quad.point.y += Math.random() - .5; + } + var k = alpha * charges[quad.point.index]; + quad.charge += quad.pointCharge = k; + cx += k * quad.point.x; + cy += k * quad.point.y; + } + quad.cx = cx / quad.charge; + quad.cy = cy / quad.charge; + } + var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity; + d3.layout.hierarchy = function() { + var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; + function hierarchy(root) { + var stack = [ root ], nodes = [], node; + root.depth = 0; + while ((node = stack.pop()) != null) { + nodes.push(node); + if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) { + var n, childs, child; + while (--n >= 0) { + stack.push(child = childs[n]); + child.parent = node; + child.depth = node.depth + 1; + } + if (value) node.value = 0; + node.children = childs; + } else { + if (value) node.value = +value.call(hierarchy, node, node.depth) || 0; + delete node.children; + } + } + d3_layout_hierarchyVisitAfter(root, function(node) { + var childs, parent; + if (sort && (childs = node.children)) childs.sort(sort); + if (value && (parent = node.parent)) parent.value += node.value; + }); + return nodes; + } + hierarchy.sort = function(x) { + if (!arguments.length) return sort; + sort = x; + return hierarchy; + }; + hierarchy.children = function(x) { + if (!arguments.length) return children; + children = x; + return hierarchy; + }; + hierarchy.value = function(x) { + if (!arguments.length) return value; + value = x; + return hierarchy; + }; + hierarchy.revalue = function(root) { + if (value) { + d3_layout_hierarchyVisitBefore(root, function(node) { + if (node.children) node.value = 0; + }); + d3_layout_hierarchyVisitAfter(root, function(node) { + var parent; + if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0; + if (parent = node.parent) parent.value += node.value; + }); + } + return root; + }; + return hierarchy; + }; + function d3_layout_hierarchyRebind(object, hierarchy) { + d3.rebind(object, hierarchy, "sort", "children", "value"); + object.nodes = object; + object.links = d3_layout_hierarchyLinks; + return object; + } + function d3_layout_hierarchyVisitBefore(node, callback) { + var nodes = [ node ]; + while ((node = nodes.pop()) != null) { + callback(node); + if ((children = node.children) && (n = children.length)) { + var n, children; + while (--n >= 0) nodes.push(children[n]); + } + } + } + function d3_layout_hierarchyVisitAfter(node, callback) { + var nodes = [ node ], nodes2 = []; + while ((node = nodes.pop()) != null) { + nodes2.push(node); + if ((children = node.children) && (n = children.length)) { + var i = -1, n, children; + while (++i < n) nodes.push(children[i]); + } + } + while ((node = nodes2.pop()) != null) { + callback(node); + } + } + function d3_layout_hierarchyChildren(d) { + return d.children; + } + function d3_layout_hierarchyValue(d) { + return d.value; + } + function d3_layout_hierarchySort(a, b) { + return b.value - a.value; + } + function d3_layout_hierarchyLinks(nodes) { + return d3.merge(nodes.map(function(parent) { + return (parent.children || []).map(function(child) { + return { + source: parent, + target: child + }; + }); + })); + } + d3.layout.partition = function() { + var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ]; + function position(node, x, dx, dy) { + var children = node.children; + node.x = x; + node.y = node.depth * dy; + node.dx = dx; + node.dy = dy; + if (children && (n = children.length)) { + var i = -1, n, c, d; + dx = node.value ? dx / node.value : 0; + while (++i < n) { + position(c = children[i], x, d = c.value * dx, dy); + x += d; + } + } + } + function depth(node) { + var children = node.children, d = 0; + if (children && (n = children.length)) { + var i = -1, n; + while (++i < n) d = Math.max(d, depth(children[i])); + } + return 1 + d; + } + function partition(d, i) { + var nodes = hierarchy.call(this, d, i); + position(nodes[0], 0, size[0], size[1] / depth(nodes[0])); + return nodes; + } + partition.size = function(x) { + if (!arguments.length) return size; + size = x; + return partition; + }; + return d3_layout_hierarchyRebind(partition, hierarchy); + }; + d3.layout.pie = function() { + var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = Ï„, padAngle = 0; + function pie(data) { + var n = data.length, values = data.map(function(d, i) { + return +value.call(pie, d, i); + }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), k = (da - n * pa) / d3.sum(values), index = d3.range(n), arcs = [], v; + if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) { + return values[j] - values[i]; + } : function(i, j) { + return sort(data[i], data[j]); + }); + index.forEach(function(i) { + arcs[i] = { + data: data[i], + value: v = values[i], + startAngle: a, + endAngle: a += v * k + pa, + padAngle: p + }; + }); + return arcs; + } + pie.value = function(_) { + if (!arguments.length) return value; + value = _; + return pie; + }; + pie.sort = function(_) { + if (!arguments.length) return sort; + sort = _; + return pie; + }; + pie.startAngle = function(_) { + if (!arguments.length) return startAngle; + startAngle = _; + return pie; + }; + pie.endAngle = function(_) { + if (!arguments.length) return endAngle; + endAngle = _; + return pie; + }; + pie.padAngle = function(_) { + if (!arguments.length) return padAngle; + padAngle = _; + return pie; + }; + return pie; + }; + var d3_layout_pieSortByValue = {}; + d3.layout.stack = function() { + var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY; + function stack(data, index) { + if (!(n = data.length)) return data; + var series = data.map(function(d, i) { + return values.call(stack, d, i); + }); + var points = series.map(function(d) { + return d.map(function(v, i) { + return [ x.call(stack, v, i), y.call(stack, v, i) ]; + }); + }); + var orders = order.call(stack, points, index); + series = d3.permute(series, orders); + points = d3.permute(points, orders); + var offsets = offset.call(stack, points, index); + var m = series[0].length, n, i, j, o; + for (j = 0; j < m; ++j) { + out.call(stack, series[0][j], o = offsets[j], points[0][j][1]); + for (i = 1; i < n; ++i) { + out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]); + } + } + return data; + } + stack.values = function(x) { + if (!arguments.length) return values; + values = x; + return stack; + }; + stack.order = function(x) { + if (!arguments.length) return order; + order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault; + return stack; + }; + stack.offset = function(x) { + if (!arguments.length) return offset; + offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero; + return stack; + }; + stack.x = function(z) { + if (!arguments.length) return x; + x = z; + return stack; + }; + stack.y = function(z) { + if (!arguments.length) return y; + y = z; + return stack; + }; + stack.out = function(z) { + if (!arguments.length) return out; + out = z; + return stack; + }; + return stack; + }; + function d3_layout_stackX(d) { + return d.x; + } + function d3_layout_stackY(d) { + return d.y; + } + function d3_layout_stackOut(d, y0, y) { + d.y0 = y0; + d.y = y; + } + var d3_layout_stackOrders = d3.map({ + "inside-out": function(data) { + var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) { + return max[a] - max[b]; + }), top = 0, bottom = 0, tops = [], bottoms = []; + for (i = 0; i < n; ++i) { + j = index[i]; + if (top < bottom) { + top += sums[j]; + tops.push(j); + } else { + bottom += sums[j]; + bottoms.push(j); + } + } + return bottoms.reverse().concat(tops); + }, + reverse: function(data) { + return d3.range(data.length).reverse(); + }, + "default": d3_layout_stackOrderDefault + }); + var d3_layout_stackOffsets = d3.map({ + silhouette: function(data) { + var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = []; + for (j = 0; j < m; ++j) { + for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; + if (o > max) max = o; + sums.push(o); + } + for (j = 0; j < m; ++j) { + y0[j] = (max - sums[j]) / 2; + } + return y0; + }, + wiggle: function(data) { + var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = []; + y0[0] = o = o0 = 0; + for (j = 1; j < m; ++j) { + for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1]; + for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) { + for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) { + s3 += (data[k][j][1] - data[k][j - 1][1]) / dx; + } + s2 += s3 * data[i][j][1]; + } + y0[j] = o -= s1 ? s2 / s1 * dx : 0; + if (o < o0) o0 = o; + } + for (j = 0; j < m; ++j) y0[j] -= o0; + return y0; + }, + expand: function(data) { + var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = []; + for (j = 0; j < m; ++j) { + for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; + if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k; + } + for (j = 0; j < m; ++j) y0[j] = 0; + return y0; + }, + zero: d3_layout_stackOffsetZero + }); + function d3_layout_stackOrderDefault(data) { + return d3.range(data.length); + } + function d3_layout_stackOffsetZero(data) { + var j = -1, m = data[0].length, y0 = []; + while (++j < m) y0[j] = 0; + return y0; + } + function d3_layout_stackMaxIndex(array) { + var i = 1, j = 0, v = array[0][1], k, n = array.length; + for (;i < n; ++i) { + if ((k = array[i][1]) > v) { + j = i; + v = k; + } + } + return j; + } + function d3_layout_stackReduceSum(d) { + return d.reduce(d3_layout_stackSum, 0); + } + function d3_layout_stackSum(p, d) { + return p + d[1]; + } + d3.layout.histogram = function() { + var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges; + function histogram(data, i) { + var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x; + while (++i < m) { + bin = bins[i] = []; + bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]); + bin.y = 0; + } + if (m > 0) { + i = -1; + while (++i < n) { + x = values[i]; + if (x >= range[0] && x <= range[1]) { + bin = bins[d3.bisect(thresholds, x, 1, m) - 1]; + bin.y += k; + bin.push(data[i]); + } + } + } + return bins; + } + histogram.value = function(x) { + if (!arguments.length) return valuer; + valuer = x; + return histogram; + }; + histogram.range = function(x) { + if (!arguments.length) return ranger; + ranger = d3_functor(x); + return histogram; + }; + histogram.bins = function(x) { + if (!arguments.length) return binner; + binner = typeof x === "number" ? function(range) { + return d3_layout_histogramBinFixed(range, x); + } : d3_functor(x); + return histogram; + }; + histogram.frequency = function(x) { + if (!arguments.length) return frequency; + frequency = !!x; + return histogram; + }; + return histogram; + }; + function d3_layout_histogramBinSturges(range, values) { + return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1)); + } + function d3_layout_histogramBinFixed(range, n) { + var x = -1, b = +range[0], m = (range[1] - b) / n, f = []; + while (++x <= n) f[x] = m * x + b; + return f; + } + function d3_layout_histogramRange(values) { + return [ d3.min(values), d3.max(values) ]; + } + d3.layout.pack = function() { + var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius; + function pack(d, i) { + var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() { + return radius; + }; + root.x = root.y = 0; + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r = +r(d.value); + }); + d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); + if (padding) { + var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2; + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r += dr; + }); + d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r -= dr; + }); + } + d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h)); + return nodes; + } + pack.size = function(_) { + if (!arguments.length) return size; + size = _; + return pack; + }; + pack.radius = function(_) { + if (!arguments.length) return radius; + radius = _ == null || typeof _ === "function" ? _ : +_; + return pack; + }; + pack.padding = function(_) { + if (!arguments.length) return padding; + padding = +_; + return pack; + }; + return d3_layout_hierarchyRebind(pack, hierarchy); + }; + function d3_layout_packSort(a, b) { + return a.value - b.value; + } + function d3_layout_packInsert(a, b) { + var c = a._pack_next; + a._pack_next = b; + b._pack_prev = a; + b._pack_next = c; + c._pack_prev = b; + } + function d3_layout_packSplice(a, b) { + a._pack_next = b; + b._pack_prev = a; + } + function d3_layout_packIntersects(a, b) { + var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r; + return .999 * dr * dr > dx * dx + dy * dy; + } + function d3_layout_packSiblings(node) { + if (!(nodes = node.children) || !(n = nodes.length)) return; + var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n; + function bound(node) { + xMin = Math.min(node.x - node.r, xMin); + xMax = Math.max(node.x + node.r, xMax); + yMin = Math.min(node.y - node.r, yMin); + yMax = Math.max(node.y + node.r, yMax); + } + nodes.forEach(d3_layout_packLink); + a = nodes[0]; + a.x = -a.r; + a.y = 0; + bound(a); + if (n > 1) { + b = nodes[1]; + b.x = b.r; + b.y = 0; + bound(b); + if (n > 2) { + c = nodes[2]; + d3_layout_packPlace(a, b, c); + bound(c); + d3_layout_packInsert(a, c); + a._pack_prev = c; + d3_layout_packInsert(c, b); + b = a._pack_next; + for (i = 3; i < n; i++) { + d3_layout_packPlace(a, b, c = nodes[i]); + var isect = 0, s1 = 1, s2 = 1; + for (j = b._pack_next; j !== b; j = j._pack_next, s1++) { + if (d3_layout_packIntersects(j, c)) { + isect = 1; + break; + } + } + if (isect == 1) { + for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) { + if (d3_layout_packIntersects(k, c)) { + break; + } + } + } + if (isect) { + if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b); + i--; + } else { + d3_layout_packInsert(a, c); + b = c; + bound(c); + } + } + } + } + var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0; + for (i = 0; i < n; i++) { + c = nodes[i]; + c.x -= cx; + c.y -= cy; + cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y)); + } + node.r = cr; + nodes.forEach(d3_layout_packUnlink); + } + function d3_layout_packLink(node) { + node._pack_next = node._pack_prev = node; + } + function d3_layout_packUnlink(node) { + delete node._pack_next; + delete node._pack_prev; + } + function d3_layout_packTransform(node, x, y, k) { + var children = node.children; + node.x = x += k * node.x; + node.y = y += k * node.y; + node.r *= k; + if (children) { + var i = -1, n = children.length; + while (++i < n) d3_layout_packTransform(children[i], x, y, k); + } + } + function d3_layout_packPlace(a, b, c) { + var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y; + if (db && (dx || dy)) { + var da = b.r + c.r, dc = dx * dx + dy * dy; + da *= da; + db *= db; + var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc); + c.x = a.x + x * dx + y * dy; + c.y = a.y + x * dy - y * dx; + } else { + c.x = a.x + db; + c.y = a.y; + } + } + d3.layout.tree = function() { + var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null; + function tree(d, i) { + var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0); + d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z; + d3_layout_hierarchyVisitBefore(root1, secondWalk); + if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else { + var left = root0, right = root0, bottom = root0; + d3_layout_hierarchyVisitBefore(root0, function(node) { + if (node.x < left.x) left = node; + if (node.x > right.x) right = node; + if (node.depth > bottom.depth) bottom = node; + }); + var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1); + d3_layout_hierarchyVisitBefore(root0, function(node) { + node.x = (node.x + tx) * kx; + node.y = node.depth * ky; + }); + } + return nodes; + } + function wrapTree(root0) { + var root1 = { + A: null, + children: [ root0 ] + }, queue = [ root1 ], node1; + while ((node1 = queue.pop()) != null) { + for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) { + queue.push((children[i] = child = { + _: children[i], + parent: node1, + children: (child = children[i].children) && child.slice() || [], + A: null, + a: null, + z: 0, + m: 0, + c: 0, + s: 0, + t: null, + i: i + }).a = child); + } + } + return root1.children[0]; + } + function firstWalk(v) { + var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null; + if (children.length) { + d3_layout_treeShift(v); + var midpoint = (children[0].z + children[children.length - 1].z) / 2; + if (w) { + v.z = w.z + separation(v._, w._); + v.m = v.z - midpoint; + } else { + v.z = midpoint; + } + } else if (w) { + v.z = w.z + separation(v._, w._); + } + v.parent.A = apportion(v, w, v.parent.A || siblings[0]); + } + function secondWalk(v) { + v._.x = v.z + v.parent.m; + v.m += v.parent.m; + } + function apportion(v, w, ancestor) { + if (w) { + var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift; + while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) { + vom = d3_layout_treeLeft(vom); + vop = d3_layout_treeRight(vop); + vop.a = v; + shift = vim.z + sim - vip.z - sip + separation(vim._, vip._); + if (shift > 0) { + d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift); + sip += shift; + sop += shift; + } + sim += vim.m; + sip += vip.m; + som += vom.m; + sop += vop.m; + } + if (vim && !d3_layout_treeRight(vop)) { + vop.t = vim; + vop.m += sim - sop; + } + if (vip && !d3_layout_treeLeft(vom)) { + vom.t = vip; + vom.m += sip - som; + ancestor = v; + } + } + return ancestor; + } + function sizeNode(node) { + node.x *= size[0]; + node.y = node.depth * size[1]; + } + tree.separation = function(x) { + if (!arguments.length) return separation; + separation = x; + return tree; + }; + tree.size = function(x) { + if (!arguments.length) return nodeSize ? null : size; + nodeSize = (size = x) == null ? sizeNode : null; + return tree; + }; + tree.nodeSize = function(x) { + if (!arguments.length) return nodeSize ? size : null; + nodeSize = (size = x) == null ? null : sizeNode; + return tree; + }; + return d3_layout_hierarchyRebind(tree, hierarchy); + }; + function d3_layout_treeSeparation(a, b) { + return a.parent == b.parent ? 1 : 2; + } + function d3_layout_treeLeft(v) { + var children = v.children; + return children.length ? children[0] : v.t; + } + function d3_layout_treeRight(v) { + var children = v.children, n; + return (n = children.length) ? children[n - 1] : v.t; + } + function d3_layout_treeMove(wm, wp, shift) { + var change = shift / (wp.i - wm.i); + wp.c -= change; + wp.s += shift; + wm.c += change; + wp.z += shift; + wp.m += shift; + } + function d3_layout_treeShift(v) { + var shift = 0, change = 0, children = v.children, i = children.length, w; + while (--i >= 0) { + w = children[i]; + w.z += shift; + w.m += shift; + shift += w.s + (change += w.c); + } + } + function d3_layout_treeAncestor(vim, v, ancestor) { + return vim.a.parent === v.parent ? vim.a : ancestor; + } + d3.layout.cluster = function() { + var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; + function cluster(d, i) { + var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0; + d3_layout_hierarchyVisitAfter(root, function(node) { + var children = node.children; + if (children && children.length) { + node.x = d3_layout_clusterX(children); + node.y = d3_layout_clusterY(children); + } else { + node.x = previousNode ? x += separation(node, previousNode) : 0; + node.y = 0; + previousNode = node; + } + }); + var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2; + d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) { + node.x = (node.x - root.x) * size[0]; + node.y = (root.y - node.y) * size[1]; + } : function(node) { + node.x = (node.x - x0) / (x1 - x0) * size[0]; + node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1]; + }); + return nodes; + } + cluster.separation = function(x) { + if (!arguments.length) return separation; + separation = x; + return cluster; + }; + cluster.size = function(x) { + if (!arguments.length) return nodeSize ? null : size; + nodeSize = (size = x) == null; + return cluster; + }; + cluster.nodeSize = function(x) { + if (!arguments.length) return nodeSize ? size : null; + nodeSize = (size = x) != null; + return cluster; + }; + return d3_layout_hierarchyRebind(cluster, hierarchy); + }; + function d3_layout_clusterY(children) { + return 1 + d3.max(children, function(child) { + return child.y; + }); + } + function d3_layout_clusterX(children) { + return children.reduce(function(x, child) { + return x + child.x; + }, 0) / children.length; + } + function d3_layout_clusterLeft(node) { + var children = node.children; + return children && children.length ? d3_layout_clusterLeft(children[0]) : node; + } + function d3_layout_clusterRight(node) { + var children = node.children, n; + return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node; + } + d3.layout.treemap = function() { + var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5)); + function scale(children, k) { + var i = -1, n = children.length, child, area; + while (++i < n) { + area = (child = children[i]).value * (k < 0 ? 0 : k); + child.area = isNaN(area) || area <= 0 ? 0 : area; + } + } + function squarify(node) { + var children = node.children; + if (children && children.length) { + var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while ((n = remaining.length) > 0) { + row.push(child = remaining[n - 1]); + row.area += child.area; + if (mode !== "squarify" || (score = worst(row, u)) <= best) { + remaining.pop(); + best = score; + } else { + row.area -= row.pop().area; + position(row, u, rect, false); + u = Math.min(rect.dx, rect.dy); + row.length = row.area = 0; + best = Infinity; + } + } + if (row.length) { + position(row, u, rect, true); + row.length = row.area = 0; + } + children.forEach(squarify); + } + } + function stickify(node) { + var children = node.children; + if (children && children.length) { + var rect = pad(node), remaining = children.slice(), child, row = []; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while (child = remaining.pop()) { + row.push(child); + row.area += child.area; + if (child.z != null) { + position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); + row.length = row.area = 0; + } + } + children.forEach(stickify); + } + } + function worst(row, u) { + var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length; + while (++i < n) { + if (!(r = row[i].area)) continue; + if (r < rmin) rmin = r; + if (r > rmax) rmax = r; + } + s *= s; + u *= u; + return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity; + } + function position(row, u, rect, flush) { + var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o; + if (u == rect.dx) { + if (flush || v > rect.dy) v = rect.dy; + while (++i < n) { + o = row[i]; + o.x = x; + o.y = y; + o.dy = v; + x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0); + } + o.z = true; + o.dx += rect.x + rect.dx - x; + rect.y += v; + rect.dy -= v; + } else { + if (flush || v > rect.dx) v = rect.dx; + while (++i < n) { + o = row[i]; + o.x = x; + o.y = y; + o.dx = v; + y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0); + } + o.z = false; + o.dy += rect.y + rect.dy - y; + rect.x += v; + rect.dx -= v; + } + } + function treemap(d) { + var nodes = stickies || hierarchy(d), root = nodes[0]; + root.x = 0; + root.y = 0; + root.dx = size[0]; + root.dy = size[1]; + if (stickies) hierarchy.revalue(root); + scale([ root ], root.dx * root.dy / root.value); + (stickies ? stickify : squarify)(root); + if (sticky) stickies = nodes; + return nodes; + } + treemap.size = function(x) { + if (!arguments.length) return size; + size = x; + return treemap; + }; + treemap.padding = function(x) { + if (!arguments.length) return padding; + function padFunction(node) { + var p = x.call(treemap, node, node.depth); + return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p); + } + function padConstant(node) { + return d3_layout_treemapPad(node, x); + } + var type; + pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], + padConstant) : padConstant; + return treemap; + }; + treemap.round = function(x) { + if (!arguments.length) return round != Number; + round = x ? Math.round : Number; + return treemap; + }; + treemap.sticky = function(x) { + if (!arguments.length) return sticky; + sticky = x; + stickies = null; + return treemap; + }; + treemap.ratio = function(x) { + if (!arguments.length) return ratio; + ratio = x; + return treemap; + }; + treemap.mode = function(x) { + if (!arguments.length) return mode; + mode = x + ""; + return treemap; + }; + return d3_layout_hierarchyRebind(treemap, hierarchy); + }; + function d3_layout_treemapPadNull(node) { + return { + x: node.x, + y: node.y, + dx: node.dx, + dy: node.dy + }; + } + function d3_layout_treemapPad(node, padding) { + var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2]; + if (dx < 0) { + x += dx / 2; + dx = 0; + } + if (dy < 0) { + y += dy / 2; + dy = 0; + } + return { + x: x, + y: y, + dx: dx, + dy: dy + }; + } + d3.random = { + normal: function(µ, σ) { + var n = arguments.length; + if (n < 2) σ = 1; + if (n < 1) µ = 0; + return function() { + var x, y, r; + do { + x = Math.random() * 2 - 1; + y = Math.random() * 2 - 1; + r = x * x + y * y; + } while (!r || r > 1); + return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r); + }; + }, + logNormal: function() { + var random = d3.random.normal.apply(d3, arguments); + return function() { + return Math.exp(random()); + }; + }, + bates: function(m) { + var random = d3.random.irwinHall(m); + return function() { + return random() / m; + }; + }, + irwinHall: function(m) { + return function() { + for (var s = 0, j = 0; j < m; j++) s += Math.random(); + return s; + }; + } + }; + d3.scale = {}; + function d3_scaleExtent(domain) { + var start = domain[0], stop = domain[domain.length - 1]; + return start < stop ? [ start, stop ] : [ stop, start ]; + } + function d3_scaleRange(scale) { + return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range()); + } + function d3_scale_bilinear(domain, range, uninterpolate, interpolate) { + var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]); + return function(x) { + return i(u(x)); + }; + } + function d3_scale_nice(domain, nice) { + var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx; + if (x1 < x0) { + dx = i0, i0 = i1, i1 = dx; + dx = x0, x0 = x1, x1 = dx; + } + domain[i0] = nice.floor(x0); + domain[i1] = nice.ceil(x1); + return domain; + } + function d3_scale_niceStep(step) { + return step ? { + floor: function(x) { + return Math.floor(x / step) * step; + }, + ceil: function(x) { + return Math.ceil(x / step) * step; + } + } : d3_scale_niceIdentity; + } + var d3_scale_niceIdentity = { + floor: d3_identity, + ceil: d3_identity + }; + function d3_scale_polylinear(domain, range, uninterpolate, interpolate) { + var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1; + if (domain[k] < domain[0]) { + domain = domain.slice().reverse(); + range = range.slice().reverse(); + } + while (++j <= k) { + u.push(uninterpolate(domain[j - 1], domain[j])); + i.push(interpolate(range[j - 1], range[j])); + } + return function(x) { + var j = d3.bisect(domain, x, 1, k) - 1; + return i[j](u[j](x)); + }; + } + d3.scale.linear = function() { + return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false); + }; + function d3_scale_linear(domain, range, interpolate, clamp) { + var output, input; + function rescale() { + var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber; + output = linear(domain, range, uninterpolate, interpolate); + input = linear(range, domain, uninterpolate, d3_interpolate); + return scale; + } + function scale(x) { + return output(x); + } + scale.invert = function(y) { + return input(y); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = x.map(Number); + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.rangeRound = function(x) { + return scale.range(x).interpolate(d3_interpolateRound); + }; + scale.clamp = function(x) { + if (!arguments.length) return clamp; + clamp = x; + return rescale(); + }; + scale.interpolate = function(x) { + if (!arguments.length) return interpolate; + interpolate = x; + return rescale(); + }; + scale.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + scale.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + scale.nice = function(m) { + d3_scale_linearNice(domain, m); + return rescale(); + }; + scale.copy = function() { + return d3_scale_linear(domain, range, interpolate, clamp); + }; + return rescale(); + } + function d3_scale_linearRebind(scale, linear) { + return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp"); + } + function d3_scale_linearNice(domain, m) { + return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2])); + } + function d3_scale_linearTickRange(domain, m) { + if (m == null) m = 10; + var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step; + if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2; + extent[0] = Math.ceil(extent[0] / step) * step; + extent[1] = Math.floor(extent[1] / step) * step + step * .5; + extent[2] = step; + return extent; + } + function d3_scale_linearTicks(domain, m) { + return d3.range.apply(d3, d3_scale_linearTickRange(domain, m)); + } + function d3_scale_linearTickFormat(domain, m, format) { + var range = d3_scale_linearTickRange(domain, m); + if (format) { + var match = d3_format_re.exec(format); + match.shift(); + if (match[8] === "s") { + var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1]))); + if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2])); + match[8] = "f"; + format = d3.format(match.join("")); + return function(d) { + return format(prefix.scale(d)) + prefix.symbol; + }; + } + if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range); + format = match.join(""); + } else { + format = ",." + d3_scale_linearPrecision(range[2]) + "f"; + } + return d3.format(format); + } + var d3_scale_linearFormatSignificant = { + s: 1, + g: 1, + p: 1, + r: 1, + e: 1 + }; + function d3_scale_linearPrecision(value) { + return -Math.floor(Math.log(value) / Math.LN10 + .01); + } + function d3_scale_linearFormatPrecision(type, range) { + var p = d3_scale_linearPrecision(range[2]); + return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2; + } + d3.scale.log = function() { + return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]); + }; + function d3_scale_log(linear, base, positive, domain) { + function log(x) { + return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base); + } + function pow(x) { + return positive ? Math.pow(base, x) : -Math.pow(base, -x); + } + function scale(x) { + return linear(log(x)); + } + scale.invert = function(x) { + return pow(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + positive = x[0] >= 0; + linear.domain((domain = x.map(Number)).map(log)); + return scale; + }; + scale.base = function(_) { + if (!arguments.length) return base; + base = +_; + linear.domain(domain.map(log)); + return scale; + }; + scale.nice = function() { + var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative); + linear.domain(niced); + domain = niced.map(pow); + return scale; + }; + scale.ticks = function() { + var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base; + if (isFinite(j - i)) { + if (positive) { + for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k); + ticks.push(pow(i)); + } else { + ticks.push(pow(i)); + for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k); + } + for (i = 0; ticks[i] < u; i++) {} + for (j = ticks.length; ticks[j - 1] > v; j--) {} + ticks = ticks.slice(i, j); + } + return ticks; + }; + scale.tickFormat = function(n, format) { + if (!arguments.length) return d3_scale_logFormat; + if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format); + var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12, + Math.floor), e; + return function(d) { + return d / pow(f(log(d) + e)) <= k ? format(d) : ""; + }; + }; + scale.copy = function() { + return d3_scale_log(linear.copy(), base, positive, domain); + }; + return d3_scale_linearRebind(scale, linear); + } + var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = { + floor: function(x) { + return -Math.ceil(-x); + }, + ceil: function(x) { + return -Math.floor(-x); + } + }; + d3.scale.pow = function() { + return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]); + }; + function d3_scale_pow(linear, exponent, domain) { + var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent); + function scale(x) { + return linear(powp(x)); + } + scale.invert = function(x) { + return powb(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + linear.domain((domain = x.map(Number)).map(powp)); + return scale; + }; + scale.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + scale.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + scale.nice = function(m) { + return scale.domain(d3_scale_linearNice(domain, m)); + }; + scale.exponent = function(x) { + if (!arguments.length) return exponent; + powp = d3_scale_powPow(exponent = x); + powb = d3_scale_powPow(1 / exponent); + linear.domain(domain.map(powp)); + return scale; + }; + scale.copy = function() { + return d3_scale_pow(linear.copy(), exponent, domain); + }; + return d3_scale_linearRebind(scale, linear); + } + function d3_scale_powPow(e) { + return function(x) { + return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e); + }; + } + d3.scale.sqrt = function() { + return d3.scale.pow().exponent(.5); + }; + d3.scale.ordinal = function() { + return d3_scale_ordinal([], { + t: "range", + a: [ [] ] + }); + }; + function d3_scale_ordinal(domain, ranger) { + var index, range, rangeBand; + function scale(x) { + return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length]; + } + function steps(start, step) { + return d3.range(domain.length).map(function(i) { + return start + step * i; + }); + } + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = []; + index = new d3_Map(); + var i = -1, n = x.length, xi; + while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi)); + return scale[ranger.t].apply(scale, ranger.a); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + rangeBand = 0; + ranger = { + t: "range", + a: arguments + }; + return scale; + }; + scale.rangePoints = function(x, padding) { + if (arguments.length < 2) padding = 0; + var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2, + 0) : (stop - start) / (domain.length - 1 + padding); + range = steps(start + step * padding / 2, step); + rangeBand = 0; + ranger = { + t: "rangePoints", + a: arguments + }; + return scale; + }; + scale.rangeRoundPoints = function(x, padding) { + if (arguments.length < 2) padding = 0; + var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2), + 0) : (stop - start) / (domain.length - 1 + padding) | 0; + range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step); + rangeBand = 0; + ranger = { + t: "rangeRoundPoints", + a: arguments + }; + return scale; + }; + scale.rangeBands = function(x, padding, outerPadding) { + if (arguments.length < 2) padding = 0; + if (arguments.length < 3) outerPadding = padding; + var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding); + range = steps(start + step * outerPadding, step); + if (reverse) range.reverse(); + rangeBand = step * (1 - padding); + ranger = { + t: "rangeBands", + a: arguments + }; + return scale; + }; + scale.rangeRoundBands = function(x, padding, outerPadding) { + if (arguments.length < 2) padding = 0; + if (arguments.length < 3) outerPadding = padding; + var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)); + range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step); + if (reverse) range.reverse(); + rangeBand = Math.round(step * (1 - padding)); + ranger = { + t: "rangeRoundBands", + a: arguments + }; + return scale; + }; + scale.rangeBand = function() { + return rangeBand; + }; + scale.rangeExtent = function() { + return d3_scaleExtent(ranger.a[0]); + }; + scale.copy = function() { + return d3_scale_ordinal(domain, ranger); + }; + return scale.domain(domain); + } + d3.scale.category10 = function() { + return d3.scale.ordinal().range(d3_category10); + }; + d3.scale.category20 = function() { + return d3.scale.ordinal().range(d3_category20); + }; + d3.scale.category20b = function() { + return d3.scale.ordinal().range(d3_category20b); + }; + d3.scale.category20c = function() { + return d3.scale.ordinal().range(d3_category20c); + }; + var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString); + var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString); + var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString); + var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString); + d3.scale.quantile = function() { + return d3_scale_quantile([], []); + }; + function d3_scale_quantile(domain, range) { + var thresholds; + function rescale() { + var k = 0, q = range.length; + thresholds = []; + while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q); + return scale; + } + function scale(x) { + if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)]; + } + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending); + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.quantiles = function() { + return thresholds; + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ]; + }; + scale.copy = function() { + return d3_scale_quantile(domain, range); + }; + return rescale(); + } + d3.scale.quantize = function() { + return d3_scale_quantize(0, 1, [ 0, 1 ]); + }; + function d3_scale_quantize(x0, x1, range) { + var kx, i; + function scale(x) { + return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))]; + } + function rescale() { + kx = range.length / (x1 - x0); + i = range.length - 1; + return scale; + } + scale.domain = function(x) { + if (!arguments.length) return [ x0, x1 ]; + x0 = +x[0]; + x1 = +x[x.length - 1]; + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + y = y < 0 ? NaN : y / kx + x0; + return [ y, y + 1 / kx ]; + }; + scale.copy = function() { + return d3_scale_quantize(x0, x1, range); + }; + return rescale(); + } + d3.scale.threshold = function() { + return d3_scale_threshold([ .5 ], [ 0, 1 ]); + }; + function d3_scale_threshold(domain, range) { + function scale(x) { + if (x <= x) return range[d3.bisect(domain, x)]; + } + scale.domain = function(_) { + if (!arguments.length) return domain; + domain = _; + return scale; + }; + scale.range = function(_) { + if (!arguments.length) return range; + range = _; + return scale; + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + return [ domain[y - 1], domain[y] ]; + }; + scale.copy = function() { + return d3_scale_threshold(domain, range); + }; + return scale; + } + d3.scale.identity = function() { + return d3_scale_identity([ 0, 1 ]); + }; + function d3_scale_identity(domain) { + function identity(x) { + return +x; + } + identity.invert = identity; + identity.domain = identity.range = function(x) { + if (!arguments.length) return domain; + domain = x.map(identity); + return identity; + }; + identity.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + identity.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + identity.copy = function() { + return d3_scale_identity(domain); + }; + return identity; + } + d3.svg = {}; + function d3_zero() { + return 0; + } + d3.svg.arc = function() { + var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle; + function arc() { + var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfÏ€, a1 = endAngle.apply(this, arguments) - halfÏ€, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1; + if (r1 < r0) rc = r1, r1 = r0, r0 = rc; + if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : "") + "Z"; + var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = []; + if (ap = (+padAngle.apply(this, arguments) || 0) / 2) { + rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments); + if (!cw) p1 *= -1; + if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap)); + if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap)); + } + if (r1) { + x0 = r1 * Math.cos(a0 + p1); + y0 = r1 * Math.sin(a0 + p1); + x1 = r1 * Math.cos(a1 - p1); + y1 = r1 * Math.sin(a1 - p1); + var l1 = Math.abs(a1 - a0 - 2 * p1) <= Ï€ ? 0 : 1; + if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) { + var h1 = (a0 + a1) / 2; + x0 = r1 * Math.cos(h1); + y0 = r1 * Math.sin(h1); + x1 = y1 = null; + } + } else { + x0 = y0 = 0; + } + if (r0) { + x2 = r0 * Math.cos(a1 - p0); + y2 = r0 * Math.sin(a1 - p0); + x3 = r0 * Math.cos(a0 + p0); + y3 = r0 * Math.sin(a0 + p0); + var l0 = Math.abs(a0 - a1 + 2 * p0) <= Ï€ ? 0 : 1; + if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) { + var h0 = (a0 + a1) / 2; + x2 = r0 * Math.cos(h0); + y2 = r0 * Math.sin(h0); + x3 = y3 = null; + } + } else { + x2 = y2 = 0; + } + if ((rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) { + cr = r0 < r1 ^ cw ? 0 : 1; + var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]); + if (x1 != null) { + var rc1 = Math.min(rc, (r1 - lc) / (kc + 1)), t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw); + if (rc === rc1) { + path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), ",", cw, " ", t12[1], "A", rc1, ",", rc1, " 0 0,", cr, " ", t12[0]); + } else { + path.push("M", t30[0], "A", rc1, ",", rc1, " 0 1,", cr, " ", t12[0]); + } + } else { + path.push("M", x0, ",", y0); + } + if (x3 != null) { + var rc0 = Math.min(rc, (r0 - lc) / (kc - 1)), t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw); + if (rc === rc0) { + path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), ",", 1 - cw, " ", t03[1], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]); + } else { + path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]); + } + } else { + path.push("L", x2, ",", y2); + } + } else { + path.push("M", x0, ",", y0); + if (x1 != null) path.push("A", r1, ",", r1, " 0 ", l1, ",", cw, " ", x1, ",", y1); + path.push("L", x2, ",", y2); + if (x3 != null) path.push("A", r0, ",", r0, " 0 ", l0, ",", 1 - cw, " ", x3, ",", y3); + } + path.push("Z"); + return path.join(""); + } + function circleSegment(r1, cw) { + return "M0," + r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + -r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + r1; + } + arc.innerRadius = function(v) { + if (!arguments.length) return innerRadius; + innerRadius = d3_functor(v); + return arc; + }; + arc.outerRadius = function(v) { + if (!arguments.length) return outerRadius; + outerRadius = d3_functor(v); + return arc; + }; + arc.cornerRadius = function(v) { + if (!arguments.length) return cornerRadius; + cornerRadius = d3_functor(v); + return arc; + }; + arc.padRadius = function(v) { + if (!arguments.length) return padRadius; + padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v); + return arc; + }; + arc.startAngle = function(v) { + if (!arguments.length) return startAngle; + startAngle = d3_functor(v); + return arc; + }; + arc.endAngle = function(v) { + if (!arguments.length) return endAngle; + endAngle = d3_functor(v); + return arc; + }; + arc.padAngle = function(v) { + if (!arguments.length) return padAngle; + padAngle = d3_functor(v); + return arc; + }; + arc.centroid = function() { + var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfÏ€; + return [ Math.cos(a) * r, Math.sin(a) * r ]; + }; + return arc; + }; + var d3_svg_arcAuto = "auto"; + function d3_svg_arcInnerRadius(d) { + return d.innerRadius; + } + function d3_svg_arcOuterRadius(d) { + return d.outerRadius; + } + function d3_svg_arcStartAngle(d) { + return d.startAngle; + } + function d3_svg_arcEndAngle(d) { + return d.endAngle; + } + function d3_svg_arcPadAngle(d) { + return d && d.padAngle; + } + function d3_svg_arcSweep(x0, y0, x1, y1) { + return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1; + } + function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) { + var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(r * r * d2 - D * D), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3; + if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; + return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ]; + } + function d3_svg_line(projection) { + var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7; + function line(data) { + var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y); + function segment() { + segments.push("M", interpolate(projection(points), tension)); + } + while (++i < n) { + if (defined.call(this, d = data[i], i)) { + points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]); + } else if (points.length) { + segment(); + points = []; + } + } + if (points.length) segment(); + return segments.length ? segments.join("") : null; + } + line.x = function(_) { + if (!arguments.length) return x; + x = _; + return line; + }; + line.y = function(_) { + if (!arguments.length) return y; + y = _; + return line; + }; + line.defined = function(_) { + if (!arguments.length) return defined; + defined = _; + return line; + }; + line.interpolate = function(_) { + if (!arguments.length) return interpolateKey; + if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; + return line; + }; + line.tension = function(_) { + if (!arguments.length) return tension; + tension = _; + return line; + }; + return line; + } + d3.svg.line = function() { + return d3_svg_line(d3_identity); + }; + var d3_svg_lineInterpolators = d3.map({ + linear: d3_svg_lineLinear, + "linear-closed": d3_svg_lineLinearClosed, + step: d3_svg_lineStep, + "step-before": d3_svg_lineStepBefore, + "step-after": d3_svg_lineStepAfter, + basis: d3_svg_lineBasis, + "basis-open": d3_svg_lineBasisOpen, + "basis-closed": d3_svg_lineBasisClosed, + bundle: d3_svg_lineBundle, + cardinal: d3_svg_lineCardinal, + "cardinal-open": d3_svg_lineCardinalOpen, + "cardinal-closed": d3_svg_lineCardinalClosed, + monotone: d3_svg_lineMonotone + }); + d3_svg_lineInterpolators.forEach(function(key, value) { + value.key = key; + value.closed = /-closed$/.test(key); + }); + function d3_svg_lineLinear(points) { + return points.join("L"); + } + function d3_svg_lineLinearClosed(points) { + return d3_svg_lineLinear(points) + "Z"; + } + function d3_svg_lineStep(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]); + if (n > 1) path.push("H", p[0]); + return path.join(""); + } + function d3_svg_lineStepBefore(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]); + return path.join(""); + } + function d3_svg_lineStepAfter(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]); + return path.join(""); + } + function d3_svg_lineCardinalOpen(points, tension) { + return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension)); + } + function d3_svg_lineCardinalClosed(points, tension) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), + points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension)); + } + function d3_svg_lineCardinal(points, tension) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension)); + } + function d3_svg_lineHermite(points, tangents) { + if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) { + return d3_svg_lineLinear(points); + } + var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1; + if (quad) { + path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1]; + p0 = points[1]; + pi = 2; + } + if (tangents.length > 1) { + t = tangents[1]; + p = points[pi]; + pi++; + path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; + for (var i = 2; i < tangents.length; i++, pi++) { + p = points[pi]; + t = tangents[i]; + path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; + } + } + if (quad) { + var lp = points[pi]; + path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1]; + } + return path; + } + function d3_svg_lineCardinalTangents(points, tension) { + var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length; + while (++i < n) { + p0 = p1; + p1 = p2; + p2 = points[i]; + tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]); + } + return tangents; + } + function d3_svg_lineBasis(points) { + if (points.length < 3) return d3_svg_lineLinear(points); + var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; + points.push(points[n - 1]); + while (++i <= n) { + pi = points[i]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + points.pop(); + path.push("L", pi); + return path.join(""); + } + function d3_svg_lineBasisOpen(points) { + if (points.length < 4) return d3_svg_lineLinear(points); + var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ]; + while (++i < 3) { + pi = points[i]; + px.push(pi[0]); + py.push(pi[1]); + } + path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)); + --i; + while (++i < n) { + pi = points[i]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + return path.join(""); + } + function d3_svg_lineBasisClosed(points) { + var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = []; + while (++i < 4) { + pi = points[i % n]; + px.push(pi[0]); + py.push(pi[1]); + } + path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; + --i; + while (++i < m) { + pi = points[i % n]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + return path.join(""); + } + function d3_svg_lineBundle(points, tension) { + var n = points.length - 1; + if (n) { + var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t; + while (++i <= n) { + p = points[i]; + t = i / n; + p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); + p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); + } + } + return d3_svg_lineBasis(points); + } + function d3_svg_lineDot4(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ]; + function d3_svg_lineBasisBezier(path, x, y) { + path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y)); + } + function d3_svg_lineSlope(p0, p1) { + return (p1[1] - p0[1]) / (p1[0] - p0[0]); + } + function d3_svg_lineFiniteDifferences(points) { + var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1); + while (++i < j) { + m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2; + } + m[i] = d; + return m; + } + function d3_svg_lineMonotoneTangents(points) { + var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1; + while (++i < j) { + d = d3_svg_lineSlope(points[i], points[i + 1]); + if (abs(d) < ε) { + m[i] = m[i + 1] = 0; + } else { + a = m[i] / d; + b = m[i + 1] / d; + s = a * a + b * b; + if (s > 9) { + s = d * 3 / Math.sqrt(s); + m[i] = s * a; + m[i + 1] = s * b; + } + } + } + i = -1; + while (++i <= j) { + s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i])); + tangents.push([ s || 0, m[i] * s || 0 ]); + } + return tangents; + } + function d3_svg_lineMonotone(points) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points)); + } + d3.svg.line.radial = function() { + var line = d3_svg_line(d3_svg_lineRadial); + line.radius = line.x, delete line.x; + line.angle = line.y, delete line.y; + return line; + }; + function d3_svg_lineRadial(points) { + var point, i = -1, n = points.length, r, a; + while (++i < n) { + point = points[i]; + r = point[0]; + a = point[1] - halfÏ€; + point[0] = r * Math.cos(a); + point[1] = r * Math.sin(a); + } + return points; + } + function d3_svg_area(projection) { + var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7; + function area(data) { + var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() { + return x; + } : d3_functor(x1), fy1 = y0 === y1 ? function() { + return y; + } : d3_functor(y1), x, y; + function segment() { + segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z"); + } + while (++i < n) { + if (defined.call(this, d = data[i], i)) { + points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]); + points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]); + } else if (points0.length) { + segment(); + points0 = []; + points1 = []; + } + } + if (points0.length) segment(); + return segments.length ? segments.join("") : null; + } + area.x = function(_) { + if (!arguments.length) return x1; + x0 = x1 = _; + return area; + }; + area.x0 = function(_) { + if (!arguments.length) return x0; + x0 = _; + return area; + }; + area.x1 = function(_) { + if (!arguments.length) return x1; + x1 = _; + return area; + }; + area.y = function(_) { + if (!arguments.length) return y1; + y0 = y1 = _; + return area; + }; + area.y0 = function(_) { + if (!arguments.length) return y0; + y0 = _; + return area; + }; + area.y1 = function(_) { + if (!arguments.length) return y1; + y1 = _; + return area; + }; + area.defined = function(_) { + if (!arguments.length) return defined; + defined = _; + return area; + }; + area.interpolate = function(_) { + if (!arguments.length) return interpolateKey; + if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; + interpolateReverse = interpolate.reverse || interpolate; + L = interpolate.closed ? "M" : "L"; + return area; + }; + area.tension = function(_) { + if (!arguments.length) return tension; + tension = _; + return area; + }; + return area; + } + d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter; + d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore; + d3.svg.area = function() { + return d3_svg_area(d3_identity); + }; + d3.svg.area.radial = function() { + var area = d3_svg_area(d3_svg_lineRadial); + area.radius = area.x, delete area.x; + area.innerRadius = area.x0, delete area.x0; + area.outerRadius = area.x1, delete area.x1; + area.angle = area.y, delete area.y; + area.startAngle = area.y0, delete area.y0; + area.endAngle = area.y1, delete area.y1; + return area; + }; + d3.svg.chord = function() { + var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; + function chord(d, i) { + var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i); + return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z"; + } + function subgroup(self, f, d, i) { + var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfÏ€, a1 = endAngle.call(self, subgroup, i) - halfÏ€; + return { + r: r, + a0: a0, + a1: a1, + p0: [ r * Math.cos(a0), r * Math.sin(a0) ], + p1: [ r * Math.cos(a1), r * Math.sin(a1) ] + }; + } + function equals(a, b) { + return a.a0 == b.a0 && a.a1 == b.a1; + } + function arc(r, p, a) { + return "A" + r + "," + r + " 0 " + +(a > Ï€) + ",1 " + p; + } + function curve(r0, p0, r1, p1) { + return "Q 0,0 " + p1; + } + chord.radius = function(v) { + if (!arguments.length) return radius; + radius = d3_functor(v); + return chord; + }; + chord.source = function(v) { + if (!arguments.length) return source; + source = d3_functor(v); + return chord; + }; + chord.target = function(v) { + if (!arguments.length) return target; + target = d3_functor(v); + return chord; + }; + chord.startAngle = function(v) { + if (!arguments.length) return startAngle; + startAngle = d3_functor(v); + return chord; + }; + chord.endAngle = function(v) { + if (!arguments.length) return endAngle; + endAngle = d3_functor(v); + return chord; + }; + return chord; + }; + function d3_svg_chordRadius(d) { + return d.radius; + } + d3.svg.diagonal = function() { + var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection; + function diagonal(d, i) { + var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, { + x: p0.x, + y: m + }, { + x: p3.x, + y: m + }, p3 ]; + p = p.map(projection); + return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3]; + } + diagonal.source = function(x) { + if (!arguments.length) return source; + source = d3_functor(x); + return diagonal; + }; + diagonal.target = function(x) { + if (!arguments.length) return target; + target = d3_functor(x); + return diagonal; + }; + diagonal.projection = function(x) { + if (!arguments.length) return projection; + projection = x; + return diagonal; + }; + return diagonal; + }; + function d3_svg_diagonalProjection(d) { + return [ d.x, d.y ]; + } + d3.svg.diagonal.radial = function() { + var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection; + diagonal.projection = function(x) { + return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection; + }; + return diagonal; + }; + function d3_svg_diagonalRadialProjection(projection) { + return function() { + var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfÏ€; + return [ r * Math.cos(a), r * Math.sin(a) ]; + }; + } + d3.svg.symbol = function() { + var type = d3_svg_symbolType, size = d3_svg_symbolSize; + function symbol(d, i) { + return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i)); + } + symbol.type = function(x) { + if (!arguments.length) return type; + type = d3_functor(x); + return symbol; + }; + symbol.size = function(x) { + if (!arguments.length) return size; + size = d3_functor(x); + return symbol; + }; + return symbol; + }; + function d3_svg_symbolSize() { + return 64; + } + function d3_svg_symbolType() { + return "circle"; + } + function d3_svg_symbolCircle(size) { + var r = Math.sqrt(size / Ï€); + return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z"; + } + var d3_svg_symbols = d3.map({ + circle: d3_svg_symbolCircle, + cross: function(size) { + var r = Math.sqrt(size / 5) / 2; + return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z"; + }, + diamond: function(size) { + var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30; + return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z"; + }, + square: function(size) { + var r = Math.sqrt(size) / 2; + return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z"; + }, + "triangle-down": function(size) { + var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; + return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z"; + }, + "triangle-up": function(size) { + var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; + return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z"; + } + }); + d3.svg.symbolTypes = d3_svg_symbols.keys(); + var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians); + d3_selectionPrototype.transition = function(name) { + var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || { + time: Date.now(), + ease: d3_ease_cubicInOut, + delay: 0, + duration: 250 + }; + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) d3_transitionNode(node, i, ns, id, transition); + subgroup.push(node); + } + } + return d3_transition(subgroups, ns, id); + }; + d3_selectionPrototype.interrupt = function(name) { + return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name))); + }; + var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace()); + function d3_selection_interruptNS(ns) { + return function() { + var lock, active; + if ((lock = this[ns]) && (active = lock[lock.active])) { + if (--lock.count) delete lock[lock.active]; else delete this[ns]; + lock.active += .5; + active.event && active.event.interrupt.call(this, this.__data__, active.index); + } + }; + } + function d3_transition(groups, ns, id) { + d3_subclass(groups, d3_transitionPrototype); + groups.namespace = ns; + groups.id = id; + return groups; + } + var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit; + d3_transitionPrototype.call = d3_selectionPrototype.call; + d3_transitionPrototype.empty = d3_selectionPrototype.empty; + d3_transitionPrototype.node = d3_selectionPrototype.node; + d3_transitionPrototype.size = d3_selectionPrototype.size; + d3.transition = function(selection, name) { + return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection); + }; + d3.transition.prototype = d3_transitionPrototype; + d3_transitionPrototype.select = function(selector) { + var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node; + selector = d3_selection_selector(selector); + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + d3_transitionNode(subnode, i, ns, id, node[ns][id]); + subgroup.push(subnode); + } else { + subgroup.push(null); + } + } + } + return d3_transition(subgroups, ns, id); + }; + d3_transitionPrototype.selectAll = function(selector) { + var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition; + selector = d3_selection_selectorAll(selector); + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + transition = node[ns][id]; + subnodes = selector.call(node, node.__data__, i, j); + subgroups.push(subgroup = []); + for (var k = -1, o = subnodes.length; ++k < o; ) { + if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition); + subgroup.push(subnode); + } + } + } + } + return d3_transition(subgroups, ns, id); + }; + d3_transitionPrototype.filter = function(filter) { + var subgroups = [], subgroup, group, node; + if (typeof filter !== "function") filter = d3_selection_filter(filter); + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { + subgroup.push(node); + } + } + } + return d3_transition(subgroups, this.namespace, this.id); + }; + d3_transitionPrototype.tween = function(name, tween) { + var id = this.id, ns = this.namespace; + if (arguments.length < 2) return this.node()[ns][id].tween.get(name); + return d3_selection_each(this, tween == null ? function(node) { + node[ns][id].tween.remove(name); + } : function(node) { + node[ns][id].tween.set(name, tween); + }); + }; + function d3_transition_tween(groups, name, value, tween) { + var id = groups.id, ns = groups.namespace; + return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) { + node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j))); + } : (value = tween(value), function(node) { + node[ns][id].tween.set(name, value); + })); + } + d3_transitionPrototype.attr = function(nameNS, value) { + if (arguments.length < 2) { + for (value in nameNS) this.attr(value, nameNS[value]); + return this; + } + var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS); + function attrNull() { + this.removeAttribute(name); + } + function attrNullNS() { + this.removeAttributeNS(name.space, name.local); + } + function attrTween(b) { + return b == null ? attrNull : (b += "", function() { + var a = this.getAttribute(name), i; + return a !== b && (i = interpolate(a, b), function(t) { + this.setAttribute(name, i(t)); + }); + }); + } + function attrTweenNS(b) { + return b == null ? attrNullNS : (b += "", function() { + var a = this.getAttributeNS(name.space, name.local), i; + return a !== b && (i = interpolate(a, b), function(t) { + this.setAttributeNS(name.space, name.local, i(t)); + }); + }); + } + return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween); + }; + d3_transitionPrototype.attrTween = function(nameNS, tween) { + var name = d3.ns.qualify(nameNS); + function attrTween(d, i) { + var f = tween.call(this, d, i, this.getAttribute(name)); + return f && function(t) { + this.setAttribute(name, f(t)); + }; + } + function attrTweenNS(d, i) { + var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); + return f && function(t) { + this.setAttributeNS(name.space, name.local, f(t)); + }; + } + return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); + }; + d3_transitionPrototype.style = function(name, value, priority) { + var n = arguments.length; + if (n < 3) { + if (typeof name !== "string") { + if (n < 2) value = ""; + for (priority in name) this.style(priority, name[priority], value); + return this; + } + priority = ""; + } + function styleNull() { + this.style.removeProperty(name); + } + function styleString(b) { + return b == null ? styleNull : (b += "", function() { + var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i; + return a !== b && (i = d3_interpolate(a, b), function(t) { + this.style.setProperty(name, i(t), priority); + }); + }); + } + return d3_transition_tween(this, "style." + name, value, styleString); + }; + d3_transitionPrototype.styleTween = function(name, tween, priority) { + if (arguments.length < 3) priority = ""; + function styleTween(d, i) { + var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name)); + return f && function(t) { + this.style.setProperty(name, f(t), priority); + }; + } + return this.tween("style." + name, styleTween); + }; + d3_transitionPrototype.text = function(value) { + return d3_transition_tween(this, "text", value, d3_transition_text); + }; + function d3_transition_text(b) { + if (b == null) b = ""; + return function() { + this.textContent = b; + }; + } + d3_transitionPrototype.remove = function() { + var ns = this.namespace; + return this.each("end.transition", function() { + var p; + if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this); + }); + }; + d3_transitionPrototype.ease = function(value) { + var id = this.id, ns = this.namespace; + if (arguments.length < 1) return this.node()[ns][id].ease; + if (typeof value !== "function") value = d3.ease.apply(d3, arguments); + return d3_selection_each(this, function(node) { + node[ns][id].ease = value; + }); + }; + d3_transitionPrototype.delay = function(value) { + var id = this.id, ns = this.namespace; + if (arguments.length < 1) return this.node()[ns][id].delay; + return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { + node[ns][id].delay = +value.call(node, node.__data__, i, j); + } : (value = +value, function(node) { + node[ns][id].delay = value; + })); + }; + d3_transitionPrototype.duration = function(value) { + var id = this.id, ns = this.namespace; + if (arguments.length < 1) return this.node()[ns][id].duration; + return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { + node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j)); + } : (value = Math.max(1, value), function(node) { + node[ns][id].duration = value; + })); + }; + d3_transitionPrototype.each = function(type, listener) { + var id = this.id, ns = this.namespace; + if (arguments.length < 2) { + var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId; + try { + d3_transitionInheritId = id; + d3_selection_each(this, function(node, i, j) { + d3_transitionInherit = node[ns][id]; + type.call(node, node.__data__, i, j); + }); + } finally { + d3_transitionInherit = inherit; + d3_transitionInheritId = inheritId; + } + } else { + d3_selection_each(this, function(node) { + var transition = node[ns][id]; + (transition.event || (transition.event = d3.dispatch("start", "end", "interrupt"))).on(type, listener); + }); + } + return this; + }; + d3_transitionPrototype.transition = function() { + var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition; + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + if (node = group[i]) { + transition = node[ns][id0]; + d3_transitionNode(node, i, ns, id1, { + time: transition.time, + ease: transition.ease, + delay: transition.delay + transition.duration, + duration: transition.duration + }); + } + subgroup.push(node); + } + } + return d3_transition(subgroups, ns, id1); + }; + function d3_transitionNamespace(name) { + return name == null ? "__transition__" : "__transition_" + name + "__"; + } + function d3_transitionNode(node, i, ns, id, inherit) { + var lock = node[ns] || (node[ns] = { + active: 0, + count: 0 + }), transition = lock[id]; + if (!transition) { + var time = inherit.time; + transition = lock[id] = { + tween: new d3_Map(), + time: time, + delay: inherit.delay, + duration: inherit.duration, + ease: inherit.ease, + index: i + }; + inherit = null; + ++lock.count; + d3.timer(function(elapsed) { + var delay = transition.delay, duration, ease, timer = d3_timer_active, tweened = []; + timer.t = delay + time; + if (delay <= elapsed) return start(elapsed - delay); + timer.c = start; + function start(elapsed) { + if (lock.active > id) return stop(); + var active = lock[lock.active]; + if (active) { + --lock.count; + delete lock[lock.active]; + active.event && active.event.interrupt.call(node, node.__data__, active.index); + } + lock.active = id; + transition.event && transition.event.start.call(node, node.__data__, i); + transition.tween.forEach(function(key, value) { + if (value = value.call(node, node.__data__, i)) { + tweened.push(value); + } + }); + ease = transition.ease; + duration = transition.duration; + d3.timer(function() { + timer.c = tick(elapsed || 1) ? d3_true : tick; + return 1; + }, 0, time); + } + function tick(elapsed) { + if (lock.active !== id) return 1; + var t = elapsed / duration, e = ease(t), n = tweened.length; + while (n > 0) { + tweened[--n].call(node, e); + } + if (t >= 1) { + transition.event && transition.event.end.call(node, node.__data__, i); + return stop(); + } + } + function stop() { + if (--lock.count) delete lock[id]; else delete node[ns]; + return 1; + } + }, 0, time); + } + } + d3.svg.axis = function() { + var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_; + function axis(g) { + g.each(function() { + var g = d3.select(this); + var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy(); + var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform; + var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), + d3.transition(path)); + tickEnter.append("line"); + tickEnter.append("text"); + var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2; + if (orient === "bottom" || orient === "top") { + tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2"; + text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle"); + pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize); + } else { + tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2"; + text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start"); + pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize); + } + lineEnter.attr(y2, sign * innerTickSize); + textEnter.attr(y1, sign * tickSpacing); + lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize); + textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing); + if (scale1.rangeBand) { + var x = scale1, dx = x.rangeBand() / 2; + scale0 = scale1 = function(d) { + return x(d) + dx; + }; + } else if (scale0.rangeBand) { + scale0 = scale1; + } else { + tickExit.call(tickTransform, scale1, scale0); + } + tickEnter.call(tickTransform, scale0, scale1); + tickUpdate.call(tickTransform, scale1, scale1); + }); + } + axis.scale = function(x) { + if (!arguments.length) return scale; + scale = x; + return axis; + }; + axis.orient = function(x) { + if (!arguments.length) return orient; + orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient; + return axis; + }; + axis.ticks = function() { + if (!arguments.length) return tickArguments_; + tickArguments_ = arguments; + return axis; + }; + axis.tickValues = function(x) { + if (!arguments.length) return tickValues; + tickValues = x; + return axis; + }; + axis.tickFormat = function(x) { + if (!arguments.length) return tickFormat_; + tickFormat_ = x; + return axis; + }; + axis.tickSize = function(x) { + var n = arguments.length; + if (!n) return innerTickSize; + innerTickSize = +x; + outerTickSize = +arguments[n - 1]; + return axis; + }; + axis.innerTickSize = function(x) { + if (!arguments.length) return innerTickSize; + innerTickSize = +x; + return axis; + }; + axis.outerTickSize = function(x) { + if (!arguments.length) return outerTickSize; + outerTickSize = +x; + return axis; + }; + axis.tickPadding = function(x) { + if (!arguments.length) return tickPadding; + tickPadding = +x; + return axis; + }; + axis.tickSubdivide = function() { + return arguments.length && axis; + }; + return axis; + }; + var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = { + top: 1, + right: 1, + bottom: 1, + left: 1 + }; + function d3_svg_axisX(selection, x0, x1) { + selection.attr("transform", function(d) { + var v0 = x0(d); + return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)"; + }); + } + function d3_svg_axisY(selection, y0, y1) { + selection.attr("transform", function(d) { + var v0 = y0(d); + return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")"; + }); + } + d3.svg.brush = function() { + var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0]; + function brush(g) { + g.each(function() { + var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart); + var background = g.selectAll(".background").data([ 0 ]); + background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"); + g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move"); + var resize = g.selectAll(".resize").data(resizes, d3_identity); + resize.exit().remove(); + resize.enter().append("g").attr("class", function(d) { + return "resize " + d; + }).style("cursor", function(d) { + return d3_svg_brushCursor[d]; + }).append("rect").attr("x", function(d) { + return /[ew]$/.test(d) ? -3 : null; + }).attr("y", function(d) { + return /^[ns]/.test(d) ? -3 : null; + }).attr("width", 6).attr("height", 6).style("visibility", "hidden"); + resize.style("display", brush.empty() ? "none" : null); + var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range; + if (x) { + range = d3_scaleRange(x); + backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]); + redrawX(gUpdate); + } + if (y) { + range = d3_scaleRange(y); + backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]); + redrawY(gUpdate); + } + redraw(gUpdate); + }); + } + brush.event = function(g) { + g.each(function() { + var event_ = event.of(this, arguments), extent1 = { + x: xExtent, + y: yExtent, + i: xExtentDomain, + j: yExtentDomain + }, extent0 = this.__chart__ || extent1; + this.__chart__ = extent1; + if (d3_transitionInheritId) { + d3.select(this).transition().each("start.brush", function() { + xExtentDomain = extent0.i; + yExtentDomain = extent0.j; + xExtent = extent0.x; + yExtent = extent0.y; + event_({ + type: "brushstart" + }); + }).tween("brush:brush", function() { + var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y); + xExtentDomain = yExtentDomain = null; + return function(t) { + xExtent = extent1.x = xi(t); + yExtent = extent1.y = yi(t); + event_({ + type: "brush", + mode: "resize" + }); + }; + }).each("end.brush", function() { + xExtentDomain = extent1.i; + yExtentDomain = extent1.j; + event_({ + type: "brush", + mode: "resize" + }); + event_({ + type: "brushend" + }); + }); + } else { + event_({ + type: "brushstart" + }); + event_({ + type: "brush", + mode: "resize" + }); + event_({ + type: "brushend" + }); + } + }); + }; + function redraw(g) { + g.selectAll(".resize").attr("transform", function(d) { + return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")"; + }); + } + function redrawX(g) { + g.select(".extent").attr("x", xExtent[0]); + g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]); + } + function redrawY(g) { + g.select(".extent").attr("y", yExtent[0]); + g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]); + } + function brushstart() { + var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset; + var w = d3.select(d3_window(target)).on("keydown.brush", keydown).on("keyup.brush", keyup); + if (d3.event.changedTouches) { + w.on("touchmove.brush", brushmove).on("touchend.brush", brushend); + } else { + w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend); + } + g.interrupt().selectAll("*").interrupt(); + if (dragging) { + origin[0] = xExtent[0] - origin[0]; + origin[1] = yExtent[0] - origin[1]; + } else if (resizing) { + var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing); + offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ]; + origin[0] = xExtent[ex]; + origin[1] = yExtent[ey]; + } else if (d3.event.altKey) center = origin.slice(); + g.style("pointer-events", "none").selectAll(".resize").style("display", null); + d3.select("body").style("cursor", eventTarget.style("cursor")); + event_({ + type: "brushstart" + }); + brushmove(); + function keydown() { + if (d3.event.keyCode == 32) { + if (!dragging) { + center = null; + origin[0] -= xExtent[1]; + origin[1] -= yExtent[1]; + dragging = 2; + } + d3_eventPreventDefault(); + } + } + function keyup() { + if (d3.event.keyCode == 32 && dragging == 2) { + origin[0] += xExtent[1]; + origin[1] += yExtent[1]; + dragging = 0; + d3_eventPreventDefault(); + } + } + function brushmove() { + var point = d3.mouse(target), moved = false; + if (offset) { + point[0] += offset[0]; + point[1] += offset[1]; + } + if (!dragging) { + if (d3.event.altKey) { + if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ]; + origin[0] = xExtent[+(point[0] < center[0])]; + origin[1] = yExtent[+(point[1] < center[1])]; + } else center = null; + } + if (resizingX && move1(point, x, 0)) { + redrawX(g); + moved = true; + } + if (resizingY && move1(point, y, 1)) { + redrawY(g); + moved = true; + } + if (moved) { + redraw(g); + event_({ + type: "brush", + mode: dragging ? "move" : "resize" + }); + } + } + function move1(point, scale, i) { + var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max; + if (dragging) { + r0 -= position; + r1 -= size + position; + } + min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i]; + if (dragging) { + max = (min += position) + size; + } else { + if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min)); + if (position < min) { + max = min; + min = position; + } else { + max = position; + } + } + if (extent[0] != min || extent[1] != max) { + if (i) yExtentDomain = null; else xExtentDomain = null; + extent[0] = min; + extent[1] = max; + return true; + } + } + function brushend() { + brushmove(); + g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null); + d3.select("body").style("cursor", null); + w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null); + dragRestore(); + event_({ + type: "brushend" + }); + } + } + brush.x = function(z) { + if (!arguments.length) return x; + x = z; + resizes = d3_svg_brushResizes[!x << 1 | !y]; + return brush; + }; + brush.y = function(z) { + if (!arguments.length) return y; + y = z; + resizes = d3_svg_brushResizes[!x << 1 | !y]; + return brush; + }; + brush.clamp = function(z) { + if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null; + if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z; + return brush; + }; + brush.extent = function(z) { + var x0, x1, y0, y1, t; + if (!arguments.length) { + if (x) { + if (xExtentDomain) { + x0 = xExtentDomain[0], x1 = xExtentDomain[1]; + } else { + x0 = xExtent[0], x1 = xExtent[1]; + if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1); + if (x1 < x0) t = x0, x0 = x1, x1 = t; + } + } + if (y) { + if (yExtentDomain) { + y0 = yExtentDomain[0], y1 = yExtentDomain[1]; + } else { + y0 = yExtent[0], y1 = yExtent[1]; + if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1); + if (y1 < y0) t = y0, y0 = y1, y1 = t; + } + } + return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ]; + } + if (x) { + x0 = z[0], x1 = z[1]; + if (y) x0 = x0[0], x1 = x1[0]; + xExtentDomain = [ x0, x1 ]; + if (x.invert) x0 = x(x0), x1 = x(x1); + if (x1 < x0) t = x0, x0 = x1, x1 = t; + if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ]; + } + if (y) { + y0 = z[0], y1 = z[1]; + if (x) y0 = y0[1], y1 = y1[1]; + yExtentDomain = [ y0, y1 ]; + if (y.invert) y0 = y(y0), y1 = y(y1); + if (y1 < y0) t = y0, y0 = y1, y1 = t; + if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ]; + } + return brush; + }; + brush.clear = function() { + if (!brush.empty()) { + xExtent = [ 0, 0 ], yExtent = [ 0, 0 ]; + xExtentDomain = yExtentDomain = null; + } + return brush; + }; + brush.empty = function() { + return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1]; + }; + return d3.rebind(brush, event, "on"); + }; + var d3_svg_brushCursor = { + n: "ns-resize", + e: "ew-resize", + s: "ns-resize", + w: "ew-resize", + nw: "nwse-resize", + ne: "nesw-resize", + se: "nwse-resize", + sw: "nesw-resize" + }; + var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ]; + var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat; + var d3_time_formatUtc = d3_time_format.utc; + var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ"); + d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso; + function d3_time_formatIsoNative(date) { + return date.toISOString(); + } + d3_time_formatIsoNative.parse = function(string) { + var date = new Date(string); + return isNaN(date) ? null : date; + }; + d3_time_formatIsoNative.toString = d3_time_formatIso.toString; + d3_time.second = d3_time_interval(function(date) { + return new d3_date(Math.floor(date / 1e3) * 1e3); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 1e3); + }, function(date) { + return date.getSeconds(); + }); + d3_time.seconds = d3_time.second.range; + d3_time.seconds.utc = d3_time.second.utc.range; + d3_time.minute = d3_time_interval(function(date) { + return new d3_date(Math.floor(date / 6e4) * 6e4); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 6e4); + }, function(date) { + return date.getMinutes(); + }); + d3_time.minutes = d3_time.minute.range; + d3_time.minutes.utc = d3_time.minute.utc.range; + d3_time.hour = d3_time_interval(function(date) { + var timezone = date.getTimezoneOffset() / 60; + return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 36e5); + }, function(date) { + return date.getHours(); + }); + d3_time.hours = d3_time.hour.range; + d3_time.hours.utc = d3_time.hour.utc.range; + d3_time.month = d3_time_interval(function(date) { + date = d3_time.day(date); + date.setDate(1); + return date; + }, function(date, offset) { + date.setMonth(date.getMonth() + offset); + }, function(date) { + return date.getMonth(); + }); + d3_time.months = d3_time.month.range; + d3_time.months.utc = d3_time.month.utc.range; + function d3_time_scale(linear, methods, format) { + function scale(x) { + return linear(x); + } + scale.invert = function(x) { + return d3_time_scaleDate(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return linear.domain().map(d3_time_scaleDate); + linear.domain(x); + return scale; + }; + function tickMethod(extent, count) { + var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target); + return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) { + return d / 31536e6; + }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i]; + } + scale.nice = function(interval, skip) { + var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval); + if (method) interval = method[0], skip = method[1]; + function skipped(date) { + return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length; + } + return scale.domain(d3_scale_nice(domain, skip > 1 ? { + floor: function(date) { + while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1); + return date; + }, + ceil: function(date) { + while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1); + return date; + } + } : interval)); + }; + scale.ticks = function(interval, skip) { + var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ { + range: interval + }, skip ]; + if (method) interval = method[0], skip = method[1]; + return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip); + }; + scale.tickFormat = function() { + return format; + }; + scale.copy = function() { + return d3_time_scale(linear.copy(), methods, format); + }; + return d3_scale_linearRebind(scale, linear); + } + function d3_time_scaleDate(t) { + return new Date(t); + } + var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ]; + var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ]; + var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) { + return d.getMilliseconds(); + } ], [ ":%S", function(d) { + return d.getSeconds(); + } ], [ "%I:%M", function(d) { + return d.getMinutes(); + } ], [ "%I %p", function(d) { + return d.getHours(); + } ], [ "%a %d", function(d) { + return d.getDay() && d.getDate() != 1; + } ], [ "%b %d", function(d) { + return d.getDate() != 1; + } ], [ "%B", function(d) { + return d.getMonth(); + } ], [ "%Y", d3_true ] ]); + var d3_time_scaleMilliseconds = { + range: function(start, stop, step) { + return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate); + }, + floor: d3_identity, + ceil: d3_identity + }; + d3_time_scaleLocalMethods.year = d3_time.year; + d3_time.scale = function() { + return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat); + }; + var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) { + return [ m[0].utc, m[1] ]; + }); + var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) { + return d.getUTCMilliseconds(); + } ], [ ":%S", function(d) { + return d.getUTCSeconds(); + } ], [ "%I:%M", function(d) { + return d.getUTCMinutes(); + } ], [ "%I %p", function(d) { + return d.getUTCHours(); + } ], [ "%a %d", function(d) { + return d.getUTCDay() && d.getUTCDate() != 1; + } ], [ "%b %d", function(d) { + return d.getUTCDate() != 1; + } ], [ "%B", function(d) { + return d.getUTCMonth(); + } ], [ "%Y", d3_true ] ]); + d3_time_scaleUtcMethods.year = d3_time.year.utc; + d3_time.scale.utc = function() { + return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat); + }; + d3.text = d3_xhrType(function(request) { + return request.responseText; + }); + d3.json = function(url, callback) { + return d3_xhr(url, "application/json", d3_json, callback); + }; + function d3_json(request) { + return JSON.parse(request.responseText); + } + d3.html = function(url, callback) { + return d3_xhr(url, "text/html", d3_html, callback); + }; + function d3_html(request) { + var range = d3_document.createRange(); + range.selectNode(d3_document.body); + return range.createContextualFragment(request.responseText); + } + d3.xml = d3_xhrType(function(request) { + return request.responseXML; + }); + if (true) !(__WEBPACK_AMD_DEFINE_FACTORY__ = (d3), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); else if (typeof module === "object" && module.exports) module.exports = d3; + this.d3 = d3; + }(); + +/***/ }, +/* 372 */, +/* 373 */, +/* 374 */, +/* 375 */, +/* 376 */, +/* 377 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(378), __esModule: true }; + +/***/ }, +/* 378 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(351); + __webpack_require__(303); + __webpack_require__(285); + __webpack_require__(379); + __webpack_require__(382); + module.exports = __webpack_require__(224).Map; + +/***/ }, +/* 379 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(380); + + // 23.1 Map Objects + __webpack_require__(381)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } + }, strong, true); + +/***/ }, +/* 380 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(205) + , hide = __webpack_require__(294) + , redefineAll = __webpack_require__(363) + , ctx = __webpack_require__(225) + , strictNew = __webpack_require__(353) + , defined = __webpack_require__(229) + , forOf = __webpack_require__(354) + , $iterDefine = __webpack_require__(291) + , step = __webpack_require__(288) + , ID = __webpack_require__(302)('id') + , $has = __webpack_require__(297) + , isObject = __webpack_require__(249) + , setSpecies = __webpack_require__(364) + , DESCRIPTORS = __webpack_require__(296) + , isExtensible = Object.isExtensible || isObject + , SIZE = DESCRIPTORS ? '_s' : 'size' + , id = 0; + + var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!$has(it, ID)){ + // can't set id to frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add id + if(!create)return 'E'; + // add missing object id + hide(it, ID, ++id); + // return object id with prefix + } return 'O' + it[ID]; + }; + + var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + strictNew(that, C, NAME); + that._i = $.create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)$.setDesc(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } + }; + +/***/ }, +/* 381 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(205) + , global = __webpack_require__(223) + , $export = __webpack_require__(222) + , fails = __webpack_require__(232) + , hide = __webpack_require__(294) + , redefineAll = __webpack_require__(363) + , forOf = __webpack_require__(354) + , strictNew = __webpack_require__(353) + , isObject = __webpack_require__(249) + , setToStringTag = __webpack_require__(299) + , DESCRIPTORS = __webpack_require__(296); + + module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + if(!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + } else { + C = wrapper(function(target, iterable){ + strictNew(target, C, NAME); + target._c = new Base; + if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target); + }); + $.each.call('add,clear,delete,forEach,get,has,set,keys,values,entries'.split(','),function(KEY){ + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){ + if(!IS_ADDER && IS_WEAK && !isObject(a))return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + if('size' in proto)$.setDesc(C.prototype, 'size', { + get: function(){ + return this._c.size; + } + }); + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F, O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; + }; + +/***/ }, +/* 382 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(222); + + $export($export.P, 'Map', {toJSON: __webpack_require__(383)('Map')}); + +/***/ }, +/* 383 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var forOf = __webpack_require__(354) + , classof = __webpack_require__(309); + module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + var arr = []; + forOf(this, false, arr.push, arr); + return arr; + }; + }; + +/***/ }, +/* 384 */, +/* 385 */, +/* 386 */, +/* 387 */, +/* 388 */, +/* 389 */, +/* 390 */, +/* 391 */, +/* 392 */, +/* 393 */, +/* 394 */, +/* 395 */, +/* 396 */, +/* 397 */, +/* 398 */, +/* 399 */, +/* 400 */, +/* 401 */, +/* 402 */, +/* 403 */, +/* 404 */, +/* 405 */, +/* 406 */, +/* 407 */, +/* 408 */, +/* 409 */, +/* 410 */, +/* 411 */, +/* 412 */, +/* 413 */, +/* 414 */, +/* 415 */, +/* 416 */, +/* 417 */, +/* 418 */, +/* 419 */, +/* 420 */, +/* 421 */, +/* 422 */, +/* 423 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + __webpack_require__(1190); + window.L = module.exports = __webpack_require__(425); + + __webpack_require__(427); + + __webpack_require__(1191); + __webpack_require__(429); + + +/***/ }, +/* 424 */, +/* 425 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* + Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com + (c) 2010-2013, Vladimir Agafonkin + (c) 2010-2011, CloudMade + */ + !function(t,e,i){var n=t.L,o={};o.version="0.7.5","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"=="function"&&__webpack_require__(426)&&!(__WEBPACK_AMD_DEFINE_FACTORY__ = (o), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?void(o=!0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),void t.apply(i,a))}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],p?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=m&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u],delete _[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n="ActiveXObject"in t,s=n&&!e.addEventListener,a=navigator.userAgent.toLowerCase(),r=-1!==a.indexOf("webkit"),h=-1!==a.indexOf("chrome"),l=-1!==a.indexOf("phantom"),u=-1!==a.indexOf("android"),c=-1!==a.search("android [23]"),d=-1!==a.indexOf("gecko"),p=typeof orientation!=i+"",_=!t.PointerEvent&&t.MSPointerEvent,m=t.PointerEvent&&t.navigator.pointerEnabled&&t.navigator.maxTouchPoints||_,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix&&!c,P="MozPerspective"in g.style,L="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||P||L)&&!l,w=!t.L_NO_TOUCH&&!l&&(m||"ontouchstart"in t||t.DocumentTouch&&e instanceof t.DocumentTouch);o.Browser={ie:n,ielt9:s,webkit:r,gecko:d&&!r&&!t.opera&&!n,android:u,android23:c,chrome:h,ie3d:v,webkit3d:y,gecko3d:P,opera3d:L,any3d:x,mobile:p,mobileWebkit:p&&r,mobileWebkit3d:p&&y,mobileOpera:p&&t.opera,touch:w,msPointer:_,pointer:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var l=o.DomUtil.getStyle(a,"width"),u=o.DomUtil.getStyle(a,"max-width"),c=a.getBoundingClientRect();("none"!==l||"none"!==u)&&(s+=c.left+a.clientLeft),n+=c.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){if(t.classList!==i)return t.classList.contains(e);var n=o.DomUtil._getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,a=n.length;a>s;s++)t.classList.add(n[s]);else if(!o.DomUtil.hasClass(t,e)){var r=o.DomUtil._getClass(t);o.DomUtil._setClass(t,(r?r+" ":"")+e)}},removeClass:function(t,e){t.classList!==i?t.classList.remove(e):o.DomUtil._setClass(t,o.Util.trim((" "+o.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){t.className.baseVal===i?t.className=e:t.className.baseVal=e},_getClass:function(t){return t.className.baseVal===i?t.className:t.className.baseVal},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new o.LatLng(t[0],t[1],t[2]):null:t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):e===i?null:new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=o.latLng(t);return t=null!==e?e:o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t);return o.point(e,e)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=o.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=e===i?this.getZoom():e,this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n));s=e.maxZoom?Math.min(e.maxZoom,s):s;var a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=o.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return t?o.stamp(t)in this._layers:!1},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){if(!this._loaded)return this;t=o.extend({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=i}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom===i?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t);var n,s=this.getMinZoom()-(e?1:0),a=this.getMaxZoom(),r=this.getSize(),h=t.getNorthWest(),l=t.getSouthEast(),u=!0;i=o.point(i||[0,0]);do s++,n=this.project(l,s).subtract(this.project(h,s)).add(i),u=e?n.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-(1/0),o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2),a=new o.Bounds(n.subtract(s),n.add(s)),r=this._getBoundsOffset(a,i,e);return this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new o.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),s=this.project(e.getSouthEast(),i).subtract(t.max),a=this._rebound(n.x,-s.x),r=this._rebound(n.y,-s.y);return new o.Point(a,r)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395", + projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=.5/(Math.PI*e);return new o.Transformation(i,.5,-i,.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-(1/0));for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map,e=t.getPixelBounds(),i=t.getZoom(),n=this._getTileSize();if(!(i>this.options.maxZoom||in;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=this._getTileSize(),o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+=t.zoomOffset,t.maxNativeZoom?Math.min(e,t.maxNativeZoom):e},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this._getTileSize();return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){var t=this._map.options.crs,e=t.getSize(this._map.getZoom());return e.divideBy(this._getTileSize())._floor()},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=o.DomUtil.create("img","leaflet-tile");return t.style.width=t.style.height=this._getTileSize()+"px",t.galleryimg="no",t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&o.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;e.detectRetina&&o.Browser.retina?i.width=i.height=2*n:i.width=i.height=n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._map,i=this.options.tileSize,n=t.multiplyBy(i),s=n.add([i,i]),a=this._crs.project(e.unproject(n,t.z)),r=this._crs.project(e.unproject(s,t.z)),h=this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[r.y,a.x,a.y,r.x].join(","):[a.x,r.y,r.x,a.y].join(","),l=o.Util.template(this._url,{s:this._getSubdomain(t)});return l+o.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+h},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTile:function(){var t=o.DomUtil.create("canvas","leaflet-tile");return t.width=t.height=this.options.tileSize,t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return i=i||e.createElement("img"),i.src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){return this._icon&&this._setPos(this._map.latLngToLayerPoint(this._latlng).round()),this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title),t.alt&&(s.alt=t.alt)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=o.point(this.options.autoPanPaddingTopLeft||a),h=o.point(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),u=0,c=0;s.x+i+h.x>l.x&&(u=s.x+i-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t,t._source=this):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=o.extend({layer:t.target,target:this},t),this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&o.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&o.DomUtil.addClass(this._path,"leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,i.dashArray?t.dashStyle=o.Util.isArray(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):t.dashStyle="",i.lineCap&&(t.endcap=i.lineCap.replace("butt","flat")),i.lineJoin&&(t.joinstyle=i.lineJoin)):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this.fire("remove"),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color),t.lineCap&&(this._ctx.lineCap=t.lineCap),t.lineJoin&&(this._ctx.lineJoin=t.lineJoin)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill(e.fillRule||"evenodd")),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click dblclick contextmenu",this._fireMouseEvent,this))},_fireMouseEvent:function(t){this._containsPoint(t.layerPoint)&&this.fire(t.type,t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return void(this._parts=[n]);this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){o.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)n=this._holes[e]=this._convertLatLngs(this._holes[e]),n[0].equals(n[n.length-1])&&n.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},setLatLngs:function(t){return t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):o.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng,a);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i,n){var s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return s=i(u),e?e(t,s):new o.Marker(s);case"MultiPoint":for(r=0,h=u.length;h>r;r++)s=i(u[r]),c.push(e?e(t,s):new o.Marker(s));return new o.FeatureGroup(c);case"LineString":return a=this.coordsToLatLngs(u,0,i),new o.Polyline(a,n);case"Polygon":if(2===u.length&&!u[1].length)throw new Error("Invalid GeoJSON object.");return a=this.coordsToLatLngs(u,1,i),new o.Polygon(a,n);case"MultiLineString":return a=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(a,n);case"MultiPolygon":return a=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(a,n);case"GeometryCollection":for(r=0,h=l.geometries.length;h>r;r++)c.push(this.geometryToLayer({geometry:l.geometries[r],type:"Feature",properties:t.properties},e,i,n));return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0],t[2])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){var e=[t.lng,t.lat];return t.alt!==i&&e.push(t.alt),e},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t){return function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:t,coordinates:e})}}o.MultiPolyline.include({toGeoJSON:t("MultiLineString")}),o.MultiPolygon.include({toGeoJSON:t("MultiPolygon")}),o.LayerGroup.include({toGeoJSON:function(){var e,i=this.feature&&this.feature.geometry,n=[];if(i&&"MultiPoint"===i.type)return t("MultiPoint").call(this);var s=i&&"GeometryCollection"===i.type;return this.eachLayer(function(t){t.toGeoJSON&&(e=t.toGeoJSON(),n.push(s?e.geometry:o.GeoJSON.asFeature(e)))}),s?o.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,o.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=o.DomEvent.stopPropagation;return o.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.on(t,o.Draggable.START[i],e);return o.DomEvent.on(t,"click",o.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,e){if(!e)return new o.Point(t.clientX,t.clientY);var i=e.getBoundingClientRect();return new o.Point(t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop)},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&500>n||t.target._simulatedClick&&!t._simulated?void o.DomEvent.stop(t):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(o.DomEvent.stopPropagation(t),o.Draggable._disabled||(o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection(),this._moving)))){var i=t.touches?t.touches[0]:t;this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.Browser.touch&&Math.abs(s.x)+Math.abs(s.y)<3||(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.DomUtil.addClass(e.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,o.DomUtil.addClass(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)))},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(){o.DomUtil.removeClass(e.body,"leaflet-dragging"),this._lastTarget&&(o.DomUtil.removeClass(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var t in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[t],this._onMove).off(e,o.Draggable.END[t],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&this._moving&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),s)e.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),r=(this._lastTime+n-this._times[0])/1e3,h=i.easeLinearity,l=a.multiplyBy(h/r),u=l.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,u),d=l.multiplyBy(c/u),p=c/(i.inertiaDeceleration*h),_=d.multiplyBy(-p/2).round();_.x&&_.y?(_=e._limitOffset(_,e.options.maxBounds),o.Util.requestAnimFrame(function(){e.panBy(_,{duration:p,easeLinearity:h,noMoveStart:!0})})):e.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.pointer?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.pointer){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.pointer){var n,s={};for(var a in h)n=h[a],"function"==typeof n?s[a]=n.bind(h):s[a]=n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.pointer?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.pointer&&m.addEventListener(o.DomEvent.POINTER_CANCEL,a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.pointer?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.pointer&&e.documentElement.removeEventListener(o.DomEvent.POINTER_CANCEL,t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n); + case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var a="_leaflet_",r=this._pointers,h=function(t){o.DomEvent.preventDefault(t);for(var e=!1,i=0;i1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta,!1,!0)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return void(this._zooming=!1);var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),void o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this))},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange,this).off("layerremove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a,r){r||(this._animatingZoom=!0),o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),o.Util.requestAnimFrame(function(){this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a}),setTimeout(o.bind(this._onZoomTransitionEnd,this),250)},this)},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1))}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth);var i=this._map.getZoom();(i>this.options.maxZoom||i.5&&.5>n?(t.style.visibility="hidden",void this._stopLoadingImages(t)):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); + +/***/ }, +/* 426 */ +/***/ function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; + + /* WEBPACK VAR INJECTION */}.call(exports, {})) + +/***/ }, +/* 427 */ +/***/ function(module, exports) { + + /* + (c) 2014, Vladimir Agafonkin + simpleheat, a tiny JavaScript library for drawing heatmaps with Canvas + https://github.com/mourner/simpleheat + */ + !function(){"use strict";function t(i){return this instanceof t?(this._canvas=i="string"==typeof i?document.getElementById(i):i,this._ctx=i.getContext("2d"),this._width=i.width,this._height=i.height,this._max=1,void this.clear()):new t(i)}t.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(t){return this._data=t,this},max:function(t){return this._max=t,this},add:function(t){return this._data.push(t),this},clear:function(){return this._data=[],this},radius:function(t,i){i=i||15;var a=this._circle=document.createElement("canvas"),s=a.getContext("2d"),e=this._r=t+i;return a.width=a.height=2*e,s.shadowOffsetX=s.shadowOffsetY=200,s.shadowBlur=i,s.shadowColor="black",s.beginPath(),s.arc(e-200,e-200,t,0,2*Math.PI,!0),s.closePath(),s.fill(),this},gradient:function(t){var i=document.createElement("canvas"),a=i.getContext("2d"),s=a.createLinearGradient(0,0,0,256);i.width=1,i.height=256;for(var e in t)s.addColorStop(e,t[e]);return a.fillStyle=s,a.fillRect(0,0,1,256),this._grad=a.getImageData(0,0,1,256).data,this},draw:function(t){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var i=this._ctx;i.clearRect(0,0,this._width,this._height);for(var a,s=0,e=this._data.length;e>s;s++)a=this._data[s],i.globalAlpha=Math.max(a[2]/this._max,t||.05),i.drawImage(this._circle,a[0]-this._r,a[1]-this._r);var n=i.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),i.putImageData(n,0,0),this},_colorize:function(t,i){for(var a,s=3,e=t.length;e>s;s+=4)a=4*t[s],a&&(t[s-3]=i[a],t[s-2]=i[a+1],t[s-1]=i[a+2])}},window.simpleheat=t}(),/* + (c) 2014, Vladimir Agafonkin + Leaflet.heat, a tiny and fast heatmap plugin for Leaflet. + https://github.com/Leaflet/Leaflet.heat + */ + L.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(t,i){this._latlngs=t,L.setOptions(this,i)},setLatLngs:function(t){return this._latlngs=t,this.redraw()},addLatLng:function(t){return this._latlngs.push(t),this.redraw()},setOptions:function(t){return L.setOptions(this,t),this._heat&&this._updateOptions(),this.redraw()},redraw:function(){return!this._heat||this._frame||this._map._animating||(this._frame=L.Util.requestAnimFrame(this._redraw,this)),this},onAdd:function(t){this._map=t,this._canvas||this._initCanvas(),t._panes.overlayPane.appendChild(this._canvas),t.on("moveend",this._reset,this),t.options.zoomAnimation&&L.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._canvas),t.off("moveend",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},_initCanvas:function(){var t=this._canvas=L.DomUtil.create("canvas","leaflet-heatmap-layer leaflet-layer"),i=this._map.getSize();t.width=i.x,t.height=i.y;var a=this._map.options.zoomAnimation&&L.Browser.any3d;L.DomUtil.addClass(t,"leaflet-zoom-"+(a?"animated":"hide")),this._heat=simpleheat(t),this._updateOptions()},_updateOptions:function(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)},_reset:function(){var t=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(this._canvas,t);var i=this._map.getSize();this._heat._width!==i.x&&(this._canvas.width=this._heat._width=i.x),this._heat._height!==i.y&&(this._canvas.height=this._heat._height=i.y),this._redraw()},_redraw:function(){var t,i,a,s,e,n,h,o,r,_=[],d=this._heat._r,l=this._map.getSize(),m=new L.LatLngBounds(this._map.containerPointToLatLng(L.point([-d,-d])),this._map.containerPointToLatLng(l.add([d,d]))),c=void 0===this.options.maxZoom?this._map.getMaxZoom():this.options.maxZoom,u=1/Math.pow(2,Math.max(0,Math.min(c-this._map.getZoom(),12))),g=d/2,f=[],p=this._map._getMapPanePos(),v=p.x%g,w=p.y%g;for(t=0,i=this._latlngs.length;i>t;t++)if(m.contains(this._latlngs[t])){a=this._map.latLngToContainerPoint(this._latlngs[t]),e=Math.floor((a.x-v)/g)+2,n=Math.floor((a.y-w)/g)+2;var y=void 0!==this._latlngs[t].alt?this._latlngs[t].alt:void 0!==this._latlngs[t][2]?+this._latlngs[t][2]:1;r=y*u,f[n]=f[n]||[],s=f[n][e],s?(s[0]=(s[0]*s[2]+a.x*r)/(s[2]+r),s[1]=(s[1]*s[2]+a.y*r)/(s[2]+r),s[2]+=r):f[n][e]=[a.x,a.y,r]}for(t=0,i=f.length;i>t;t++)if(f[t])for(h=0,o=f[t].length;o>h;h++)s=f[t][h],s&&_.push([Math.round(s[0]),Math.round(s[1]),Math.min(s[2],1)]);this._heat.data(_).draw(this.options.minOpacity),this._frame=null},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),a=this._map._getCenterOffset(t.center)._multiplyBy(-i).subtract(this._map._getMapPanePos());L.DomUtil.setTransform?L.DomUtil.setTransform(this._canvas,a,i):this._canvas.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(a)+" scale("+i+")"}}),L.heatLayer=function(t,i){return new L.HeatLayer(t,i)}; + +/***/ }, +/* 428 */, +/* 429 */ +/***/ function(module, exports) { + + /* + Leaflet.draw, a plugin that adds drawing and editing tools to Leaflet powered maps. + (c) 2012-2013, Jacob Toye, Smartrak + + https://github.com/Leaflet/Leaflet.draw + http://leafletjs.com + https://github.com/jacobtoye + */ + !function(t,e){L.drawVersion="0.2.4-dev",L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"Error: shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes.",text:"Save"},cancel:{title:"Cancel editing, discards all changes.",text:"Cancel"}},buttons:{edit:"Edit layers.",editDisabled:"No layers to edit.",remove:"Delete layers.",removeDisabled:"No layers to delete."}},handlers:{edit:{tooltip:{text:"Drag handles, or marker to edit feature.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove"}}}}},L.Draw={},L.Draw.Feature=L.Handler.extend({includes:L.Mixin.Events,initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire("draw:drawstart",{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire("draw:drawstop",{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire("draw:created",{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&this.disable()}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,showLength:!0,zIndexOffset:2e3},initialize:function(t,e){this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mousedown",this._onMouseDown,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this).on("mouseup",this._onMouseUp,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseup",this._onMouseUp,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mousemove",this._onMouseMove,this).off("zoomend",this._onZoomEnd,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var t=this._markers.pop(),e=this._poly,i=this._poly.spliceLatLngs(e.getLatLngs().length-1,1)[0];this._markerGroup.removeLayer(t),e.getLatLngs().length<2&&this._map.removeLayer(e),this._vertexChanged(i,!1)}},addVertex:function(t){var e=this._markers.length;return e>0&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t)?(this._showErrorTooltip(),void 0):(this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(t)),this._poly.addLatLng(t),2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly),this._vertexChanged(t,!0),void 0)},_finishShape:function(){var t=this._poly.newLatLngIntersects(this._poly.getLatLngs()[0],!0);return!this.options.allowIntersection&&t||!this._shapeIsValid()?(this._showErrorTooltip(),void 0):(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable(),void 0)},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._updateGuide()},_onMouseMove:function(t){var e=t.layerPoint,i=t.latlng;this._currentLatLng=i,this._updateTooltip(i),this._updateGuide(e),this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(t,e){this._updateFinishHandler(),this._updateRunningMeasure(t,e),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t){var e=t.originalEvent;this._mouseDownOrigin=L.point(e.clientX,e.clientY)},_onMouseUp:function(e){if(this._mouseDownOrigin){var i=L.point(e.originalEvent.clientX,e.originalEvent.clientY).distanceTo(this._mouseDownOrigin);Math.abs(i)<9*(t.devicePixelRatio||1)&&this.addVertex(e.latlng)}this._mouseDownOrigin=null},_updateFinishHandler:function(){var t=this._markers.length;t>1&&this._markers[t-1].on("click",this._finishShape,this),t>2&&this._markers[t-2].off("click",this._finishShape,this)},_createMarker:function(t){var e=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e),e},_updateGuide:function(t){var e=this._markers.length;e>0&&(t=t||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e-1].getLatLng()),t))},_updateTooltip:function(t){var e=this._getTooltipText();t&&this._tooltip.updatePosition(t),this._errorShown||this._tooltip.updateContent(e)},_drawGuide:function(t,e){var i,o,a,s=Math.floor(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))),r=this.options.guidelineDistance,n=this.options.maxGuideLineLength,l=s>n?s-n:r;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));s>l;l+=this.options.guidelineDistance)i=l/s,o={x:Math.floor(t.x*(1-i)+i*e.x),y:Math.floor(t.y*(1-i)+i*e.y)},a=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),a.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(a,o)},_updateGuideColor:function(t){if(this._guidesContainer)for(var e=0,i=this._guidesContainer.childNodes.length;i>e;e++)this._guidesContainer.childNodes[e].style.backgroundColor=t},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var t,e,i=this.options.showLength;return 0===this._markers.length?t={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(e=i?this._getMeasurementString():"",t=1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:e}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:e}),t},_updateRunningMeasure:function(t,e){var i,o,a=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=a-(e?2:1),o=t.distanceTo(this._markers[i].getLatLng()),this._measurementRunningTotal+=o*(e?1:-1))},_getMeasurementString:function(){var t,e=this._currentLatLng,i=this._markers[this._markers.length-1].getLatLng();return t=this._measurementRunningTotal+e.distanceTo(i),L.GeometryUtil.readableDistance(t,this.options.metric)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var t=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0}},initialize:function(t,e){L.Draw.Polyline.prototype.initialize.call(this,t,e),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t=this._markers.length;1===t&&this._markers[0].on("click",this._finishShape,this),t>2&&(this._markers[t-1].on("dblclick",this._finishShape,this),t>3&&this._markers[t-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var t,e;return 0===this._markers.length?t=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?t=L.drawLocal.draw.handlers.polygon.tooltip.cont:(t=L.drawLocal.draw.handlers.polygon.tooltip.end,e=this._getMeasurementString()),{text:t,subtext:e}},_getMeasurementString:function(){var t=this._area;return t?L.GeometryUtil.readableArea(t,this.options.metric):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(t,e){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i)),L.Draw.Polyline.prototype._vertexChanged.call(this,t,e)},_cleanUpShape:function(){var t=this._markers.length;t>0&&(this._markers[0].off("click",this._finishShape,this),t>2&&this._markers[t-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t,e){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this),L.DomEvent.off(e,"mouseup",this._onMouseUp,this),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t){this._isDrawing=!0,this._startLatLng=t.latlng,L.DomEvent.on(e,"mouseup",this._onMouseUp,this).preventDefault(t.originalEvent)},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(e))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0},initialize:function(t,e){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_getTooltipText:function(){var t,e,i,o=L.Draw.SimpleShape.prototype._getTooltipText.call(this),a=this._shape;return a&&(t=this._shape.getLatLngs(),e=L.GeometryUtil.geodesicArea(t),i=L.GeometryUtil.readableArea(e,this.options.metric)),{text:o.text,subtext:i}}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#f06eaa",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0},initialize:function(t,e){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){this._shape?this._shape.setRadius(this._startLatLng.distanceTo(t)):(this._shape=new L.Circle(this._startLatLng,this._startLatLng.distanceTo(t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_onMouseMove:function(t){var e,i=t.latlng,o=this.options.showRadius,a=this.options.metric;this._tooltip.updatePosition(i),this._isDrawing&&(this._drawShape(i),e=this._shape.getRadius().toFixed(1),this._tooltip.updateContent({text:this._endLabelText,subtext:o?L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(e,a):""}))}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.Marker.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:L.drawLocal.draw.handlers.marker.tooltip.start}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._marker&&(this._marker.off("click",this._onClick,this),this._map.off("click",this._onClick,this).removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._mouseMarker.setLatLng(e),this._marker?(e=this._mouseMarker.getLatLng(),this._marker.setLatLng(e)):(this._marker=new L.Marker(e,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset}),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_fireCreatedEvent:function(){var t=new L.Marker(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t,e){this._marker=t,L.setOptions(this,e)},addHooks:function(){var t=this._marker;t.dragging.enable(),t.on("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},removeHooks:function(){var t=this._marker;t.dragging.disable(),t.off("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},_onDragEnd:function(t){var e=t.target;e.edited=!0},_toggleMarkerHighlight:function(){if(this._icon){var t=this._icon;t.style.display="none",L.DomUtil.hasClass(t,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,-4)):(L.DomUtil.addClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,4)),t.style.display=""}},_offsetMarker:function(t,e){var i=parseInt(t.style.marginTop,10)-e,o=parseInt(t.style.marginLeft,10)-e;t.style.marginTop=i+"px",t.style.marginLeft=o+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(t,e){this._poly=t,L.setOptions(this,e)},addHooks:function(){var t=this._poly;t instanceof L.Polygon||(t.options.editing.fill=!1),t.setStyle(t.options.editing),this._poly._map&&(this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._poly;t.setStyle(t.options.original),t._map&&(t._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var t,e,i,o,a=this._poly._latlngs;for(t=0,i=a.length;i>t;t++)o=this._createMarker(a[t],t),o.on("click",this._onMarkerClick,this),this._markers.push(o);var s,r;for(t=0,e=i-1;i>t;e=t++)(0!==t||L.Polygon&&this._poly instanceof L.Polygon)&&(s=this._markers[e],r=this._markers[t],this._createMiddleMarker(s,r),this._updatePrevNext(s,r))},_createMarker:function(t,e){var i=new L.Marker(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("drag",this._onMarkerDrag,this),i.on("dragend",this._fireEdit,this),this._markerGroup.addLayer(i),i},_removeMarker:function(t){var e=t._index;this._markerGroup.removeLayer(t),this._markers.splice(e,1),this._poly.spliceLatLngs(e,1),this._updateIndexes(e,-1),t.off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("click",this._onMarkerClick,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit")},_onMarkerDrag:function(t){var e=t.target;L.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next)),this._poly.redraw()},_onMarkerClick:function(t){var e=L.Polygon&&this._poly instanceof L.Polygon?4:3,i=t.target;this._poly._latlngs.lengtht&&(i._index+=e)})},_createMiddleMarker:function(t,e){var i,o,a,s=this._getMiddleLatLng(t,e),r=this._createMarker(s);r.setOpacity(.6),t._middleRight=e._middleLeft=r,o=function(){var o=e._index;r._index=o,r.off("click",i,this).on("click",this._onMarkerClick,this),s.lat=r.getLatLng().lat,s.lng=r.getLatLng().lng,this._poly.spliceLatLngs(o,0,s),this._markers.splice(o,0,r),r.setOpacity(1),this._updateIndexes(o,1),e._index++,this._updatePrevNext(t,r),this._updatePrevNext(r,e),this._poly.fire("editstart")},a=function(){r.off("dragstart",o,this),r.off("dragend",a,this),this._createMiddleMarker(t,r),this._createMiddleMarker(r,e)},i=function(){o.call(this),a.call(this),this._fireEdit()},r.on("click",i,this).on("dragstart",o,this).on("dragend",a,this),this._markerGroup.addLayer(r)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,o=i.project(t.getLatLng()),a=i.project(e.getLatLng());return i.unproject(o._add(a)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"})},initialize:function(t,e){this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;t.setStyle(t.options.editing),t._map&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;i>e;e++)this._unbindMarker(this._resizeMarkers[e]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(t,e){var i=new L.Marker(t,{draggable:!0,icon:e,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(t){t.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this)},_unbindMarker:function(t){t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this)},_onMarkerDragStart:function(t){var e=t.target;e.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(t){var e=t.target,i=e.getLatLng();e===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw()},_onMarkerDragEnd:function(t){var e=t.target;e.setOpacity(1),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getBounds(),e=t.getCenter();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners();this._resizeMarkers=[];for(var e=0,i=t.length;i>e;e++)this._resizeMarkers.push(this._createMarker(t[e],this.options.resizeIcon)),this._resizeMarkers[e]._cornerIndex=e},_onMarkerDragStart:function(t){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t);var e=this._getCorners(),i=t.target,o=i._cornerIndex;this._oppositeCorner=e[(o+2)%4],this._toggleCornerMarkers(0,o)},_onMarkerDragEnd:function(t){var e,i,o=t.target;o===this._moveMarker&&(e=this._shape.getBounds(),i=e.getCenter(),o.setLatLng(i)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t)},_move:function(t){for(var e,i=this._shape.getLatLngs(),o=this._shape.getBounds(),a=o.getCenter(),s=[],r=0,n=i.length;n>r;r++)e=[i[r].lat-a.lat,i[r].lng-a.lng],s.push([t.lat+e[0],t.lng+e[1]]);this._shape.setLatLngs(s),this._repositionCornerMarkers()},_resize:function(t){var e;this._shape.setBounds(L.latLngBounds(t,this._oppositeCorner)),e=this._shape.getBounds(),this._moveMarker.setLatLng(e.getCenter())},_getCorners:function(){var t=this._shape.getBounds(),e=t.getNorthWest(),i=t.getNorthEast(),o=t.getSouthEast(),a=t.getSouthWest();return[e,i,o,a]},_toggleCornerMarkers:function(t){for(var e=0,i=this._resizeMarkers.length;i>e;e++)this._resizeMarkers[e].setOpacity(t)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),e=0,i=this._resizeMarkers.length;i>e;e++)this._resizeMarkers[e].setLatLng(t[e])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getLatLng();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){var t=this._shape.getLatLng(),e=this._getResizeMarkerPoint(t);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(e,this.options.resizeIcon))},_getResizeMarkerPoint:function(t){var e=this._shape._radius*Math.cos(Math.PI/4),i=this._map.project(t);return this._map.unproject([i.x+e,i.y-e])},_move:function(t){var e=this._getResizeMarkerPoint(t);this._resizeMarkers[0].setLatLng(e),this._shape.setLatLng(t)},_resize:function(t){var e=this._moveMarker.getLatLng(),i=e.distanceTo(t);this._shape.setRadius(i)}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,o=t.length;o>i;i++)e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,o=t.length,a=0,s=L.LatLng.DEG_TO_RAD;if(o>2){for(var r=0;o>r;r++)e=t[r],i=t[(r+1)%o],a+=(i.lng-e.lng)*s*(2+Math.sin(e.lat*s)+Math.sin(i.lat*s));a=6378137*a*6378137/2}return Math.abs(a)},readableArea:function(t,e){var i;return e?i=t>=1e4?(1e-4*t).toFixed(2)+" ha":t.toFixed(2)+" m²":(t/=.836127,i=t>=3097600?(t/3097600).toFixed(2)+" mi²":t>=4840?(t/4840).toFixed(2)+" acres":Math.ceil(t)+" yd²"),i},readableDistance:function(t,e){var i;return e?i=t>1e3?(t/1e3).toFixed(2)+" km":Math.ceil(t)+" m":(t*=1.09361,i=t>1760?(t/1760).toFixed(2)+" miles":Math.ceil(t)+" yd"),i}}),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,o){return this._checkCounterclockwise(t,i,o)!==this._checkCounterclockwise(e,i,o)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,o)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,o=this._originalPoints,a=o?o.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=a-1;t>=3;t--)if(e=o[t-1],i=o[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return this._map?this.newPointIntersects(this._map.latLngToLayerPoint(t),e):!1},newPointIntersects:function(t,e){var i=this._originalPoints,o=i?i.length:0,a=i?i[o-1]:null,s=o-2;return this._tooFewPointsForIntersection(1)?!1:this._lineSegmentsIntersectsRange(a,t,s,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._originalPoints,i=e?e.length:0;return i+=t||0,!this._originalPoints||3>=i},_lineSegmentsIntersectsRange:function(t,e,i,o){var a,s,r=this._originalPoints;o=o||0;for(var n=i;n>o;n--)if(a=r[n-1],s=r[n],L.LineUtil.segmentsIntersect(t,e,a,s))return!0;return!1}}),L.Polygon.include({intersects:function(){var t,e,i,o,a,s=this._originalPoints;return this._tooFewPointsForIntersection()?!1:(t=L.Polyline.prototype.intersects.call(this))?!0:(e=s.length,i=s[0],o=s[e-1],a=e-2,this._lineSegmentsIntersectsRange(o,i,a,1))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(t){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,t);var e;this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this))},onAdd:function(t){var e,i=L.DomUtil.create("div","leaflet-draw"),o=!1,a="leaflet-draw-toolbar-top";for(var s in this._toolbars)this._toolbars.hasOwnProperty(s)&&(e=this._toolbars[s].addToolbar(t),e&&(o||(L.DomUtil.hasClass(e,a)||L.DomUtil.addClass(e.childNodes[0],a),o=!0),i.appendChild(e)));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target;for(var i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({includes:[L.Mixin.Events],initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create("div","leaflet-draw-section"),o=0,a=this._toolbarClass||"",s=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=t,e=0;ee;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t,e,i,o,a){var s=t.type;this._modes[s]={},this._modes[s].handler=t,this._modes[s].button=this._createButton({title:a,className:o+"-"+s,container:e,callback:this._modes[s].handler.enable,context:this._modes[s].handler}),this._modes[s].buttonIndex=i,this._modes[s].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_createButton:function(t){var e=L.DomUtil.create("a",t.className||"",t.container);return e.href="#",t.text&&(e.innerHTML=t.text),t.title&&(e.title=t.title),L.DomEvent.on(e,"click",L.DomEvent.stopPropagation).on(e,"mousedown",L.DomEvent.stopPropagation).on(e,"dblclick",L.DomEvent.stopPropagation).on(e,"click",L.DomEvent.preventDefault).on(e,"click",t.callback,t.context),e + },_disposeButton:function(t,e){L.DomEvent.off(t,"click",L.DomEvent.stopPropagation).off(t,"mousedown",L.DomEvent.stopPropagation).off(t,"dblclick",L.DomEvent.stopPropagation).off(t,"click",L.DomEvent.preventDefault).off(t,"click",e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(t){var e,i,o,a,s=this._actionsContainer,r=this.getActions(t),n=r.length;for(i=0,o=this._actionButtons.length;o>i;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];s.firstChild;)s.removeChild(s.firstChild);for(var l=0;n>l;l++)"enabled"in r[l]&&!r[l].enabled||(e=L.DomUtil.create("li","",s),a=this._createButton({title:r[l].title,text:r[l].text,container:e,callback:r[l].callback,context:r[l].context}),this._actionButtons.push({button:a,callback:r[l].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+"px",0===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block"},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom")}}),L.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._container=t.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1},dispose:function(){this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container?(t.subtext=t.subtext||"",0!==t.subtext.length||this._singleLineLabel?t.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(t.subtext.length>0?''+t.subtext+"
    ":"")+""+t.text+"",this):this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(i.style.visibility="inherit",L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker}]},getActions:function(t){return[{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){L.setOptions(this,t);for(var e in this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{color:"#fe57a1",opacity:.6,dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},featureGroup:null},initialize:function(t){t.edit&&("undefined"==typeof t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(){return[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}]},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=this.options.featureGroup,i=0!==e.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:editstart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:editstop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t){this._revertLayer(t)},this)},save:function(){var t=new L.LayerGroup;this._featureGroup.eachLayer(function(e){e.edited&&(t.addLayer(e),e.edited=!1)}),this._map.fire("draw:edited",{layers:t})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:t instanceof L.Marker&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):t instanceof L.Marker&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire("revert-edited",{layer:t}))},_enableLayerEdit:function(t){var e,i=t.layer||t.target||t;this._backupLayer(i),this.options.selectedPathOptions&&(e=L.Util.extend({},this.options.selectedPathOptions),e.maintainColor&&(e.color=i.options.color,e.fillColor=i.options.fillColor),i.options.original=L.extend({},i.options),i.options.editing=e),i.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing.disable(),delete e.options.editing,delete e.options.original},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:deletestart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:deletestop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire("revert-deleted",{layer:t})},this)},save:function(){this._map.fire("draw:deleted",{layers:this._deletedLayers})},_enableLayerDelete:function(t){var e=t.layer||t.target||t;e.on("click",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire("deleted")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document); + +/***/ }, +/* 430 */, +/* 431 */, +/* 432 */, +/* 433 */, +/* 434 */, +/* 435 */, +/* 436 */, +/* 437 */, +/* 438 */, +/* 439 */, +/* 440 */, +/* 441 */, +/* 442 */, +/* 443 */, +/* 444 */, +/* 445 */, +/* 446 */, +/* 447 */, +/* 448 */, +/* 449 */, +/* 450 */, +/* 451 */, +/* 452 */, +/* 453 */, +/* 454 */, +/* 455 */, +/* 456 */, +/* 457 */, +/* 458 */, +/* 459 */, +/* 460 */, +/* 461 */, +/* 462 */, +/* 463 */, +/* 464 */, +/* 465 */, +/* 466 */, +/* 467 */, +/* 468 */, +/* 469 */, +/* 470 */, +/* 471 */, +/* 472 */, +/* 473 */, +/* 474 */, +/* 475 */, +/* 476 */, +/* 477 */, +/* 478 */, +/* 479 */, +/* 480 */, +/* 481 */, +/* 482 */, +/* 483 */, +/* 484 */, +/* 485 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + __webpack_require__(486); + __webpack_require__(489); + __webpack_require__(491); + + __webpack_require__(1077).get('kibana', ['ui.ace']); + + module.exports = window.ace; + + +/***/ }, +/* 486 */ +/***/ function(module, exports, __webpack_require__) { + + /* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + + /** + * Define a module along with a payload + * @param module a name for the payload + * @param payload a function to call with (acequire, exports, module) params + */ + + (function() { + + var ACE_NAMESPACE = "ace"; + + var global = (function() { return this; })(); + if (!global && typeof window != "undefined") global = window; // strict mode + + + if (!ACE_NAMESPACE && typeof acequirejs !== "undefined") + return; + + + var define = function(module, deps, payload) { + if (typeof module !== "string") { + if (define.original) + define.original.apply(this, arguments); + else { + console.error("dropping module because define wasn\'t a string."); + console.trace(); + } + return; + } + if (arguments.length == 2) + payload = deps; + if (!define.modules[module]) { + define.payloads[module] = payload; + define.modules[module] = null; + } + }; + + define.modules = {}; + define.payloads = {}; + + /** + * Get at functionality ace.define()ed using the function above + */ + var _acequire = function(parentId, module, callback) { + if (typeof module === "string") { + var payload = lookup(parentId, module); + if (payload != undefined) { + callback && callback(); + return payload; + } + } else if (Object.prototype.toString.call(module) === "[object Array]") { + var params = []; + for (var i = 0, l = module.length; i < l; ++i) { + var dep = lookup(parentId, module[i]); + if (dep == undefined && acequire.original) + return; + params.push(dep); + } + return callback && callback.apply(null, params) || true; + } + }; + + var acequire = function(module, callback) { + var packagedModule = _acequire("", module, callback); + if (packagedModule == undefined && acequire.original) + return acequire.original.apply(this, arguments); + return packagedModule; + }; + + var normalizeModule = function(parentId, moduleName) { + // normalize plugin acequires + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]); + } + // normalize relative acequires + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = base + "/" + moduleName; + + while(moduleName.indexOf(".") !== -1 && previous != moduleName) { + var previous = moduleName; + moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + return moduleName; + }; + + /** + * Internal function to lookup moduleNames and resolve them by calling the + * definition function if needed. + */ + var lookup = function(parentId, moduleName) { + moduleName = normalizeModule(parentId, moduleName); + + var module = define.modules[moduleName]; + if (!module) { + module = define.payloads[moduleName]; + if (typeof module === 'function') { + var exports = {}; + var mod = { + id: moduleName, + uri: '', + exports: exports, + packaged: true + }; + + var req = function(module, callback) { + return _acequire(moduleName, module, callback); + }; + + var returnValue = module(req, exports, mod); + exports = returnValue || mod.exports; + define.modules[moduleName] = exports; + delete define.payloads[moduleName]; + } + module = define.modules[moduleName] = exports || module; + } + return module; + }; + + function exportAce(ns) { + var root = global; + if (ns) { + if (!global[ns]) + global[ns] = {}; + root = global[ns]; + } + + if (!root.define || !root.define.packaged) { + define.original = root.define; + root.define = define; + root.define.packaged = true; + } + + if (!root.acequire || !root.acequire.packaged) { + acequire.original = root.acequire; + root.acequire = acequire; + root.acequire.packaged = true; + } + } + + exportAce(ACE_NAMESPACE); + + })(); + + ace.define("ace/lib/regexp",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + + var real = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups + compliantLastIndexIncrement = function () { + var x = /^/g; + real.test.call(x, ""); + return !x.lastIndex; + }(); + + if (compliantLastIndexIncrement && compliantExecNpcg) + return; + RegExp.prototype.exec = function (str) { + var match = real.exec.apply(this, arguments), + name, r2; + if ( typeof(str) == 'string' && match) { + if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { + r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", "")); + real.replace.call(str.slice(match.index), r2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) + match[i] = undefined; + } + }); + } + if (this._xregexp && this._xregexp.captureNames) { + for (var i = 1; i < match.length; i++) { + name = this._xregexp.captureNames[i - 1]; + if (name) + match[name] = match[i]; + } + } + if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + } + return match; + }; + if (!compliantLastIndexIncrement) { + RegExp.prototype.test = function (str) { + var match = real.exec.call(this, str); + if (match && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + return !!match; + }; + } + + function getNativeFlags (regex) { + return (regex.global ? "g" : "") + + (regex.ignoreCase ? "i" : "") + + (regex.multiline ? "m" : "") + + (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 + (regex.sticky ? "y" : ""); + } + + function indexOf (array, item, from) { + if (Array.prototype.indexOf) // Use the native array method if available + return array.indexOf(item, from); + for (var i = from || 0; i < array.length; i++) { + if (array[i] === item) + return i; + } + return -1; + } + + }); + + ace.define("ace/lib/es5-shim",["require","exports","module"], function(acequire, exports, module) { + + function Empty() {} + + if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { // .length is 1 + var target = this; + if (typeof target != "function") { + throw new TypeError("Function.prototype.bind called on incompatible " + target); + } + var args = slice.call(arguments, 1); // for normal call + var bound = function () { + + if (this instanceof bound) { + + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + if(target.prototype) { + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; + } + var call = Function.prototype.call; + var prototypeOfArray = Array.prototype; + var prototypeOfObject = Object.prototype; + var slice = prototypeOfArray.slice; + var _toString = call.bind(prototypeOfObject.toString); + var owns = call.bind(prototypeOfObject.hasOwnProperty); + var defineGetter; + var defineSetter; + var lookupGetter; + var lookupSetter; + var supportsAccessors; + if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { + defineGetter = call.bind(prototypeOfObject.__defineGetter__); + defineSetter = call.bind(prototypeOfObject.__defineSetter__); + lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); + lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); + } + if ([1,2].splice(0).length != 2) { + if(function() { // test IE < 9 to splice bug - see issue #138 + function makeArray(l) { + var a = new Array(l+2); + a[0] = a[1] = 0; + return a; + } + var array = [], lengthBefore; + + array.splice.apply(array, makeArray(20)); + array.splice.apply(array, makeArray(26)); + + lengthBefore = array.length; //46 + array.splice(5, 0, "XXX"); // add one element + + lengthBefore + 1 == array.length + + if (lengthBefore + 1 == array.length) { + return true;// has right splice implementation without bugs + } + }()) {//IE 6/7 + var array_splice = Array.prototype.splice; + Array.prototype.splice = function(start, deleteCount) { + if (!arguments.length) { + return []; + } else { + return array_splice.apply(this, [ + start === void 0 ? 0 : start, + deleteCount === void 0 ? (this.length - start) : deleteCount + ].concat(slice.call(arguments, 2))) + } + }; + } else {//IE8 + Array.prototype.splice = function(pos, removeCount){ + var length = this.length; + if (pos > 0) { + if (pos > length) + pos = length; + } else if (pos == void 0) { + pos = 0; + } else if (pos < 0) { + pos = Math.max(length + pos, 0); + } + + if (!(pos+removeCount < length)) + removeCount = length - pos; + + var removed = this.slice(pos, pos+removeCount); + var insert = slice.call(arguments, 2); + var add = insert.length; + if (pos === length) { + if (add) { + this.push.apply(this, insert); + } + } else { + var remove = Math.min(removeCount, length - pos); + var tailOldPos = pos + remove; + var tailNewPos = tailOldPos + add - remove; + var tailCount = length - tailOldPos; + var lengthAfterRemove = length - remove; + + if (tailNewPos < tailOldPos) { // case A + for (var i = 0; i < tailCount; ++i) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } else if (tailNewPos > tailOldPos) { // case B + for (i = tailCount; i--; ) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } // else, add == remove (nothing to do) + + if (add && pos === lengthAfterRemove) { + this.length = lengthAfterRemove; // truncate array + this.push.apply(this, insert); + } else { + this.length = lengthAfterRemove + add; // reserves space + for (i = 0; i < add; ++i) { + this[pos+i] = insert[i]; + } + } + } + return removed; + }; + } + } + if (!Array.isArray) { + Array.isArray = function isArray(obj) { + return _toString(obj) == "[object Array]"; + }; + } + var boxedString = Object("a"), + splitString = boxedString[0] != "a" || !(0 in boxedString); + + if (!Array.prototype.forEach) { + Array.prototype.forEach = function forEach(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + thisp = arguments[1], + i = -1, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(); // TODO message + } + + while (++i < length) { + if (i in self) { + fun.call(thisp, self[i], i, object); + } + } + }; + } + if (!Array.prototype.map) { + Array.prototype.map = function map(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = Array(length), + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) + result[i] = fun.call(thisp, self[i], i, object); + } + return result; + }; + } + if (!Array.prototype.filter) { + Array.prototype.filter = function filter(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = [], + value, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) { + value = self[i]; + if (fun.call(thisp, value, i, object)) { + result.push(value); + } + } + } + return result; + }; + } + if (!Array.prototype.every) { + Array.prototype.every = function every(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && !fun.call(thisp, self[i], i, object)) { + return false; + } + } + return true; + }; + } + if (!Array.prototype.some) { + Array.prototype.some = function some(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && fun.call(thisp, self[i], i, object)) { + return true; + } + } + return false; + }; + } + if (!Array.prototype.reduce) { + Array.prototype.reduce = function reduce(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduce of empty array with no initial value"); + } + + var i = 0; + var result; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i++]; + break; + } + if (++i >= length) { + throw new TypeError("reduce of empty array with no initial value"); + } + } while (true); + } + + for (; i < length; i++) { + if (i in self) { + result = fun.call(void 0, result, self[i], i, object); + } + } + + return result; + }; + } + if (!Array.prototype.reduceRight) { + Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + + var result, i = length - 1; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i--]; + break; + } + if (--i < 0) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + } while (true); + } + + do { + if (i in this) { + result = fun.call(void 0, result, self[i], i, object); + } + } while (i--); + + return result; + }; + } + if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { + Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + + var i = 0; + if (arguments.length > 1) { + i = toInteger(arguments[1]); + } + i = i >= 0 ? i : Math.max(0, length + i); + for (; i < length; i++) { + if (i in self && self[i] === sought) { + return i; + } + } + return -1; + }; + } + if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { + Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + var i = length - 1; + if (arguments.length > 1) { + i = Math.min(i, toInteger(arguments[1])); + } + i = i >= 0 ? i : length - Math.abs(i); + for (; i >= 0; i--) { + if (i in self && sought === self[i]) { + return i; + } + } + return -1; + }; + } + if (!Object.getPrototypeOf) { + Object.getPrototypeOf = function getPrototypeOf(object) { + return object.__proto__ || ( + object.constructor ? + object.constructor.prototype : + prototypeOfObject + ); + }; + } + if (!Object.getOwnPropertyDescriptor) { + var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + + "non-object: "; + Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT + object); + if (!owns(object, property)) + return; + + var descriptor, getter, setter; + descriptor = { enumerable: true, configurable: true }; + if (supportsAccessors) { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + + var getter = lookupGetter(object, property); + var setter = lookupSetter(object, property); + object.__proto__ = prototype; + + if (getter || setter) { + if (getter) descriptor.get = getter; + if (setter) descriptor.set = setter; + return descriptor; + } + } + descriptor.value = object[property]; + return descriptor; + }; + } + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + return Object.keys(object); + }; + } + if (!Object.create) { + var createEmpty; + if (Object.prototype.__proto__ === null) { + createEmpty = function () { + return { "__proto__": null }; + }; + } else { + createEmpty = function () { + var empty = {}; + for (var i in empty) + empty[i] = null; + empty.constructor = + empty.hasOwnProperty = + empty.propertyIsEnumerable = + empty.isPrototypeOf = + empty.toLocaleString = + empty.toString = + empty.valueOf = + empty.__proto__ = null; + return empty; + } + } + + Object.create = function create(prototype, properties) { + var object; + if (prototype === null) { + object = createEmpty(); + } else { + if (typeof prototype != "object") + throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); + var Type = function () {}; + Type.prototype = prototype; + object = new Type(); + object.__proto__ = prototype; + } + if (properties !== void 0) + Object.defineProperties(object, properties); + return object; + }; + } + + function doesDefinePropertyWork(object) { + try { + Object.defineProperty(object, "sentinel", {}); + return "sentinel" in object; + } catch (exception) { + } + } + if (Object.defineProperty) { + var definePropertyWorksOnObject = doesDefinePropertyWork({}); + var definePropertyWorksOnDom = typeof document == "undefined" || + doesDefinePropertyWork(document.createElement("div")); + if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { + var definePropertyFallback = Object.defineProperty; + } + } + + if (!Object.defineProperty || definePropertyFallback) { + var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; + var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " + var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + + "on this javascript engine"; + + Object.defineProperty = function defineProperty(object, property, descriptor) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT_TARGET + object); + if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) + throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); + if (definePropertyFallback) { + try { + return definePropertyFallback.call(Object, object, property, descriptor); + } catch (exception) { + } + } + if (owns(descriptor, "value")) { + + if (supportsAccessors && (lookupGetter(object, property) || + lookupSetter(object, property))) + { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + delete object[property]; + object[property] = descriptor.value; + object.__proto__ = prototype; + } else { + object[property] = descriptor.value; + } + } else { + if (!supportsAccessors) + throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); + if (owns(descriptor, "get")) + defineGetter(object, property, descriptor.get); + if (owns(descriptor, "set")) + defineSetter(object, property, descriptor.set); + } + + return object; + }; + } + if (!Object.defineProperties) { + Object.defineProperties = function defineProperties(object, properties) { + for (var property in properties) { + if (owns(properties, property)) + Object.defineProperty(object, property, properties[property]); + } + return object; + }; + } + if (!Object.seal) { + Object.seal = function seal(object) { + return object; + }; + } + if (!Object.freeze) { + Object.freeze = function freeze(object) { + return object; + }; + } + try { + Object.freeze(function () {}); + } catch (exception) { + Object.freeze = (function freeze(freezeObject) { + return function freeze(object) { + if (typeof object == "function") { + return object; + } else { + return freezeObject(object); + } + }; + })(Object.freeze); + } + if (!Object.preventExtensions) { + Object.preventExtensions = function preventExtensions(object) { + return object; + }; + } + if (!Object.isSealed) { + Object.isSealed = function isSealed(object) { + return false; + }; + } + if (!Object.isFrozen) { + Object.isFrozen = function isFrozen(object) { + return false; + }; + } + if (!Object.isExtensible) { + Object.isExtensible = function isExtensible(object) { + if (Object(object) === object) { + throw new TypeError(); // TODO message + } + var name = ''; + while (owns(object, name)) { + name += '?'; + } + object[name] = true; + var returnValue = owns(object, name); + delete object[name]; + return returnValue; + }; + } + if (!Object.keys) { + var hasDontEnumBug = true, + dontEnums = [ + "toString", + "toLocaleString", + "valueOf", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "constructor" + ], + dontEnumsLength = dontEnums.length; + + for (var key in {"toString": null}) { + hasDontEnumBug = false; + } + + Object.keys = function keys(object) { + + if ( + (typeof object != "object" && typeof object != "function") || + object === null + ) { + throw new TypeError("Object.keys called on a non-object"); + } + + var keys = []; + for (var name in object) { + if (owns(object, name)) { + keys.push(name); + } + } + + if (hasDontEnumBug) { + for (var i = 0, ii = dontEnumsLength; i < ii; i++) { + var dontEnum = dontEnums[i]; + if (owns(object, dontEnum)) { + keys.push(dontEnum); + } + } + } + return keys; + }; + + } + if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; + } + var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + + "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + + "\u2029\uFEFF"; + if (!String.prototype.trim || ws.trim()) { + ws = "[" + ws + "]"; + var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), + trimEndRegexp = new RegExp(ws + ws + "*$"); + String.prototype.trim = function trim() { + return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); + }; + } + + function toInteger(n) { + n = +n; + if (n !== n) { // isNaN + n = 0; + } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + return n; + } + + function isPrimitive(input) { + var type = typeof input; + return ( + input === null || + type === "undefined" || + type === "boolean" || + type === "number" || + type === "string" + ); + } + + function toPrimitive(input) { + var val, valueOf, toString; + if (isPrimitive(input)) { + return input; + } + valueOf = input.valueOf; + if (typeof valueOf === "function") { + val = valueOf.call(input); + if (isPrimitive(val)) { + return val; + } + } + toString = input.toString; + if (typeof toString === "function") { + val = toString.call(input); + if (isPrimitive(val)) { + return val; + } + } + throw new TypeError(); + } + var toObject = function (o) { + if (o == null) { // this matches both null and undefined + throw new TypeError("can't convert "+o+" to object"); + } + return Object(o); + }; + + }); + + ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"], function(acequire, exports, module) { + "use strict"; + + acequire("./regexp"); + acequire("./es5-shim"); + + }); + + ace.define("ace/lib/dom",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + + var XHTML_NS = "http://www.w3.org/1999/xhtml"; + + exports.getDocumentHead = function(doc) { + if (!doc) + doc = document; + return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; + } + + exports.createElement = function(tag, ns) { + return document.createElementNS ? + document.createElementNS(ns || XHTML_NS, tag) : + document.createElement(tag); + }; + + exports.hasCssClass = function(el, name) { + var classes = (el.className || "").split(/\s+/g); + return classes.indexOf(name) !== -1; + }; + exports.addCssClass = function(el, name) { + if (!exports.hasCssClass(el, name)) { + el.className += " " + name; + } + }; + exports.removeCssClass = function(el, name) { + var classes = el.className.split(/\s+/g); + while (true) { + var index = classes.indexOf(name); + if (index == -1) { + break; + } + classes.splice(index, 1); + } + el.className = classes.join(" "); + }; + + exports.toggleCssClass = function(el, name) { + var classes = el.className.split(/\s+/g), add = true; + while (true) { + var index = classes.indexOf(name); + if (index == -1) { + break; + } + add = false; + classes.splice(index, 1); + } + if(add) + classes.push(name); + + el.className = classes.join(" "); + return add; + }; + exports.setCssClass = function(node, className, include) { + if (include) { + exports.addCssClass(node, className); + } else { + exports.removeCssClass(node, className); + } + }; + + exports.hasCssString = function(id, doc) { + var index = 0, sheets; + doc = doc || document; + + if (doc.createStyleSheet && (sheets = doc.styleSheets)) { + while (index < sheets.length) + if (sheets[index++].owningElement.id === id) return true; + } else if ((sheets = doc.getElementsByTagName("style"))) { + while (index < sheets.length) + if (sheets[index++].id === id) return true; + } + + return false; + }; + + exports.importCssString = function importCssString(cssText, id, doc) { + doc = doc || document; + if (id && exports.hasCssString(id, doc)) + return null; + + var style; + + if (doc.createStyleSheet) { + style = doc.createStyleSheet(); + style.cssText = cssText; + if (id) + style.owningElement.id = id; + } else { + style = doc.createElementNS + ? doc.createElementNS(XHTML_NS, "style") + : doc.createElement("style"); + + style.appendChild(doc.createTextNode(cssText)); + if (id) + style.id = id; + + exports.getDocumentHead(doc).appendChild(style); + } + }; + + exports.importCssStylsheet = function(uri, doc) { + if (doc.createStyleSheet) { + doc.createStyleSheet(uri); + } else { + var link = exports.createElement('link'); + link.rel = 'stylesheet'; + link.href = uri; + + exports.getDocumentHead(doc).appendChild(link); + } + }; + + exports.getInnerWidth = function(element) { + return ( + parseInt(exports.computedStyle(element, "paddingLeft"), 10) + + parseInt(exports.computedStyle(element, "paddingRight"), 10) + + element.clientWidth + ); + }; + + exports.getInnerHeight = function(element) { + return ( + parseInt(exports.computedStyle(element, "paddingTop"), 10) + + parseInt(exports.computedStyle(element, "paddingBottom"), 10) + + element.clientHeight + ); + }; + + + if (typeof document == "undefined") + return; + + if (window.pageYOffset !== undefined) { + exports.getPageScrollTop = function() { + return window.pageYOffset; + }; + + exports.getPageScrollLeft = function() { + return window.pageXOffset; + }; + } + else { + exports.getPageScrollTop = function() { + return document.body.scrollTop; + }; + + exports.getPageScrollLeft = function() { + return document.body.scrollLeft; + }; + } + + if (window.getComputedStyle) + exports.computedStyle = function(element, style) { + if (style) + return (window.getComputedStyle(element, "") || {})[style] || ""; + return window.getComputedStyle(element, "") || {}; + }; + else + exports.computedStyle = function(element, style) { + if (style) + return element.currentStyle[style]; + return element.currentStyle; + }; + + exports.scrollbarWidth = function(document) { + var inner = exports.createElement("ace_inner"); + inner.style.width = "100%"; + inner.style.minWidth = "0px"; + inner.style.height = "200px"; + inner.style.display = "block"; + + var outer = exports.createElement("ace_outer"); + var style = outer.style; + + style.position = "absolute"; + style.left = "-10000px"; + style.overflow = "hidden"; + style.width = "200px"; + style.minWidth = "0px"; + style.height = "150px"; + style.display = "block"; + + outer.appendChild(inner); + + var body = document.documentElement; + body.appendChild(outer); + + var noScrollbar = inner.offsetWidth; + + style.overflow = "scroll"; + var withScrollbar = inner.offsetWidth; + + if (noScrollbar == withScrollbar) { + withScrollbar = outer.clientWidth; + } + + body.removeChild(outer); + + return noScrollbar-withScrollbar; + }; + exports.setInnerHtml = function(el, innerHtml) { + var element = el.cloneNode(false);//document.createElement("div"); + element.innerHTML = innerHtml; + el.parentNode.replaceChild(element, el); + return element; + }; + + if ("textContent" in document.documentElement) { + exports.setInnerText = function(el, innerText) { + el.textContent = innerText; + }; + + exports.getInnerText = function(el) { + return el.textContent; + }; + } + else { + exports.setInnerText = function(el, innerText) { + el.innerText = innerText; + }; + + exports.getInnerText = function(el) { + return el.innerText; + }; + } + + exports.getParentWindow = function(document) { + return document.defaultView || document.parentWindow; + }; + + }); + + ace.define("ace/lib/oop",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + + exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + + exports.mixin = function(obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; + }; + + exports.implement = function(proto, mixin) { + exports.mixin(proto, mixin); + }; + + }); + + ace.define("ace/lib/keys",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop"], function(acequire, exports, module) { + "use strict"; + + acequire("./fixoldbrowsers"); + + var oop = acequire("./oop"); + var Keys = (function() { + var ret = { + MODIFIER_KEYS: { + 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta' + }, + + KEY_MODS: { + "ctrl": 1, "alt": 2, "option" : 2, "shift": 4, + "super": 8, "meta": 8, "command": 8, "cmd": 8 + }, + + FUNCTION_KEYS : { + 8 : "Backspace", + 9 : "Tab", + 13 : "Return", + 19 : "Pause", + 27 : "Esc", + 32 : "Space", + 33 : "PageUp", + 34 : "PageDown", + 35 : "End", + 36 : "Home", + 37 : "Left", + 38 : "Up", + 39 : "Right", + 40 : "Down", + 44 : "Print", + 45 : "Insert", + 46 : "Delete", + 96 : "Numpad0", + 97 : "Numpad1", + 98 : "Numpad2", + 99 : "Numpad3", + 100: "Numpad4", + 101: "Numpad5", + 102: "Numpad6", + 103: "Numpad7", + 104: "Numpad8", + 105: "Numpad9", + '-13': "NumpadEnter", + 112: "F1", + 113: "F2", + 114: "F3", + 115: "F4", + 116: "F5", + 117: "F6", + 118: "F7", + 119: "F8", + 120: "F9", + 121: "F10", + 122: "F11", + 123: "F12", + 144: "Numlock", + 145: "Scrolllock" + }, + + PRINTABLE_KEYS: { + 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', + 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a', + 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', + 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', + 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', + 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.', + 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`', + 219: '[', 220: '\\',221: ']', 222: '\'' + } + }; + var name, i; + for (i in ret.FUNCTION_KEYS) { + name = ret.FUNCTION_KEYS[i].toLowerCase(); + ret[name] = parseInt(i, 10); + } + for (i in ret.PRINTABLE_KEYS) { + name = ret.PRINTABLE_KEYS[i].toLowerCase(); + ret[name] = parseInt(i, 10); + } + oop.mixin(ret, ret.MODIFIER_KEYS); + oop.mixin(ret, ret.PRINTABLE_KEYS); + oop.mixin(ret, ret.FUNCTION_KEYS); + ret.enter = ret["return"]; + ret.escape = ret.esc; + ret.del = ret["delete"]; + ret[173] = '-'; + + (function() { + var mods = ["cmd", "ctrl", "alt", "shift"]; + for (var i = Math.pow(2, mods.length); i--;) { + ret.KEY_MODS[i] = mods.filter(function(x) { + return i & ret.KEY_MODS[x]; + }).join("-") + "-"; + } + })(); + + ret.KEY_MODS[0] = ""; + ret.KEY_MODS[-1] = "input-"; + + return ret; + })(); + oop.mixin(exports, Keys); + + exports.keyCodeToString = function(keyCode) { + var keyString = Keys[keyCode]; + if (typeof keyString != "string") + keyString = String.fromCharCode(keyCode); + return keyString.toLowerCase(); + }; + + }); + + ace.define("ace/lib/useragent",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + exports.OS = { + LINUX: "LINUX", + MAC: "MAC", + WINDOWS: "WINDOWS" + }; + exports.getOS = function() { + if (exports.isMac) { + return exports.OS.MAC; + } else if (exports.isLinux) { + return exports.OS.LINUX; + } else { + return exports.OS.WINDOWS; + } + }; + if (typeof navigator != "object") + return; + + var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); + var ua = navigator.userAgent; + exports.isWin = (os == "win"); + exports.isMac = (os == "mac"); + exports.isLinux = (os == "linux"); + exports.isIE = + (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) + ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]) + : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]); // for ie + + exports.isOldIE = exports.isIE && exports.isIE < 9; + exports.isGecko = exports.isMozilla = (window.Controllers || window.controllers) && window.navigator.product === "Gecko"; + exports.isOldGecko = exports.isGecko && parseInt((ua.match(/rv\:(\d+)/)||[])[1], 10) < 4; + exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; + exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; + + exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; + + exports.isAIR = ua.indexOf("AdobeAIR") >= 0; + + exports.isIPad = ua.indexOf("iPad") >= 0; + + exports.isTouchPad = ua.indexOf("TouchPad") >= 0; + + exports.isChromeOS = ua.indexOf(" CrOS ") >= 0; + + }); + + ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(acequire, exports, module) { + "use strict"; + + var keys = acequire("./keys"); + var useragent = acequire("./useragent"); + + exports.addListener = function(elem, type, callback) { + if (elem.addEventListener) { + return elem.addEventListener(type, callback, false); + } + if (elem.attachEvent) { + var wrapper = function() { + callback.call(elem, window.event); + }; + callback._wrapper = wrapper; + elem.attachEvent("on" + type, wrapper); + } + }; + + exports.removeListener = function(elem, type, callback) { + if (elem.removeEventListener) { + return elem.removeEventListener(type, callback, false); + } + if (elem.detachEvent) { + elem.detachEvent("on" + type, callback._wrapper || callback); + } + }; + exports.stopEvent = function(e) { + exports.stopPropagation(e); + exports.preventDefault(e); + return false; + }; + + exports.stopPropagation = function(e) { + if (e.stopPropagation) + e.stopPropagation(); + else + e.cancelBubble = true; + }; + + exports.preventDefault = function(e) { + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; + }; + exports.getButton = function(e) { + if (e.type == "dblclick") + return 0; + if (e.type == "contextmenu" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey))) + return 2; + if (e.preventDefault) { + return e.button; + } + else { + return {1:0, 2:2, 4:1}[e.button]; + } + }; + + exports.capture = function(el, eventHandler, releaseCaptureHandler) { + function onMouseUp(e) { + eventHandler && eventHandler(e); + releaseCaptureHandler && releaseCaptureHandler(e); + + exports.removeListener(document, "mousemove", eventHandler, true); + exports.removeListener(document, "mouseup", onMouseUp, true); + exports.removeListener(document, "dragstart", onMouseUp, true); + } + + exports.addListener(document, "mousemove", eventHandler, true); + exports.addListener(document, "mouseup", onMouseUp, true); + exports.addListener(document, "dragstart", onMouseUp, true); + + return onMouseUp; + }; + + exports.addMouseWheelListener = function(el, callback) { + if ("onmousewheel" in el) { + exports.addListener(el, "mousewheel", function(e) { + var factor = 8; + if (e.wheelDeltaX !== undefined) { + e.wheelX = -e.wheelDeltaX / factor; + e.wheelY = -e.wheelDeltaY / factor; + } else { + e.wheelX = 0; + e.wheelY = -e.wheelDelta / factor; + } + callback(e); + }); + } else if ("onwheel" in el) { + exports.addListener(el, "wheel", function(e) { + var factor = 0.35; + switch (e.deltaMode) { + case e.DOM_DELTA_PIXEL: + e.wheelX = e.deltaX * factor || 0; + e.wheelY = e.deltaY * factor || 0; + break; + case e.DOM_DELTA_LINE: + case e.DOM_DELTA_PAGE: + e.wheelX = (e.deltaX || 0) * 5; + e.wheelY = (e.deltaY || 0) * 5; + break; + } + + callback(e); + }); + } else { + exports.addListener(el, "DOMMouseScroll", function(e) { + if (e.axis && e.axis == e.HORIZONTAL_AXIS) { + e.wheelX = (e.detail || 0) * 5; + e.wheelY = 0; + } else { + e.wheelX = 0; + e.wheelY = (e.detail || 0) * 5; + } + callback(e); + }); + } + }; + + exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) { + var clicks = 0; + var startX, startY, timer; + var eventNames = { + 2: "dblclick", + 3: "tripleclick", + 4: "quadclick" + }; + + exports.addListener(el, "mousedown", function(e) { + if (exports.getButton(e) !== 0) { + clicks = 0; + } else if (e.detail > 1) { + clicks++; + if (clicks > 4) + clicks = 1; + } else { + clicks = 1; + } + if (useragent.isIE) { + var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; + if (!timer || isNewClick) + clicks = 1; + if (timer) + clearTimeout(timer); + timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); + + if (clicks == 1) { + startX = e.clientX; + startY = e.clientY; + } + } + + e._clicks = clicks; + + eventHandler[callbackName]("mousedown", e); + + if (clicks > 4) + clicks = 0; + else if (clicks > 1) + return eventHandler[callbackName](eventNames[clicks], e); + }); + + if (useragent.isOldIE) { + exports.addListener(el, "dblclick", function(e) { + clicks = 2; + if (timer) + clearTimeout(timer); + timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); + eventHandler[callbackName]("mousedown", e); + eventHandler[callbackName](eventNames[clicks], e); + }); + } + }; + + var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window) + ? function(e) { + return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); + } + : function(e) { + return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); + }; + + exports.getModifierString = function(e) { + return keys.KEY_MODS[getModifierHash(e)]; + }; + + function normalizeCommandKeys(callback, e, keyCode) { + var hashId = getModifierHash(e); + + if (!useragent.isMac && pressedKeys) { + if (pressedKeys[91] || pressedKeys[92]) + hashId |= 8; + if (pressedKeys.altGr) { + if ((3 & hashId) != 3) + pressedKeys.altGr = 0; + else + return; + } + if (keyCode === 18 || keyCode === 17) { + var location = "location" in e ? e.location : e.keyLocation; + if (keyCode === 17 && location === 1) { + if (pressedKeys[keyCode] == 1) + ts = e.timeStamp; + } else if (keyCode === 18 && hashId === 3 && location === 2) { + var dt = e.timestamp - ts; + if (dt < 50) + pressedKeys.altGr = true; + } + } + } + + if (keyCode in keys.MODIFIER_KEYS) { + keyCode = -1; + } + + if (hashId & 8 && (keyCode === 91 || keyCode === 93)) { + keyCode = -1; + } + + if (!hashId && keyCode === 13) { + var location = "location" in e ? e.location : e.keyLocation; + if (location === 3) { + callback(e, hashId, -keyCode); + if (e.defaultPrevented) + return; + } + } + + if (useragent.isChromeOS && hashId & 8) { + callback(e, hashId, keyCode); + if (e.defaultPrevented) + return; + else + hashId &= ~8; + } + if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { + return false; + } + + return callback(e, hashId, keyCode); + } + + var pressedKeys = null; + var ts = 0; + exports.addCommandKeyListener = function(el, callback) { + var addListener = exports.addListener; + if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { + var lastKeyDownKeyCode = null; + addListener(el, "keydown", function(e) { + lastKeyDownKeyCode = e.keyCode; + }); + addListener(el, "keypress", function(e) { + return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); + }); + } else { + var lastDefaultPrevented = null; + + addListener(el, "keydown", function(e) { + pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1; + var result = normalizeCommandKeys(callback, e, e.keyCode); + lastDefaultPrevented = e.defaultPrevented; + return result; + }); + + addListener(el, "keypress", function(e) { + if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { + exports.stopEvent(e); + lastDefaultPrevented = null; + } + }); + + addListener(el, "keyup", function(e) { + pressedKeys[e.keyCode] = null; + }); + + if (!pressedKeys) { + pressedKeys = Object.create(null); + addListener(window, "focus", function(e) { + pressedKeys = Object.create(null); + }); + } + } + }; + + if (window.postMessage && !useragent.isOldIE) { + var postMessageId = 1; + exports.nextTick = function(callback, win) { + win = win || window; + var messageName = "zero-timeout-message-" + postMessageId; + exports.addListener(win, "message", function listener(e) { + if (e.data == messageName) { + exports.stopPropagation(e); + exports.removeListener(win, "message", listener); + callback(); + } + }); + win.postMessage(messageName, "*"); + }; + } + + + exports.nextFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame || + window.oRequestAnimationFrame; + + if (exports.nextFrame) + exports.nextFrame = exports.nextFrame.bind(window); + else + exports.nextFrame = function(callback) { + setTimeout(callback, 17); + }; + }); + + ace.define("ace/lib/lang",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + + exports.last = function(a) { + return a[a.length - 1]; + }; + + exports.stringReverse = function(string) { + return string.split("").reverse().join(""); + }; + + exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; + }; + + var trimBeginRegexp = /^\s\s*/; + var trimEndRegexp = /\s\s*$/; + + exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); + }; + + exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); + }; + + exports.copyObject = function(obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; + }; + + exports.copyArray = function(array){ + var copy = []; + for (var i=0, l=array.length; i 1); + return ev.preventDefault(); + }; + + this.startSelect = function(pos, waitForClickSelection) { + pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y); + var editor = this.editor; + editor.$blockScrolling++; + if (this.mousedownEvent.getShiftKey()) + editor.selection.selectToPosition(pos); + else if (!waitForClickSelection) + editor.selection.moveToPosition(pos); + if (!waitForClickSelection) + this.select(); + if (editor.renderer.scroller.setCapture) { + editor.renderer.scroller.setCapture(); + } + editor.setStyle("ace_selecting"); + this.setState("select"); + editor.$blockScrolling--; + }; + + this.select = function() { + var anchor, editor = this.editor; + var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); + editor.$blockScrolling++; + if (this.$clickSelection) { + var cmp = this.$clickSelection.comparePoint(cursor); + + if (cmp == -1) { + anchor = this.$clickSelection.end; + } else if (cmp == 1) { + anchor = this.$clickSelection.start; + } else { + var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); + cursor = orientedRange.cursor; + anchor = orientedRange.anchor; + } + editor.selection.setSelectionAnchor(anchor.row, anchor.column); + } + editor.selection.selectToPosition(cursor); + editor.$blockScrolling--; + editor.renderer.scrollCursorIntoView(); + }; + + this.extendSelectionBy = function(unitName) { + var anchor, editor = this.editor; + var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); + var range = editor.selection[unitName](cursor.row, cursor.column); + editor.$blockScrolling++; + if (this.$clickSelection) { + var cmpStart = this.$clickSelection.comparePoint(range.start); + var cmpEnd = this.$clickSelection.comparePoint(range.end); + + if (cmpStart == -1 && cmpEnd <= 0) { + anchor = this.$clickSelection.end; + if (range.end.row != cursor.row || range.end.column != cursor.column) + cursor = range.start; + } else if (cmpEnd == 1 && cmpStart >= 0) { + anchor = this.$clickSelection.start; + if (range.start.row != cursor.row || range.start.column != cursor.column) + cursor = range.end; + } else if (cmpStart == -1 && cmpEnd == 1) { + cursor = range.end; + anchor = range.start; + } else { + var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); + cursor = orientedRange.cursor; + anchor = orientedRange.anchor; + } + editor.selection.setSelectionAnchor(anchor.row, anchor.column); + } + editor.selection.selectToPosition(cursor); + editor.$blockScrolling--; + editor.renderer.scrollCursorIntoView(); + }; + + this.selectEnd = + this.selectAllEnd = + this.selectByWordsEnd = + this.selectByLinesEnd = function() { + this.$clickSelection = null; + this.editor.unsetStyle("ace_selecting"); + if (this.editor.renderer.scroller.releaseCapture) { + this.editor.renderer.scroller.releaseCapture(); + } + }; + + this.focusWait = function() { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + var time = Date.now(); + + if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimout) + this.startSelect(this.mousedownEvent.getDocumentPosition()); + }; + + this.onDoubleClick = function(ev) { + var pos = ev.getDocumentPosition(); + var editor = this.editor; + var session = editor.session; + + var range = session.getBracketRange(pos); + if (range) { + if (range.isEmpty()) { + range.start.column--; + range.end.column++; + } + this.setState("select"); + } else { + range = editor.selection.getWordRange(pos.row, pos.column); + this.setState("selectByWords"); + } + this.$clickSelection = range; + this.select(); + }; + + this.onTripleClick = function(ev) { + var pos = ev.getDocumentPosition(); + var editor = this.editor; + + this.setState("selectByLines"); + var range = editor.getSelectionRange(); + if (range.isMultiLine() && range.contains(pos.row, pos.column)) { + this.$clickSelection = editor.selection.getLineRange(range.start.row); + this.$clickSelection.end = editor.selection.getLineRange(range.end.row).end; + } else { + this.$clickSelection = editor.selection.getLineRange(pos.row); + } + this.select(); + }; + + this.onQuadClick = function(ev) { + var editor = this.editor; + + editor.selectAll(); + this.$clickSelection = editor.getSelectionRange(); + this.setState("selectAll"); + }; + + this.onMouseWheel = function(ev) { + if (ev.getAccelKey()) + return; + if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) { + ev.wheelX = ev.wheelY; + ev.wheelY = 0; + } + + var t = ev.domEvent.timeStamp; + var dt = t - (this.$lastScrollTime||0); + + var editor = this.editor; + var isScrolable = editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + if (isScrolable || dt < 200) { + this.$lastScrollTime = t; + editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + return ev.stop(); + } + }; + + }).call(DefaultHandlers.prototype); + + exports.DefaultHandlers = DefaultHandlers; + + function calcDistance(ax, ay, bx, by) { + return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); + } + + function calcRangeOrientation(range, cursor) { + if (range.start.row == range.end.row) + var cmp = 2 * cursor.column - range.start.column - range.end.column; + else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column) + var cmp = cursor.column - 4; + else + var cmp = 2 * cursor.row - range.start.row - range.end.row; + + if (cmp < 0) + return {cursor: range.start, anchor: range.end}; + else + return {cursor: range.end, anchor: range.start}; + } + + }); + + ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var dom = acequire("./lib/dom"); + function Tooltip (parentNode) { + this.isOpen = false; + this.$element = null; + this.$parentNode = parentNode; + } + + (function() { + this.$init = function() { + this.$element = dom.createElement("div"); + this.$element.className = "ace_tooltip"; + this.$element.style.display = "none"; + this.$parentNode.appendChild(this.$element); + return this.$element; + }; + this.getElement = function() { + return this.$element || this.$init(); + }; + this.setText = function(text) { + dom.setInnerText(this.getElement(), text); + }; + this.setHtml = function(html) { + this.getElement().innerHTML = html; + }; + this.setPosition = function(x, y) { + this.getElement().style.left = x + "px"; + this.getElement().style.top = y + "px"; + }; + this.setClassName = function(className) { + dom.addCssClass(this.getElement(), className); + }; + this.show = function(text, x, y) { + if (text != null) + this.setText(text); + if (x != null && y != null) + this.setPosition(x, y); + if (!this.isOpen) { + this.getElement().style.display = "block"; + this.isOpen = true; + } + }; + + this.hide = function() { + if (this.isOpen) { + this.getElement().style.display = "none"; + this.isOpen = false; + } + }; + this.getHeight = function() { + return this.getElement().offsetHeight; + }; + this.getWidth = function() { + return this.getElement().offsetWidth; + }; + + }).call(Tooltip.prototype); + + exports.Tooltip = Tooltip; + }); + + ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"], function(acequire, exports, module) { + "use strict"; + var dom = acequire("../lib/dom"); + var oop = acequire("../lib/oop"); + var event = acequire("../lib/event"); + var Tooltip = acequire("../tooltip").Tooltip; + + function GutterHandler(mouseHandler) { + var editor = mouseHandler.editor; + var gutter = editor.renderer.$gutterLayer; + var tooltip = new GutterTooltip(editor.container); + + mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) { + if (!editor.isFocused() || e.getButton() != 0) + return; + var gutterRegion = gutter.getRegion(e); + + if (gutterRegion == "foldWidgets") + return; + + var row = e.getDocumentPosition().row; + var selection = editor.session.selection; + + if (e.getShiftKey()) + selection.selectTo(row, 0); + else { + if (e.domEvent.detail == 2) { + editor.selectAll(); + return e.preventDefault(); + } + mouseHandler.$clickSelection = editor.selection.getLineRange(row); + } + mouseHandler.setState("selectByLines"); + mouseHandler.captureMouse(e); + return e.preventDefault(); + }); + + + var tooltipTimeout, mouseEvent, tooltipAnnotation; + + function showTooltip() { + var row = mouseEvent.getDocumentPosition().row; + var annotation = gutter.$annotations[row]; + if (!annotation) + return hideTooltip(); + + var maxRow = editor.session.getLength(); + if (row == maxRow) { + var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row; + var pos = mouseEvent.$pos; + if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column)) + return hideTooltip(); + } + + if (tooltipAnnotation == annotation) + return; + tooltipAnnotation = annotation.text.join("
    "); + + tooltip.setHtml(tooltipAnnotation); + tooltip.show(); + editor.on("mousewheel", hideTooltip); + + if (mouseHandler.$tooltipFollowsMouse) { + moveTooltip(mouseEvent); + } else { + var gutterElement = gutter.$cells[editor.session.documentToScreenRow(row, 0)].element; + var rect = gutterElement.getBoundingClientRect(); + var style = tooltip.getElement().style; + style.left = rect.right + "px"; + style.top = rect.bottom + "px"; + } + } + + function hideTooltip() { + if (tooltipTimeout) + tooltipTimeout = clearTimeout(tooltipTimeout); + if (tooltipAnnotation) { + tooltip.hide(); + tooltipAnnotation = null; + editor.removeEventListener("mousewheel", hideTooltip); + } + } + + function moveTooltip(e) { + tooltip.setPosition(e.x, e.y); + } + + mouseHandler.editor.setDefaultHandler("guttermousemove", function(e) { + var target = e.domEvent.target || e.domEvent.srcElement; + if (dom.hasCssClass(target, "ace_fold-widget")) + return hideTooltip(); + + if (tooltipAnnotation && mouseHandler.$tooltipFollowsMouse) + moveTooltip(e); + + mouseEvent = e; + if (tooltipTimeout) + return; + tooltipTimeout = setTimeout(function() { + tooltipTimeout = null; + if (mouseEvent && !mouseHandler.isMousePressed) + showTooltip(); + else + hideTooltip(); + }, 50); + }); + + event.addListener(editor.renderer.$gutter, "mouseout", function(e) { + mouseEvent = null; + if (!tooltipAnnotation || tooltipTimeout) + return; + + tooltipTimeout = setTimeout(function() { + tooltipTimeout = null; + hideTooltip(); + }, 50); + }); + + editor.on("changeSession", hideTooltip); + } + + function GutterTooltip(parentNode) { + Tooltip.call(this, parentNode); + } + + oop.inherits(GutterTooltip, Tooltip); + + (function(){ + this.setPosition = function(x, y) { + var windowWidth = window.innerWidth || document.documentElement.clientWidth; + var windowHeight = window.innerHeight || document.documentElement.clientHeight; + var width = this.getWidth(); + var height = this.getHeight(); + x += 15; + y += 15; + if (x + width > windowWidth) { + x -= (x + width) - windowWidth; + } + if (y + height > windowHeight) { + y -= 20 + height; + } + Tooltip.prototype.setPosition.call(this, x, y); + }; + + }).call(GutterTooltip.prototype); + + + + exports.GutterHandler = GutterHandler; + + }); + + ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(acequire, exports, module) { + "use strict"; + + var event = acequire("../lib/event"); + var useragent = acequire("../lib/useragent"); + var MouseEvent = exports.MouseEvent = function(domEvent, editor) { + this.domEvent = domEvent; + this.editor = editor; + + this.x = this.clientX = domEvent.clientX; + this.y = this.clientY = domEvent.clientY; + + this.$pos = null; + this.$inSelection = null; + + this.propagationStopped = false; + this.defaultPrevented = false; + }; + + (function() { + + this.stopPropagation = function() { + event.stopPropagation(this.domEvent); + this.propagationStopped = true; + }; + + this.preventDefault = function() { + event.preventDefault(this.domEvent); + this.defaultPrevented = true; + }; + + this.stop = function() { + this.stopPropagation(); + this.preventDefault(); + }; + this.getDocumentPosition = function() { + if (this.$pos) + return this.$pos; + + this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY); + return this.$pos; + }; + this.inSelection = function() { + if (this.$inSelection !== null) + return this.$inSelection; + + var editor = this.editor; + + + var selectionRange = editor.getSelectionRange(); + if (selectionRange.isEmpty()) + this.$inSelection = false; + else { + var pos = this.getDocumentPosition(); + this.$inSelection = selectionRange.contains(pos.row, pos.column); + } + + return this.$inSelection; + }; + this.getButton = function() { + return event.getButton(this.domEvent); + }; + this.getShiftKey = function() { + return this.domEvent.shiftKey; + }; + + this.getAccelKey = useragent.isMac + ? function() { return this.domEvent.metaKey; } + : function() { return this.domEvent.ctrlKey; }; + + }).call(MouseEvent.prototype); + + }); + + ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"], function(acequire, exports, module) { + "use strict"; + + var dom = acequire("../lib/dom"); + var event = acequire("../lib/event"); + var useragent = acequire("../lib/useragent"); + + var AUTOSCROLL_DELAY = 200; + var SCROLL_CURSOR_DELAY = 200; + var SCROLL_CURSOR_HYSTERESIS = 5; + + function DragdropHandler(mouseHandler) { + + var editor = mouseHandler.editor; + + var blankImage = dom.createElement("img"); + blankImage.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (useragent.isOpera) + blankImage.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"; + + var exports = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"]; + + exports.forEach(function(x) { + mouseHandler[x] = this[x]; + }, this); + editor.addEventListener("mousedown", this.onMouseDown.bind(mouseHandler)); + + + var mouseTarget = editor.container; + var dragSelectionMarker, x, y; + var timerId, range; + var dragCursor, counter = 0; + var dragOperation; + var isInternal; + var autoScrollStartTime; + var cursorMovedTime; + var cursorPointOnCaretMoved; + + this.onDragStart = function(e) { + if (this.cancelDrag || !mouseTarget.draggable) { + var self = this; + setTimeout(function(){ + self.startSelect(); + self.captureMouse(e); + }, 0); + return e.preventDefault(); + } + range = editor.getSelectionRange(); + + var dataTransfer = e.dataTransfer; + dataTransfer.effectAllowed = editor.getReadOnly() ? "copy" : "copyMove"; + if (useragent.isOpera) { + editor.container.appendChild(blankImage); + blankImage.scrollTop = 0; + } + dataTransfer.setDragImage && dataTransfer.setDragImage(blankImage, 0, 0); + if (useragent.isOpera) { + editor.container.removeChild(blankImage); + } + dataTransfer.clearData(); + dataTransfer.setData("Text", editor.session.getTextRange()); + + isInternal = true; + this.setState("drag"); + }; + + this.onDragEnd = function(e) { + mouseTarget.draggable = false; + isInternal = false; + this.setState(null); + if (!editor.getReadOnly()) { + var dropEffect = e.dataTransfer.dropEffect; + if (!dragOperation && dropEffect == "move") + editor.session.remove(editor.getSelectionRange()); + editor.renderer.$cursorLayer.setBlinking(true); + } + this.editor.unsetStyle("ace_dragging"); + this.editor.renderer.setCursorStyle(""); + }; + + this.onDragEnter = function(e) { + if (editor.getReadOnly() || !canAccept(e.dataTransfer)) + return; + x = e.clientX; + y = e.clientY; + if (!dragSelectionMarker) + addDragMarker(); + counter++; + e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); + return event.preventDefault(e); + }; + + this.onDragOver = function(e) { + if (editor.getReadOnly() || !canAccept(e.dataTransfer)) + return; + x = e.clientX; + y = e.clientY; + if (!dragSelectionMarker) { + addDragMarker(); + counter++; + } + if (onMouseMoveTimer !== null) + onMouseMoveTimer = null; + + e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); + return event.preventDefault(e); + }; + + this.onDragLeave = function(e) { + counter--; + if (counter <= 0 && dragSelectionMarker) { + clearDragMarker(); + dragOperation = null; + return event.preventDefault(e); + } + }; + + this.onDrop = function(e) { + if (!dragCursor) + return; + var dataTransfer = e.dataTransfer; + if (isInternal) { + switch (dragOperation) { + case "move": + if (range.contains(dragCursor.row, dragCursor.column)) { + range = { + start: dragCursor, + end: dragCursor + }; + } else { + range = editor.moveText(range, dragCursor); + } + break; + case "copy": + range = editor.moveText(range, dragCursor, true); + break; + } + } else { + var dropData = dataTransfer.getData('Text'); + range = { + start: dragCursor, + end: editor.session.insert(dragCursor, dropData) + }; + editor.focus(); + dragOperation = null; + } + clearDragMarker(); + return event.preventDefault(e); + }; + + event.addListener(mouseTarget, "dragstart", this.onDragStart.bind(mouseHandler)); + event.addListener(mouseTarget, "dragend", this.onDragEnd.bind(mouseHandler)); + event.addListener(mouseTarget, "dragenter", this.onDragEnter.bind(mouseHandler)); + event.addListener(mouseTarget, "dragover", this.onDragOver.bind(mouseHandler)); + event.addListener(mouseTarget, "dragleave", this.onDragLeave.bind(mouseHandler)); + event.addListener(mouseTarget, "drop", this.onDrop.bind(mouseHandler)); + + function scrollCursorIntoView(cursor, prevCursor) { + var now = Date.now(); + var vMovement = !prevCursor || cursor.row != prevCursor.row; + var hMovement = !prevCursor || cursor.column != prevCursor.column; + if (!cursorMovedTime || vMovement || hMovement) { + editor.$blockScrolling += 1; + editor.moveCursorToPosition(cursor); + editor.$blockScrolling -= 1; + cursorMovedTime = now; + cursorPointOnCaretMoved = {x: x, y: y}; + } else { + var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y); + if (distance > SCROLL_CURSOR_HYSTERESIS) { + cursorMovedTime = null; + } else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) { + editor.renderer.scrollCursorIntoView(); + cursorMovedTime = null; + } + } + } + + function autoScroll(cursor, prevCursor) { + var now = Date.now(); + var lineHeight = editor.renderer.layerConfig.lineHeight; + var characterWidth = editor.renderer.layerConfig.characterWidth; + var editorRect = editor.renderer.scroller.getBoundingClientRect(); + var offsets = { + x: { + left: x - editorRect.left, + right: editorRect.right - x + }, + y: { + top: y - editorRect.top, + bottom: editorRect.bottom - y + } + }; + var nearestXOffset = Math.min(offsets.x.left, offsets.x.right); + var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom); + var scrollCursor = {row: cursor.row, column: cursor.column}; + if (nearestXOffset / characterWidth <= 2) { + scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2); + } + if (nearestYOffset / lineHeight <= 1) { + scrollCursor.row += (offsets.y.top < offsets.y.bottom ? -1 : +1); + } + var vScroll = cursor.row != scrollCursor.row; + var hScroll = cursor.column != scrollCursor.column; + var vMovement = !prevCursor || cursor.row != prevCursor.row; + if (vScroll || (hScroll && !vMovement)) { + if (!autoScrollStartTime) + autoScrollStartTime = now; + else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY) + editor.renderer.scrollCursorIntoView(scrollCursor); + } else { + autoScrollStartTime = null; + } + } + + function onDragInterval() { + var prevCursor = dragCursor; + dragCursor = editor.renderer.screenToTextCoordinates(x, y); + scrollCursorIntoView(dragCursor, prevCursor); + autoScroll(dragCursor, prevCursor); + } + + function addDragMarker() { + range = editor.selection.toOrientedRange(); + dragSelectionMarker = editor.session.addMarker(range, "ace_selection", editor.getSelectionStyle()); + editor.clearSelection(); + if (editor.isFocused()) + editor.renderer.$cursorLayer.setBlinking(false); + clearInterval(timerId); + onDragInterval(); + timerId = setInterval(onDragInterval, 20); + counter = 0; + event.addListener(document, "mousemove", onMouseMove); + } + + function clearDragMarker() { + clearInterval(timerId); + editor.session.removeMarker(dragSelectionMarker); + dragSelectionMarker = null; + editor.$blockScrolling += 1; + editor.selection.fromOrientedRange(range); + editor.$blockScrolling -= 1; + if (editor.isFocused() && !isInternal) + editor.renderer.$cursorLayer.setBlinking(!editor.getReadOnly()); + range = null; + dragCursor = null; + counter = 0; + autoScrollStartTime = null; + cursorMovedTime = null; + event.removeListener(document, "mousemove", onMouseMove); + } + var onMouseMoveTimer = null; + function onMouseMove() { + if (onMouseMoveTimer == null) { + onMouseMoveTimer = setTimeout(function() { + if (onMouseMoveTimer != null && dragSelectionMarker) + clearDragMarker(); + }, 20); + } + } + + function canAccept(dataTransfer) { + var types = dataTransfer.types; + return !types || Array.prototype.some.call(types, function(type) { + return type == 'text/plain' || type == 'Text'; + }); + } + + function getDropEffect(e) { + var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized']; + var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized']; + + var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey; + var effectAllowed = "uninitialized"; + try { + effectAllowed = e.dataTransfer.effectAllowed.toLowerCase(); + } catch (e) {} + var dropEffect = "none"; + + if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "copy"; + else if (moveAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "move"; + else if (copyAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "copy"; + + return dropEffect; + } + } + + (function() { + + this.dragWait = function() { + var interval = Date.now() - this.mousedownEvent.time; + if (interval > this.editor.getDragDelay()) + this.startDrag(); + }; + + this.dragWaitEnd = function() { + var target = this.editor.container; + target.draggable = false; + this.startSelect(this.mousedownEvent.getDocumentPosition()); + this.selectEnd(); + }; + + this.dragReadyEnd = function(e) { + this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()); + this.editor.unsetStyle("ace_dragging"); + this.editor.renderer.setCursorStyle(""); + this.dragWaitEnd(); + }; + + this.startDrag = function(){ + this.cancelDrag = false; + var editor = this.editor; + var target = editor.container; + target.draggable = true; + editor.renderer.$cursorLayer.setBlinking(false); + editor.setStyle("ace_dragging"); + var cursorStyle = useragent.isWin ? "default" : "move"; + editor.renderer.setCursorStyle(cursorStyle); + this.setState("dragReady"); + }; + + this.onMouseDrag = function(e) { + var target = this.editor.container; + if (useragent.isIE && this.state == "dragReady") { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + if (distance > 3) + target.dragDrop(); + } + if (this.state === "dragWait") { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + if (distance > 0) { + target.draggable = false; + this.startSelect(this.mousedownEvent.getDocumentPosition()); + } + } + }; + + this.onMouseDown = function(e) { + if (!this.$dragEnabled) + return; + this.mousedownEvent = e; + var editor = this.editor; + + var inSelection = e.inSelection(); + var button = e.getButton(); + var clickCount = e.domEvent.detail || 1; + if (clickCount === 1 && button === 0 && inSelection) { + if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey())) + return; + this.mousedownEvent.time = Date.now(); + var eventTarget = e.domEvent.target || e.domEvent.srcElement; + if ("unselectable" in eventTarget) + eventTarget.unselectable = "on"; + if (editor.getDragDelay()) { + if (useragent.isWebKit) { + this.cancelDrag = true; + var mouseTarget = editor.container; + mouseTarget.draggable = true; + } + this.setState("dragWait"); + } else { + this.startDrag(); + } + this.captureMouse(e, this.onMouseDrag.bind(this)); + e.defaultPrevented = true; + } + }; + + }).call(DragdropHandler.prototype); + + + function calcDistance(ax, ay, bx, by) { + return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); + } + + exports.DragdropHandler = DragdropHandler; + + }); + + ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { + "use strict"; + var dom = acequire("./dom"); + + exports.get = function (url, callback) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + callback(xhr.responseText); + } + }; + xhr.send(null); + }; + + exports.loadScript = function(path, callback) { + var head = dom.getDocumentHead(); + var s = document.createElement('script'); + + s.src = path; + head.appendChild(s); + + s.onload = s.onreadystatechange = function(_, isAbort) { + if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") { + s = s.onload = s.onreadystatechange = null; + if (!isAbort) + callback(); + } + }; + }; + exports.qualifyURL = function(url) { + var a = document.createElement('a'); + a.href = url; + return a.href; + } + + }); + + ace.define("ace/lib/event_emitter",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + + var EventEmitter = {}; + var stopPropagation = function() { this.propagationStopped = true; }; + var preventDefault = function() { this.defaultPrevented = true; }; + + EventEmitter._emit = + EventEmitter._dispatchEvent = function(eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + + if (typeof e != "object" || !e) + e = {}; + + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + + listeners = listeners.slice(); + for (var i=0; i 1) + base = parts[parts.length - 2]; + var path = options[component + "Path"]; + if (path == null) { + path = options.basePath; + } else if (sep == "/") { + component = sep = ""; + } + if (path && path.slice(-1) != "/") + path += "/"; + return path + component + sep + base + this.get("suffix"); + }; + + exports.setModuleUrl = function(name, subst) { + return options.$moduleUrls[name] = subst; + }; + + exports.$loading = {}; + exports.loadModule = function(moduleName, onLoad) { + var module, moduleType; + if (Array.isArray(moduleName)) { + moduleType = moduleName[0]; + moduleName = moduleName[1]; + } + + try { + module = acequire(moduleName); + } catch (e) {} + if (module && !exports.$loading[moduleName]) + return onLoad && onLoad(module); + + if (!exports.$loading[moduleName]) + exports.$loading[moduleName] = []; + + exports.$loading[moduleName].push(onLoad); + + if (exports.$loading[moduleName].length > 1) + return; + + var afterLoad = function() { + acequire([moduleName], function(module) { + exports._emit("load.module", {name: moduleName, module: module}); + var listeners = exports.$loading[moduleName]; + exports.$loading[moduleName] = null; + listeners.forEach(function(onLoad) { + onLoad && onLoad(module); + }); + }); + }; + + if (!exports.get("packaged")) + return afterLoad(); + net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); + }; + init(true);function init(packaged) { + + options.packaged = packaged || acequire.packaged || module.packaged || (global.define && __webpack_require__(487).packaged); + + if (!global.document) + return ""; + + var scriptOptions = {}; + var scriptUrl = ""; + var currentScript = (document.currentScript || document._currentScript ); // native or polyfill + var currentDocument = currentScript && currentScript.ownerDocument || document; + + var scripts = currentDocument.getElementsByTagName("script"); + for (var i=0; i [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function(row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function(range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function(p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function(range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function(range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function(row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function(row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function(row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function(row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function(row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + }; + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function(row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function(firstRow, lastRow) { + if (this.end.row > lastRow) + var end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + var end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + var start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + var start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function(row, column) { + var cmp = this.compare(row, column); + + if (cmp == 0) + return this; + else if (cmp == -1) + var start = {row: row, column: column}; + else + var end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function() { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function() { + return (this.start.row !== this.end.row); + }; + this.clone = function() { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function() { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function(session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function(row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + + }).call(Range.prototype); + Range.fromPoints = function(start, end) { + return new Range(start.row, start.column, end.row, end.column); + }; + Range.comparePoints = comparePoints; + + Range.comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; + }; + + + exports.Range = Range; + }); + + ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var lang = acequire("./lib/lang"); + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + var Range = acequire("./range").Range; + var Selection = function(session) { + this.session = session; + this.doc = session.getDocument(); + + this.clearSelection(); + this.lead = this.selectionLead = this.doc.createAnchor(0, 0); + this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0); + + var self = this; + this.lead.on("change", function(e) { + self._emit("changeCursor"); + if (!self.$isEmpty) + self._emit("changeSelection"); + if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column) + self.$desiredColumn = null; + }); + + this.selectionAnchor.on("change", function() { + if (!self.$isEmpty) + self._emit("changeSelection"); + }); + }; + + (function() { + + oop.implement(this, EventEmitter); + this.isEmpty = function() { + return (this.$isEmpty || ( + this.anchor.row == this.lead.row && + this.anchor.column == this.lead.column + )); + }; + this.isMultiLine = function() { + if (this.isEmpty()) { + return false; + } + + return this.getRange().isMultiLine(); + }; + this.getCursor = function() { + return this.lead.getPosition(); + }; + this.setSelectionAnchor = function(row, column) { + this.anchor.setPosition(row, column); + + if (this.$isEmpty) { + this.$isEmpty = false; + this._emit("changeSelection"); + } + }; + this.getSelectionAnchor = function() { + if (this.$isEmpty) + return this.getSelectionLead(); + else + return this.anchor.getPosition(); + }; + this.getSelectionLead = function() { + return this.lead.getPosition(); + }; + this.shiftSelection = function(columns) { + if (this.$isEmpty) { + this.moveCursorTo(this.lead.row, this.lead.column + columns); + return; + } + + var anchor = this.getSelectionAnchor(); + var lead = this.getSelectionLead(); + + var isBackwards = this.isBackwards(); + + if (!isBackwards || anchor.column !== 0) + this.setSelectionAnchor(anchor.row, anchor.column + columns); + + if (isBackwards || lead.column !== 0) { + this.$moveSelection(function() { + this.moveCursorTo(lead.row, lead.column + columns); + }); + } + }; + this.isBackwards = function() { + var anchor = this.anchor; + var lead = this.lead; + return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column)); + }; + this.getRange = function() { + var anchor = this.anchor; + var lead = this.lead; + + if (this.isEmpty()) + return Range.fromPoints(lead, lead); + + if (this.isBackwards()) { + return Range.fromPoints(lead, anchor); + } + else { + return Range.fromPoints(anchor, lead); + } + }; + this.clearSelection = function() { + if (!this.$isEmpty) { + this.$isEmpty = true; + this._emit("changeSelection"); + } + }; + this.selectAll = function() { + var lastRow = this.doc.getLength() - 1; + this.setSelectionAnchor(0, 0); + this.moveCursorTo(lastRow, this.doc.getLine(lastRow).length); + }; + this.setRange = + this.setSelectionRange = function(range, reverse) { + if (reverse) { + this.setSelectionAnchor(range.end.row, range.end.column); + this.selectTo(range.start.row, range.start.column); + } else { + this.setSelectionAnchor(range.start.row, range.start.column); + this.selectTo(range.end.row, range.end.column); + } + if (this.getRange().isEmpty()) + this.$isEmpty = true; + this.$desiredColumn = null; + }; + + this.$moveSelection = function(mover) { + var lead = this.lead; + if (this.$isEmpty) + this.setSelectionAnchor(lead.row, lead.column); + + mover.call(this); + }; + this.selectTo = function(row, column) { + this.$moveSelection(function() { + this.moveCursorTo(row, column); + }); + }; + this.selectToPosition = function(pos) { + this.$moveSelection(function() { + this.moveCursorToPosition(pos); + }); + }; + this.moveTo = function(row, column) { + this.clearSelection(); + this.moveCursorTo(row, column); + }; + this.moveToPosition = function(pos) { + this.clearSelection(); + this.moveCursorToPosition(pos); + }; + this.selectUp = function() { + this.$moveSelection(this.moveCursorUp); + }; + this.selectDown = function() { + this.$moveSelection(this.moveCursorDown); + }; + this.selectRight = function() { + this.$moveSelection(this.moveCursorRight); + }; + this.selectLeft = function() { + this.$moveSelection(this.moveCursorLeft); + }; + this.selectLineStart = function() { + this.$moveSelection(this.moveCursorLineStart); + }; + this.selectLineEnd = function() { + this.$moveSelection(this.moveCursorLineEnd); + }; + this.selectFileEnd = function() { + this.$moveSelection(this.moveCursorFileEnd); + }; + this.selectFileStart = function() { + this.$moveSelection(this.moveCursorFileStart); + }; + this.selectWordRight = function() { + this.$moveSelection(this.moveCursorWordRight); + }; + this.selectWordLeft = function() { + this.$moveSelection(this.moveCursorWordLeft); + }; + this.getWordRange = function(row, column) { + if (typeof column == "undefined") { + var cursor = row || this.lead; + row = cursor.row; + column = cursor.column; + } + return this.session.getWordRange(row, column); + }; + this.selectWord = function() { + this.setSelectionRange(this.getWordRange()); + }; + this.selectAWord = function() { + var cursor = this.getCursor(); + var range = this.session.getAWordRange(cursor.row, cursor.column); + this.setSelectionRange(range); + }; + + this.getLineRange = function(row, excludeLastChar) { + var rowStart = typeof row == "number" ? row : this.lead.row; + var rowEnd; + + var foldLine = this.session.getFoldLine(rowStart); + if (foldLine) { + rowStart = foldLine.start.row; + rowEnd = foldLine.end.row; + } else { + rowEnd = rowStart; + } + if (excludeLastChar === true) + return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); + else + return new Range(rowStart, 0, rowEnd + 1, 0); + }; + this.selectLine = function() { + this.setSelectionRange(this.getLineRange()); + }; + this.moveCursorUp = function() { + this.moveCursorBy(-1, 0); + }; + this.moveCursorDown = function() { + this.moveCursorBy(1, 0); + }; + this.moveCursorLeft = function() { + var cursor = this.lead.getPosition(), + fold; + + if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) { + this.moveCursorTo(fold.start.row, fold.start.column); + } else if (cursor.column === 0) { + if (cursor.row > 0) { + this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length); + } + } + else { + var tabSize = this.session.getTabSize(); + if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize) + this.moveCursorBy(0, -tabSize); + else + this.moveCursorBy(0, -1); + } + }; + this.moveCursorRight = function() { + var cursor = this.lead.getPosition(), + fold; + if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) { + this.moveCursorTo(fold.end.row, fold.end.column); + } + else if (this.lead.column == this.doc.getLine(this.lead.row).length) { + if (this.lead.row < this.doc.getLength() - 1) { + this.moveCursorTo(this.lead.row + 1, 0); + } + } + else { + var tabSize = this.session.getTabSize(); + var cursor = this.lead; + if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize) + this.moveCursorBy(0, tabSize); + else + this.moveCursorBy(0, 1); + } + }; + this.moveCursorLineStart = function() { + var row = this.lead.row; + var column = this.lead.column; + var screenRow = this.session.documentToScreenRow(row, column); + var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0); + var beforeCursor = this.session.getDisplayLine( + row, null, firstColumnPosition.row, + firstColumnPosition.column + ); + + var leadingSpace = beforeCursor.match(/^\s*/); + if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart) + firstColumnPosition.column += leadingSpace[0].length; + this.moveCursorToPosition(firstColumnPosition); + }; + this.moveCursorLineEnd = function() { + var lead = this.lead; + var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column); + if (this.lead.column == lineEnd.column) { + var line = this.session.getLine(lineEnd.row); + if (lineEnd.column == line.length) { + var textEnd = line.search(/\s+$/); + if (textEnd > 0) + lineEnd.column = textEnd; + } + } + + this.moveCursorTo(lineEnd.row, lineEnd.column); + }; + this.moveCursorFileEnd = function() { + var row = this.doc.getLength() - 1; + var column = this.doc.getLine(row).length; + this.moveCursorTo(row, column); + }; + this.moveCursorFileStart = function() { + this.moveCursorTo(0, 0); + }; + this.moveCursorLongWordRight = function() { + var row = this.lead.row; + var column = this.lead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var match; + this.session.nonTokenRe.lastIndex = 0; + this.session.tokenRe.lastIndex = 0; + var fold = this.session.getFoldAt(row, column, 1); + if (fold) { + this.moveCursorTo(fold.end.row, fold.end.column); + return; + } + if (match = this.session.nonTokenRe.exec(rightOfCursor)) { + column += this.session.nonTokenRe.lastIndex; + this.session.nonTokenRe.lastIndex = 0; + rightOfCursor = line.substring(column); + } + if (column >= line.length) { + this.moveCursorTo(row, line.length); + this.moveCursorRight(); + if (row < this.doc.getLength() - 1) + this.moveCursorWordRight(); + return; + } + if (match = this.session.tokenRe.exec(rightOfCursor)) { + column += this.session.tokenRe.lastIndex; + this.session.tokenRe.lastIndex = 0; + } + + this.moveCursorTo(row, column); + }; + this.moveCursorLongWordLeft = function() { + var row = this.lead.row; + var column = this.lead.column; + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) { + this.moveCursorTo(fold.start.row, fold.start.column); + return; + } + + var str = this.session.getFoldStringAt(row, column, -1); + if (str == null) { + str = this.doc.getLine(row).substring(0, column); + } + + var leftOfCursor = lang.stringReverse(str); + var match; + this.session.nonTokenRe.lastIndex = 0; + this.session.tokenRe.lastIndex = 0; + if (match = this.session.nonTokenRe.exec(leftOfCursor)) { + column -= this.session.nonTokenRe.lastIndex; + leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex); + this.session.nonTokenRe.lastIndex = 0; + } + if (column <= 0) { + this.moveCursorTo(row, 0); + this.moveCursorLeft(); + if (row > 0) + this.moveCursorWordLeft(); + return; + } + if (match = this.session.tokenRe.exec(leftOfCursor)) { + column -= this.session.tokenRe.lastIndex; + this.session.tokenRe.lastIndex = 0; + } + + this.moveCursorTo(row, column); + }; + + this.$shortWordEndIndex = function(rightOfCursor) { + var match, index = 0, ch; + var whitespaceRe = /\s/; + var tokenRe = this.session.tokenRe; + + tokenRe.lastIndex = 0; + if (match = this.session.tokenRe.exec(rightOfCursor)) { + index = this.session.tokenRe.lastIndex; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + + if (index < 1) { + tokenRe.lastIndex = 0; + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + tokenRe.lastIndex = 0; + index ++; + if (whitespaceRe.test(ch)) { + if (index > 2) { + index--; + break; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + if (index > 2) + break; + } + } + } + } + } + tokenRe.lastIndex = 0; + + return index; + }; + + this.moveCursorShortWordRight = function() { + var row = this.lead.row; + var column = this.lead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var fold = this.session.getFoldAt(row, column, 1); + if (fold) + return this.moveCursorTo(fold.end.row, fold.end.column); + + if (column == line.length) { + var l = this.doc.getLength(); + do { + row++; + rightOfCursor = this.doc.getLine(row); + } while (row < l && /^\s*$/.test(rightOfCursor)); + + if (!/^\s+/.test(rightOfCursor)) + rightOfCursor = ""; + column = 0; + } + + var index = this.$shortWordEndIndex(rightOfCursor); + + this.moveCursorTo(row, column + index); + }; + + this.moveCursorShortWordLeft = function() { + var row = this.lead.row; + var column = this.lead.column; + + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) + return this.moveCursorTo(fold.start.row, fold.start.column); + + var line = this.session.getLine(row).substring(0, column); + if (column === 0) { + do { + row--; + line = this.doc.getLine(row); + } while (row > 0 && /^\s*$/.test(line)); + + column = line.length; + if (!/\s+$/.test(line)) + line = ""; + } + + var leftOfCursor = lang.stringReverse(line); + var index = this.$shortWordEndIndex(leftOfCursor); + + return this.moveCursorTo(row, column - index); + }; + + this.moveCursorWordRight = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordRight(); + else + this.moveCursorShortWordRight(); + }; + + this.moveCursorWordLeft = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordLeft(); + else + this.moveCursorShortWordLeft(); + }; + this.moveCursorBy = function(rows, chars) { + var screenPos = this.session.documentToScreenPosition( + this.lead.row, + this.lead.column + ); + + if (chars === 0) { + if (this.$desiredColumn) + screenPos.column = this.$desiredColumn; + else + this.$desiredColumn = screenPos.column; + } + + var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column); + + if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) { + if (this.session.lineWidgets && this.session.lineWidgets[docPos.row]) + docPos.row++; + } + this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0); + }; + this.moveCursorToPosition = function(position) { + this.moveCursorTo(position.row, position.column); + }; + this.moveCursorTo = function(row, column, keepDesiredColumn) { + var fold = this.session.getFoldAt(row, column, 1); + if (fold) { + row = fold.start.row; + column = fold.start.column; + } + + this.$keepDesiredColumnOnChange = true; + this.lead.setPosition(row, column); + this.$keepDesiredColumnOnChange = false; + + if (!keepDesiredColumn) + this.$desiredColumn = null; + }; + this.moveCursorToScreen = function(row, column, keepDesiredColumn) { + var pos = this.session.screenToDocumentPosition(row, column); + this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); + }; + this.detach = function() { + this.lead.detach(); + this.anchor.detach(); + this.session = this.doc = null; + }; + + this.fromOrientedRange = function(range) { + this.setSelectionRange(range, range.cursor == range.start); + this.$desiredColumn = range.desiredColumn || this.$desiredColumn; + }; + + this.toOrientedRange = function(range) { + var r = this.getRange(); + if (range) { + range.start.column = r.start.column; + range.start.row = r.start.row; + range.end.column = r.end.column; + range.end.row = r.end.row; + } else { + range = r; + } + + range.cursor = this.isBackwards() ? range.start : range.end; + range.desiredColumn = this.$desiredColumn; + return range; + }; + this.getRangeOfMovements = function(func) { + var start = this.getCursor(); + try { + func.call(null, this); + var end = this.getCursor(); + return Range.fromPoints(start,end); + } catch(e) { + return Range.fromPoints(start,start); + } finally { + this.moveCursorToPosition(start); + } + }; + + this.toJSON = function() { + if (this.rangeCount) { + var data = this.ranges.map(function(r) { + var r1 = r.clone(); + r1.isBackwards = r.cursor == r.start; + return r1; + }); + } else { + var data = this.getRange(); + data.isBackwards = this.isBackwards(); + } + return data; + }; + + this.fromJSON = function(data) { + if (data.start == undefined) { + if (this.rangeList) { + this.toSingleRange(data[0]); + for (var i = data.length; i--; ) { + var r = Range.fromPoints(data[i].start, data[i].end); + if (data.isBackwards) + r.cursor = r.start; + this.addRange(r, true); + } + return; + } else + data = data[0]; + } + if (this.rangeList) + this.toSingleRange(data); + this.setSelectionRange(data, data.isBackwards); + }; + + this.isEqual = function(data) { + if ((data.length || this.rangeCount) && data.length != this.rangeCount) + return false; + if (!data.length || !this.ranges) + return this.getRange().isEqual(data); + + for (var i = this.ranges.length; i--; ) { + if (!this.ranges[i].isEqual(data[i])) + return false; + } + return true; + }; + + }).call(Selection.prototype); + + exports.Selection = Selection; + }); + + ace.define("ace/tokenizer",["require","exports","module","ace/config"], function(acequire, exports, module) { + "use strict"; + + var config = acequire("./config"); + var MAX_TOKEN_COUNT = 2000; + var Tokenizer = function(rules) { + this.states = rules; + + this.regExps = {}; + this.matchMappings = {}; + for (var key in this.states) { + var state = this.states[key]; + var ruleRegExps = []; + var matchTotal = 0; + var mapping = this.matchMappings[key] = {defaultToken: "text"}; + var flag = "g"; + + var splitterRurles = []; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.defaultToken) + mapping.defaultToken = rule.defaultToken; + if (rule.caseInsensitive) + flag = "gi"; + if (rule.regex == null) + continue; + + if (rule.regex instanceof RegExp) + rule.regex = rule.regex.toString().slice(1, -1); + var adjustedregex = rule.regex; + var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; + if (Array.isArray(rule.token)) { + if (rule.token.length == 1 || matchcount == 1) { + rule.token = rule.token[0]; + } else if (matchcount - 1 != rule.token.length) { + this.reportError("number of classes and regexp groups doesn't match", { + rule: rule, + groupCount: matchcount - 1 + }); + rule.token = rule.token[0]; + } else { + rule.tokenArray = rule.token; + rule.token = null; + rule.onMatch = this.$arrayTokens; + } + } else if (typeof rule.token == "function" && !rule.onMatch) { + if (matchcount > 1) + rule.onMatch = this.$applyToken; + else + rule.onMatch = rule.token; + } + + if (matchcount > 1) { + if (/\\\d/.test(rule.regex)) { + adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); + } else { + matchcount = 1; + adjustedregex = this.removeCapturingGroups(rule.regex); + } + if (!rule.splitRegex && typeof rule.token != "string") + splitterRurles.push(rule); // flag will be known only at the very end + } + + mapping[matchTotal] = i; + matchTotal += matchcount; + + ruleRegExps.push(adjustedregex); + if (!rule.onMatch) + rule.onMatch = null; + } + + if (!ruleRegExps.length) { + mapping[0] = 0; + ruleRegExps.push("$"); + } + + splitterRurles.forEach(function(rule) { + rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); + }, this); + + this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); + } + }; + + (function() { + this.$setMaxTokenCount = function(m) { + MAX_TOKEN_COUNT = m | 0; + }; + + this.$applyToken = function(str) { + var values = this.splitRegex.exec(str).slice(1); + var types = this.token.apply(this, values); + if (typeof types === "string") + return [{type: types, value: str}]; + + var tokens = []; + for (var i = 0, l = types.length; i < l; i++) { + if (values[i]) + tokens[tokens.length] = { + type: types[i], + value: values[i] + }; + } + return tokens; + }, + + this.$arrayTokens = function(str) { + if (!str) + return []; + var values = this.splitRegex.exec(str); + if (!values) + return "text"; + var tokens = []; + var types = this.tokenArray; + for (var i = 0, l = types.length; i < l; i++) { + if (values[i + 1]) + tokens[tokens.length] = { + type: types[i], + value: values[i + 1] + }; + } + return tokens; + }; + + this.removeCapturingGroups = function(src) { + var r = src.replace( + /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, + function(x, y) {return y ? "(?:" : x;} + ); + return r; + }; + + this.createSplitterRegexp = function(src, flag) { + if (src.indexOf("(?=") != -1) { + var stack = 0; + var inChClass = false; + var lastCapture = {}; + src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( + m, esc, parenOpen, parenClose, square, index + ) { + if (inChClass) { + inChClass = square != "]"; + } else if (square) { + inChClass = true; + } else if (parenClose) { + if (stack == lastCapture.stack) { + lastCapture.end = index+1; + lastCapture.stack = -1; + } + stack--; + } else if (parenOpen) { + stack++; + if (parenOpen.length != 1) { + lastCapture.stack = stack + lastCapture.start = index; + } + } + return m; + }); + + if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) + src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); + } + return new RegExp(src, (flag||"").replace("g", "")); + }; + this.getLineTokens = function(line, startState) { + if (startState && typeof startState != "string") { + var stack = startState.slice(0); + startState = stack[0]; + if (startState === "#tmp") { + stack.shift() + startState = stack.shift() + } + } else + var stack = []; + + var currentState = startState || "start"; + var state = this.states[currentState]; + if (!state) { + currentState = "start"; + state = this.states[currentState]; + } + var mapping = this.matchMappings[currentState]; + var re = this.regExps[currentState]; + re.lastIndex = 0; + + var match, tokens = []; + var lastIndex = 0; + var matchAttempts = 0; + + var token = {type: null, value: ""}; + + while (match = re.exec(line)) { + var type = mapping.defaultToken; + var rule = null; + var value = match[0]; + var index = re.lastIndex; + + if (index - value.length > lastIndex) { + var skipped = line.substring(lastIndex, index - value.length); + if (token.type == type) { + token.value += skipped; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: skipped}; + } + } + + for (var i = 0; i < match.length-2; i++) { + if (match[i + 1] === undefined) + continue; + + rule = state[mapping[i]]; + + if (rule.onMatch) + type = rule.onMatch(value, currentState, stack); + else + type = rule.token; + + if (rule.next) { + if (typeof rule.next == "string") { + currentState = rule.next; + } else { + currentState = rule.next(currentState, stack); + } + + state = this.states[currentState]; + if (!state) { + this.reportError("state doesn't exist", currentState); + currentState = "start"; + state = this.states[currentState]; + } + mapping = this.matchMappings[currentState]; + lastIndex = index; + re = this.regExps[currentState]; + re.lastIndex = index; + } + break; + } + + if (value) { + if (typeof type === "string") { + if ((!rule || rule.merge !== false) && token.type === type) { + token.value += value; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: value}; + } + } else if (type) { + if (token.type) + tokens.push(token); + token = {type: null, value: ""}; + for (var i = 0; i < type.length; i++) + tokens.push(type[i]); + } + } + + if (lastIndex == line.length) + break; + + lastIndex = index; + + if (matchAttempts++ > MAX_TOKEN_COUNT) { + if (matchAttempts > 2 * line.length) { + this.reportError("infinite loop with in ace tokenizer", { + startState: startState, + line: line + }); + } + while (lastIndex < line.length) { + if (token.type) + tokens.push(token); + token = { + value: line.substring(lastIndex, lastIndex += 2000), + type: "overflow" + }; + } + currentState = "start"; + stack = []; + break; + } + } + + if (token.type) + tokens.push(token); + + if (stack.length > 1) { + if (stack[0] !== currentState) + stack.unshift("#tmp", currentState); + } + return { + tokens : tokens, + state : stack.length ? stack : currentState + }; + }; + + this.reportError = config.reportError; + + }).call(Tokenizer.prototype); + + exports.Tokenizer = Tokenizer; + }); + + ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"], function(acequire, exports, module) { + "use strict"; + + var lang = acequire("../lib/lang"); + + var TextHighlightRules = function() { + + this.$rules = { + "start" : [{ + token : "empty_line", + regex : '^$' + }, { + defaultToken : "text" + }] + }; + }; + + (function() { + + this.addRules = function(rules, prefix) { + if (!prefix) { + for (var key in rules) + this.$rules[key] = rules[key]; + return; + } + for (var key in rules) { + var state = rules[key]; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.next || rule.onMatch) { + if (typeof rule.next != "string") { + if (rule.nextState && rule.nextState.indexOf(prefix) !== 0) + rule.nextState = prefix + rule.nextState; + } else { + if (rule.next.indexOf(prefix) !== 0) + rule.next = prefix + rule.next; + } + } + } + this.$rules[prefix + key] = state; + } + }; + + this.getRules = function() { + return this.$rules; + }; + + this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) { + var embedRules = typeof HighlightRules == "function" + ? new HighlightRules().getRules() + : HighlightRules; + if (states) { + for (var i = 0; i < states.length; i++) + states[i] = prefix + states[i]; + } else { + states = []; + for (var key in embedRules) + states.push(prefix + key); + } + + this.addRules(embedRules, prefix); + + if (escapeRules) { + var addRules = Array.prototype[append ? "push" : "unshift"]; + for (var i = 0; i < states.length; i++) + addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules)); + } + + if (!this.$embeds) + this.$embeds = []; + this.$embeds.push(prefix); + }; + + this.getEmbeds = function() { + return this.$embeds; + }; + + var pushState = function(currentState, stack) { + if (currentState != "start" || stack.length) + stack.unshift(this.nextState, currentState); + return this.nextState; + }; + var popState = function(currentState, stack) { + stack.shift(); + return stack.shift() || "start"; + }; + + this.normalizeRules = function() { + var id = 0; + var rules = this.$rules; + function processState(key) { + var state = rules[key]; + state.processed = true; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (!rule.regex && rule.start) { + rule.regex = rule.start; + if (!rule.next) + rule.next = []; + rule.next.push({ + defaultToken: rule.token + }, { + token: rule.token + ".end", + regex: rule.end || rule.start, + next: "pop" + }); + rule.token = rule.token + ".start"; + rule.push = true; + } + var next = rule.next || rule.push; + if (next && Array.isArray(next)) { + var stateName = rule.stateName; + if (!stateName) { + stateName = rule.token; + if (typeof stateName != "string") + stateName = stateName[0] || ""; + if (rules[stateName]) + stateName += id++; + } + rules[stateName] = next; + rule.next = stateName; + processState(stateName); + } else if (next == "pop") { + rule.next = popState; + } + + if (rule.push) { + rule.nextState = rule.next || rule.push; + rule.next = pushState; + delete rule.push; + } + + if (rule.rules) { + for (var r in rule.rules) { + if (rules[r]) { + if (rules[r].push) + rules[r].push.apply(rules[r], rule.rules[r]); + } else { + rules[r] = rule.rules[r]; + } + } + } + if (rule.include || typeof rule == "string") { + var includeName = rule.include || rule; + var toInsert = rules[includeName]; + } else if (Array.isArray(rule)) + toInsert = rule; + + if (toInsert) { + var args = [i, 1].concat(toInsert); + if (rule.noEscape) + args = args.filter(function(x) {return !x.next;}); + state.splice.apply(state, args); + i--; + toInsert = null; + } + + if (rule.keywordMap) { + rule.token = this.createKeywordMapper( + rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive + ); + delete rule.defaultToken; + } + } + } + Object.keys(rules).forEach(processState, this); + }; + + this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) { + var keywords = Object.create(null); + Object.keys(map).forEach(function(className) { + var a = map[className]; + if (ignoreCase) + a = a.toLowerCase(); + var list = a.split(splitChar || "|"); + for (var i = list.length; i--; ) + keywords[list[i]] = className; + }); + if (Object.getPrototypeOf(keywords)) { + keywords.__proto__ = null; + } + this.$keywordList = Object.keys(keywords); + map = null; + return ignoreCase + ? function(value) {return keywords[value.toLowerCase()] || defaultToken } + : function(value) {return keywords[value] || defaultToken }; + }; + + this.getKeywords = function() { + return this.$keywords; + }; + + }).call(TextHighlightRules.prototype); + + exports.TextHighlightRules = TextHighlightRules; + }); + + ace.define("ace/mode/behaviour",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + + var Behaviour = function() { + this.$behaviours = {}; + }; + + (function () { + + this.add = function (name, action, callback) { + switch (undefined) { + case this.$behaviours: + this.$behaviours = {}; + case this.$behaviours[name]: + this.$behaviours[name] = {}; + } + this.$behaviours[name][action] = callback; + } + + this.addBehaviours = function (behaviours) { + for (var key in behaviours) { + for (var action in behaviours[key]) { + this.add(key, action, behaviours[key][action]); + } + } + } + + this.remove = function (name) { + if (this.$behaviours && this.$behaviours[name]) { + delete this.$behaviours[name]; + } + } + + this.inherit = function (mode, filter) { + if (typeof mode === "function") { + var behaviours = new mode().getBehaviours(filter); + } else { + var behaviours = mode.getBehaviours(filter); + } + this.addBehaviours(behaviours); + } + + this.getBehaviours = function (filter) { + if (!filter) { + return this.$behaviours; + } else { + var ret = {} + for (var i = 0; i < filter.length; i++) { + if (this.$behaviours[filter[i]]) { + ret[filter[i]] = this.$behaviours[filter[i]]; + } + } + return ret; + } + } + + }).call(Behaviour.prototype); + + exports.Behaviour = Behaviour; + }); + + ace.define("ace/unicode",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + exports.packages = {}; + + addUnicodePackage({ + L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A", + Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A", + Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC", + Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F", + Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26", + Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26", + Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC", + Me: "0488048906DE20DD-20E020E2-20E4A670-A672", + N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF", + No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835", + P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65", + Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D", + Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62", + Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63", + Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20", + Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21", + Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F", + Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65", + S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD", + Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC", + Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6", + Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3", + So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD", + Z: "002000A01680180E2000-200A20282029202F205F3000", + Zs: "002000A01680180E2000-200A202F205F3000", + Zl: "2028", + Zp: "2029", + C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF", + Cc: "0000-001F007F-009F", + Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB", + Co: "E000-F8FF", + Cs: "D800-DFFF", + Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF" + }); + + function addUnicodePackage (pack) { + var codePoint = /\w{4}/g; + for (var name in pack) + exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); + }; + + }); + + ace.define("ace/token_iterator",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + var TokenIterator = function(session, initialRow, initialColumn) { + this.$session = session; + this.$row = initialRow; + this.$rowTokens = session.getTokens(initialRow); + + var token = session.getTokenAt(initialRow, initialColumn); + this.$tokenIndex = token ? token.index : -1; + }; + + (function() { + this.stepBackward = function() { + this.$tokenIndex -= 1; + + while (this.$tokenIndex < 0) { + this.$row -= 1; + if (this.$row < 0) { + this.$row = 0; + return null; + } + + this.$rowTokens = this.$session.getTokens(this.$row); + this.$tokenIndex = this.$rowTokens.length - 1; + } + + return this.$rowTokens[this.$tokenIndex]; + }; + this.stepForward = function() { + this.$tokenIndex += 1; + var rowCount; + while (this.$tokenIndex >= this.$rowTokens.length) { + this.$row += 1; + if (!rowCount) + rowCount = this.$session.getLength(); + if (this.$row >= rowCount) { + this.$row = rowCount - 1; + return null; + } + + this.$rowTokens = this.$session.getTokens(this.$row); + this.$tokenIndex = 0; + } + + return this.$rowTokens[this.$tokenIndex]; + }; + this.getCurrentToken = function () { + return this.$rowTokens[this.$tokenIndex]; + }; + this.getCurrentTokenRow = function () { + return this.$row; + }; + this.getCurrentTokenColumn = function() { + var rowTokens = this.$rowTokens; + var tokenIndex = this.$tokenIndex; + var column = rowTokens[tokenIndex].start; + if (column !== undefined) + return column; + + column = 0; + while (tokenIndex > 0) { + tokenIndex -= 1; + column += rowTokens[tokenIndex].value.length; + } + + return column; + }; + + }).call(TokenIterator.prototype); + + exports.TokenIterator = TokenIterator; + }); + + ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"], function(acequire, exports, module) { + "use strict"; + + var Tokenizer = acequire("../tokenizer").Tokenizer; + var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules; + var Behaviour = acequire("./behaviour").Behaviour; + var unicode = acequire("../unicode"); + var lang = acequire("../lib/lang"); + var TokenIterator = acequire("../token_iterator").TokenIterator; + var Range = acequire("../range").Range; + + var Mode = function() { + this.HighlightRules = TextHighlightRules; + this.$behaviour = new Behaviour(); + }; + + (function() { + + this.tokenRe = new RegExp("^[" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "\\$_]+", "g" + ); + + this.nonTokenRe = new RegExp("^(?:[^" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "\\$_]|\\s])+", "g" + ); + + this.getTokenizer = function() { + if (!this.$tokenizer) { + this.$highlightRules = this.$highlightRules || new this.HighlightRules(); + this.$tokenizer = new Tokenizer(this.$highlightRules.getRules()); + } + return this.$tokenizer; + }; + + this.lineCommentStart = ""; + this.blockComment = ""; + + this.toggleCommentLines = function(state, session, startRow, endRow) { + var doc = session.doc; + + var ignoreBlankLines = true; + var shouldRemove = true; + var minIndent = Infinity; + var tabSize = session.getTabSize(); + var insertAtTabStop = false; + + if (!this.lineCommentStart) { + if (!this.blockComment) + return false; + var lineCommentStart = this.blockComment.start; + var lineCommentEnd = this.blockComment.end; + var regexpStart = new RegExp("^(\\s*)(?:" + lang.escapeRegExp(lineCommentStart) + ")"); + var regexpEnd = new RegExp("(?:" + lang.escapeRegExp(lineCommentEnd) + ")\\s*$"); + + var comment = function(line, i) { + if (testRemove(line, i)) + return; + if (!ignoreBlankLines || /\S/.test(line)) { + doc.insertInLine({row: i, column: line.length}, lineCommentEnd); + doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + } + }; + + var uncomment = function(line, i) { + var m; + if (m = line.match(regexpEnd)) + doc.removeInLine(i, line.length - m[0].length, line.length); + if (m = line.match(regexpStart)) + doc.removeInLine(i, m[1].length, m[0].length); + }; + + var testRemove = function(line, row) { + if (regexpStart.test(line)) + return true; + var tokens = session.getTokens(row); + for (var i = 0; i < tokens.length; i++) { + if (tokens[i].type === 'comment') + return true; + } + }; + } else { + if (Array.isArray(this.lineCommentStart)) { + var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join("|"); + var lineCommentStart = this.lineCommentStart[0]; + } else { + var regexpStart = lang.escapeRegExp(this.lineCommentStart); + var lineCommentStart = this.lineCommentStart; + } + regexpStart = new RegExp("^(\\s*)(?:" + regexpStart + ") ?"); + + insertAtTabStop = session.getUseSoftTabs(); + + var uncomment = function(line, i) { + var m = line.match(regexpStart); + if (!m) return; + var start = m[1].length, end = m[0].length; + if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == " ") + end--; + doc.removeInLine(i, start, end); + }; + var commentWithSpace = lineCommentStart + " "; + var comment = function(line, i) { + if (!ignoreBlankLines || /\S/.test(line)) { + if (shouldInsertSpace(line, minIndent, minIndent)) + doc.insertInLine({row: i, column: minIndent}, commentWithSpace); + else + doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + } + }; + var testRemove = function(line, i) { + return regexpStart.test(line); + }; + + var shouldInsertSpace = function(line, before, after) { + var spaces = 0; + while (before-- && line.charAt(before) == " ") + spaces++; + if (spaces % tabSize != 0) + return false; + var spaces = 0; + while (line.charAt(after++) == " ") + spaces++; + if (tabSize > 2) + return spaces % tabSize != tabSize - 1; + else + return spaces % tabSize == 0; + return true; + }; + } + + function iter(fun) { + for (var i = startRow; i <= endRow; i++) + fun(doc.getLine(i), i); + } + + + var minEmptyLength = Infinity; + iter(function(line, i) { + var indent = line.search(/\S/); + if (indent !== -1) { + if (indent < minIndent) + minIndent = indent; + if (shouldRemove && !testRemove(line, i)) + shouldRemove = false; + } else if (minEmptyLength > line.length) { + minEmptyLength = line.length; + } + }); + + if (minIndent == Infinity) { + minIndent = minEmptyLength; + ignoreBlankLines = false; + shouldRemove = false; + } + + if (insertAtTabStop && minIndent % tabSize != 0) + minIndent = Math.floor(minIndent / tabSize) * tabSize; + + iter(shouldRemove ? uncomment : comment); + }; + + this.toggleBlockComment = function(state, session, range, cursor) { + var comment = this.blockComment; + if (!comment) + return; + if (!comment.start && comment[0]) + comment = comment[0]; + + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + var sel = session.selection; + var initialRange = session.selection.toOrientedRange(); + var startRow, colDiff; + + if (token && /comment/.test(token.type)) { + var startRange, endRange; + while (token && /comment/.test(token.type)) { + var i = token.value.indexOf(comment.start); + if (i != -1) { + var row = iterator.getCurrentTokenRow(); + var column = iterator.getCurrentTokenColumn() + i; + startRange = new Range(row, column, row, column + comment.start.length); + break; + } + token = iterator.stepBackward(); + } + + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + while (token && /comment/.test(token.type)) { + var i = token.value.indexOf(comment.end); + if (i != -1) { + var row = iterator.getCurrentTokenRow(); + var column = iterator.getCurrentTokenColumn() + i; + endRange = new Range(row, column, row, column + comment.end.length); + break; + } + token = iterator.stepForward(); + } + if (endRange) + session.remove(endRange); + if (startRange) { + session.remove(startRange); + startRow = startRange.start.row; + colDiff = -comment.start.length; + } + } else { + colDiff = comment.start.length; + startRow = range.start.row; + session.insert(range.end, comment.end); + session.insert(range.start, comment.start); + } + if (initialRange.start.row == startRow) + initialRange.start.column += colDiff; + if (initialRange.end.row == startRow) + initialRange.end.column += colDiff; + session.selection.fromOrientedRange(initialRange); + }; + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.autoOutdent = function(state, doc, row) { + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + + this.createWorker = function(session) { + return null; + }; + + this.createModeDelegates = function (mapping) { + this.$embeds = []; + this.$modes = {}; + for (var i in mapping) { + if (mapping[i]) { + this.$embeds.push(i); + this.$modes[i] = new mapping[i](); + } + } + + var delegations = ['toggleBlockComment', 'toggleCommentLines', 'getNextLineIndent', + 'checkOutdent', 'autoOutdent', 'transformAction', 'getCompletions']; + + for (var i = 0; i < delegations.length; i++) { + (function(scope) { + var functionName = delegations[i]; + var defaultHandler = scope[functionName]; + scope[delegations[i]] = function() { + return this.$delegator(functionName, arguments, defaultHandler); + }; + } (this)); + } + }; + + this.$delegator = function(method, args, defaultHandler) { + var state = args[0]; + if (typeof state != "string") + state = state[0]; + for (var i = 0; i < this.$embeds.length; i++) { + if (!this.$modes[this.$embeds[i]]) continue; + + var split = state.split(this.$embeds[i]); + if (!split[0] && split[1]) { + args[0] = split[1]; + var mode = this.$modes[this.$embeds[i]]; + return mode[method].apply(mode, args); + } + } + var ret = defaultHandler.apply(this, args); + return defaultHandler ? ret : undefined; + }; + + this.transformAction = function(state, action, editor, session, param) { + if (this.$behaviour) { + var behaviours = this.$behaviour.getBehaviours(); + for (var key in behaviours) { + if (behaviours[key][action]) { + var ret = behaviours[key][action].apply(this, arguments); + if (ret) { + return ret; + } + } + } + } + }; + + this.getKeywords = function(append) { + if (!this.completionKeywords) { + var rules = this.$tokenizer.rules; + var completionKeywords = []; + for (var rule in rules) { + var ruleItr = rules[rule]; + for (var r = 0, l = ruleItr.length; r < l; r++) { + if (typeof ruleItr[r].token === "string") { + if (/keyword|support|storage/.test(ruleItr[r].token)) + completionKeywords.push(ruleItr[r].regex); + } + else if (typeof ruleItr[r].token === "object") { + for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) { + if (/keyword|support|storage/.test(ruleItr[r].token[a])) { + var rule = ruleItr[r].regex.match(/\(.+?\)/g)[a]; + completionKeywords.push(rule.substr(1, rule.length - 2)); + } + } + } + } + } + this.completionKeywords = completionKeywords; + } + if (!append) + return this.$keywordList; + return completionKeywords.concat(this.$keywordList || []); + }; + + this.$createKeywordList = function() { + if (!this.$highlightRules) + this.getTokenizer(); + return this.$keywordList = this.$highlightRules.$keywordList || []; + }; + + this.getCompletions = function(state, session, pos, prefix) { + var keywords = this.$keywordList || this.$createKeywordList(); + return keywords.map(function(word) { + return { + name: word, + value: word, + score: 0, + meta: "keyword" + }; + }); + }; + + this.$id = "ace/mode/text"; + }).call(Mode.prototype); + + exports.Mode = Mode; + }); + + ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + + var Anchor = exports.Anchor = function(doc, row, column) { + this.$onChange = this.onChange.bind(this); + this.attach(doc); + + if (typeof column == "undefined") + this.setPosition(row.row, row.column); + else + this.setPosition(row, column); + }; + + (function() { + + oop.implement(this, EventEmitter); + this.getPosition = function() { + return this.$clipPositionToDocument(this.row, this.column); + }; + this.getDocument = function() { + return this.document; + }; + this.$insertRight = false; + this.onChange = function(e) { + var delta = e.data; + var range = delta.range; + + if (range.start.row == range.end.row && range.start.row != this.row) + return; + + if (range.start.row > this.row) + return; + + if (range.start.row == this.row && range.start.column > this.column) + return; + + var row = this.row; + var column = this.column; + var start = range.start; + var end = range.end; + + if (delta.action === "insertText") { + if (start.row === row && start.column <= column) { + if (start.column === column && this.$insertRight) { + } else if (start.row === end.row) { + column += end.column - start.column; + } else { + column -= start.column; + row += end.row - start.row; + } + } else if (start.row !== end.row && start.row < row) { + row += end.row - start.row; + } + } else if (delta.action === "insertLines") { + if (start.row === row && column === 0 && this.$insertRight) { + } + else if (start.row <= row) { + row += end.row - start.row; + } + } else if (delta.action === "removeText") { + if (start.row === row && start.column < column) { + if (end.column >= column) + column = start.column; + else + column = Math.max(0, column - (end.column - start.column)); + + } else if (start.row !== end.row && start.row < row) { + if (end.row === row) + column = Math.max(0, column - end.column) + start.column; + row -= (end.row - start.row); + } else if (end.row === row) { + row -= end.row - start.row; + column = Math.max(0, column - end.column) + start.column; + } + } else if (delta.action == "removeLines") { + if (start.row <= row) { + if (end.row <= row) + row -= end.row - start.row; + else { + row = start.row; + column = 0; + } + } + } + + this.setPosition(row, column, true); + }; + this.setPosition = function(row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._signal("change", { + old: old, + value: pos + }); + }; + this.detach = function() { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function(doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function(row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + + }).call(Anchor.prototype); + + }); + + ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + var Range = acequire("./range").Range; + var Anchor = acequire("./anchor").Anchor; + + var Document = function(text) { + this.$lines = []; + if (text.length === 0) { + this.$lines = [""]; + } else if (Array.isArray(text)) { + this._insertLines(0, text); + } else { + this.insert({row: 0, column:0}, text); + } + }; + + (function() { + + oop.implement(this, EventEmitter); + this.setValue = function(text) { + var len = this.getLength(); + this.remove(new Range(0, 0, len, this.getLine(len-1).length)); + this.insert({row: 0, column:0}, text); + }; + this.getValue = function() { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function(row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length === 0) + this.$split = function(text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + }; + else + this.$split = function(text) { + return text.split(/\r\n|\r|\n/); + }; + + + this.$detectNewLine = function(text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + this._signal("changeNewLineMode"); + }; + this.getNewLineCharacter = function() { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine || "\n"; + } + }; + + this.$autoNewLine = ""; + this.$newLineMode = "auto"; + this.setNewLineMode = function(newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + this._signal("changeNewLineMode"); + }; + this.getNewLineMode = function() { + return this.$newLineMode; + }; + this.isNewLine = function(text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function(row) { + return this.$lines[row] || ""; + }; + this.getLines = function(firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function() { + return this.getLines(0, this.getLength()); + }; + this.getLength = function() { + return this.$lines.length; + }; + this.getTextRange = function(range) { + if (range.start.row == range.end.row) { + return this.getLine(range.start.row) + .substring(range.start.column, range.end.column); + } + var lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + return lines.join(this.getNewLineCharacter()); + }; + + this.$clipPosition = function(position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length-1).length; + } else if (position.row < 0) + position.row = 0; + return position; + }; + this.insert = function(position, text) { + if (!text || text.length === 0) + return position; + + position = this.$clipPosition(position); + if (this.getLength() <= 1) + this.$detectNewLine(text); + + var lines = this.$split(text); + var firstLine = lines.splice(0, 1)[0]; + var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; + + position = this.insertInLine(position, firstLine); + if (lastLine !== null) { + position = this.insertNewLine(position); // terminate first line + position = this._insertLines(position.row, lines); + position = this.insertInLine(position, lastLine || ""); + } + return position; + }; + this.insertLines = function(row, lines) { + if (row >= this.getLength()) + return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); + return this._insertLines(Math.max(row, 0), lines); + }; + this._insertLines = function(row, lines) { + if (lines.length == 0) + return {row: row, column: 0}; + while (lines.length > 20000) { + var end = this._insertLines(row, lines.slice(0, 20000)); + lines = lines.slice(20000); + row = end.row; + } + + var args = [row, 0]; + args.push.apply(args, lines); + this.$lines.splice.apply(this.$lines, args); + + var range = new Range(row, 0, row + lines.length, 0); + var delta = { + action: "insertLines", + range: range, + lines: lines + }; + this._signal("change", { data: delta }); + return range.end; + }; + this.insertNewLine = function(position) { + position = this.$clipPosition(position); + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column); + this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); + + var end = { + row : position.row + 1, + column : 0 + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: this.getNewLineCharacter() + }; + this._signal("change", { data: delta }); + + return end; + }; + this.insertInLine = function(position, text) { + if (text.length == 0) + return position; + + var line = this.$lines[position.row] || ""; + + this.$lines[position.row] = line.substring(0, position.column) + text + + line.substring(position.column); + + var end = { + row : position.row, + column : position.column + text.length + }; + + var delta = { + action: "insertText", + range: Range.fromPoints(position, end), + text: text + }; + this._signal("change", { data: delta }); + + return end; + }; + this.remove = function(range) { + if (!(range instanceof Range)) + range = Range.fromPoints(range.start, range.end); + range.start = this.$clipPosition(range.start); + range.end = this.$clipPosition(range.end); + + if (range.isEmpty()) + return range.start; + + var firstRow = range.start.row; + var lastRow = range.end.row; + + if (range.isMultiLine()) { + var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; + var lastFullRow = lastRow - 1; + + if (range.end.column > 0) + this.removeInLine(lastRow, 0, range.end.column); + + if (lastFullRow >= firstFullRow) + this._removeLines(firstFullRow, lastFullRow); + + if (firstFullRow != firstRow) { + this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); + this.removeNewLine(range.start.row); + } + } + else { + this.removeInLine(firstRow, range.start.column, range.end.column); + } + return range.start; + }; + this.removeInLine = function(row, startColumn, endColumn) { + if (startColumn == endColumn) + return; + + var range = new Range(row, startColumn, row, endColumn); + var line = this.getLine(row); + var removed = line.substring(startColumn, endColumn); + var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); + this.$lines.splice(row, 1, newLine); + + var delta = { + action: "removeText", + range: range, + text: removed + }; + this._signal("change", { data: delta }); + return range.start; + }; + this.removeLines = function(firstRow, lastRow) { + if (firstRow < 0 || lastRow >= this.getLength()) + return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); + return this._removeLines(firstRow, lastRow); + }; + + this._removeLines = function(firstRow, lastRow) { + var range = new Range(firstRow, 0, lastRow + 1, 0); + var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); + + var delta = { + action: "removeLines", + range: range, + nl: this.getNewLineCharacter(), + lines: removed + }; + this._signal("change", { data: delta }); + return removed; + }; + this.removeNewLine = function(row) { + var firstLine = this.getLine(row); + var secondLine = this.getLine(row+1); + + var range = new Range(row, firstLine.length, row+1, 0); + var line = firstLine + secondLine; + + this.$lines.splice(row, 2, line); + + var delta = { + action: "removeText", + range: range, + text: this.getNewLineCharacter() + }; + this._signal("change", { data: delta }); + }; + this.replace = function(range, text) { + if (!(range instanceof Range)) + range = Range.fromPoints(range.start, range.end); + if (text.length == 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + if (text) { + var end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function(deltas) { + for (var i=0; i=0; i--) { + var delta = deltas[i]; + + var range = Range.fromPoints(delta.range.start, delta.range.end); + + if (delta.action == "insertLines") + this._removeLines(range.start.row, range.end.row - 1); + else if (delta.action == "insertText") + this.remove(range); + else if (delta.action == "removeLines") + this._insertLines(range.start.row, delta.lines); + else if (delta.action == "removeText") + this.insert(range.start, delta.text); + } + }; + this.indexToPosition = function(index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l-1, column: lines[l-1].length}; + }; + this.positionToIndex = function(pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + + }).call(Document.prototype); + + exports.Document = Document; + }); + + ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + + var BackgroundTokenizer = function(tokenizer, editor) { + this.running = false; + this.lines = []; + this.states = []; + this.currentLine = 0; + this.tokenizer = tokenizer; + + var self = this; + + this.$worker = function() { + if (!self.running) { return; } + + var workerStart = new Date(); + var currentLine = self.currentLine; + var endLine = -1; + var doc = self.doc; + + while (self.lines[currentLine]) + currentLine++; + + var startLine = currentLine; + + var len = doc.getLength(); + var processedLines = 0; + self.running = false; + while (currentLine < len) { + self.$tokenizeRow(currentLine); + endLine = currentLine; + do { + currentLine++; + } while (self.lines[currentLine]); + processedLines ++; + if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) { + self.running = setTimeout(self.$worker, 20); + break; + } + } + self.currentLine = currentLine; + + if (startLine <= endLine) + self.fireUpdateEvent(startLine, endLine); + }; + }; + + (function(){ + + oop.implement(this, EventEmitter); + this.setTokenizer = function(tokenizer) { + this.tokenizer = tokenizer; + this.lines = []; + this.states = []; + + this.start(0); + }; + this.setDocument = function(doc) { + this.doc = doc; + this.lines = []; + this.states = []; + + this.stop(); + }; + this.fireUpdateEvent = function(firstRow, lastRow) { + var data = { + first: firstRow, + last: lastRow + }; + this._signal("update", {data: data}); + }; + this.start = function(startRow) { + this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength()); + this.lines.splice(this.currentLine, this.lines.length); + this.states.splice(this.currentLine, this.states.length); + + this.stop(); + this.running = setTimeout(this.$worker, 700); + }; + + this.scheduleStart = function() { + if (!this.running) + this.running = setTimeout(this.$worker, 700); + } + + this.$updateOnChange = function(delta) { + var range = delta.range; + var startRow = range.start.row; + var len = range.end.row - startRow; + + if (len === 0) { + this.lines[startRow] = null; + } else if (delta.action == "removeText" || delta.action == "removeLines") { + this.lines.splice(startRow, len + 1, null); + this.states.splice(startRow, len + 1, null); + } else { + var args = Array(len + 1); + args.unshift(startRow, 1); + this.lines.splice.apply(this.lines, args); + this.states.splice.apply(this.states, args); + } + + this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength()); + + this.stop(); + }; + this.stop = function() { + if (this.running) + clearTimeout(this.running); + this.running = false; + }; + this.getTokens = function(row) { + return this.lines[row] || this.$tokenizeRow(row); + }; + this.getState = function(row) { + if (this.currentLine == row) + this.$tokenizeRow(row); + return this.states[row] || "start"; + }; + + this.$tokenizeRow = function(row) { + var line = this.doc.getLine(row); + var state = this.states[row - 1]; + + var data = this.tokenizer.getLineTokens(line, state, row); + + if (this.states[row] + "" !== data.state + "") { + this.states[row] = data.state; + this.lines[row + 1] = null; + if (this.currentLine > row + 1) + this.currentLine = row + 1; + } else if (this.currentLine == row) { + this.currentLine = row + 1; + } + + return this.lines[row] = data.tokens; + }; + + }).call(BackgroundTokenizer.prototype); + + exports.BackgroundTokenizer = BackgroundTokenizer; + }); + + ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(acequire, exports, module) { + "use strict"; + + var lang = acequire("./lib/lang"); + var oop = acequire("./lib/oop"); + var Range = acequire("./range").Range; + + var SearchHighlight = function(regExp, clazz, type) { + this.setRegexp(regExp); + this.clazz = clazz; + this.type = type || "text"; + }; + + (function() { + this.MAX_RANGES = 500; + + this.setRegexp = function(regExp) { + if (this.regExp+"" == regExp+"") + return; + this.regExp = regExp; + this.cache = []; + }; + + this.update = function(html, markerLayer, session, config) { + if (!this.regExp) + return; + var start = config.firstRow, end = config.lastRow; + + for (var i = start; i <= end; i++) { + var ranges = this.cache[i]; + if (ranges == null) { + ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); + if (ranges.length > this.MAX_RANGES) + ranges = ranges.slice(0, this.MAX_RANGES); + ranges = ranges.map(function(match) { + return new Range(i, match.offset, i, match.offset + match.length); + }); + this.cache[i] = ranges.length ? ranges : ""; + } + + for (var j = ranges.length; j --; ) { + markerLayer.drawSingleLineMarker( + html, ranges[j].toScreenRange(session), this.clazz, config); + } + } + }; + + }).call(SearchHighlight.prototype); + + exports.SearchHighlight = SearchHighlight; + }); + + ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"], function(acequire, exports, module) { + "use strict"; + + var Range = acequire("../range").Range; + function FoldLine(foldData, folds) { + this.foldData = foldData; + if (Array.isArray(folds)) { + this.folds = folds; + } else { + folds = this.folds = [ folds ]; + } + + var last = folds[folds.length - 1]; + this.range = new Range(folds[0].start.row, folds[0].start.column, + last.end.row, last.end.column); + this.start = this.range.start; + this.end = this.range.end; + + this.folds.forEach(function(fold) { + fold.setFoldLine(this); + }, this); + } + + (function() { + this.shiftRow = function(shift) { + this.start.row += shift; + this.end.row += shift; + this.folds.forEach(function(fold) { + fold.start.row += shift; + fold.end.row += shift; + }); + }; + + this.addFold = function(fold) { + if (fold.sameRow) { + if (fold.start.row < this.startRow || fold.endRow > this.endRow) { + throw new Error("Can't add a fold to this FoldLine as it has no connection"); + } + this.folds.push(fold); + this.folds.sort(function(a, b) { + return -a.range.compareEnd(b.start.row, b.start.column); + }); + if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) { + this.end.row = fold.end.row; + this.end.column = fold.end.column; + } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { + this.start.row = fold.start.row; + this.start.column = fold.start.column; + } + } else if (fold.start.row == this.end.row) { + this.folds.push(fold); + this.end.row = fold.end.row; + this.end.column = fold.end.column; + } else if (fold.end.row == this.start.row) { + this.folds.unshift(fold); + this.start.row = fold.start.row; + this.start.column = fold.start.column; + } else { + throw new Error("Trying to add fold to FoldRow that doesn't have a matching row"); + } + fold.foldLine = this; + }; + + this.containsRow = function(row) { + return row >= this.start.row && row <= this.end.row; + }; + + this.walk = function(callback, endRow, endColumn) { + var lastEnd = 0, + folds = this.folds, + fold, + cmp, stop, isNewRow = true; + + if (endRow == null) { + endRow = this.end.row; + endColumn = this.end.column; + } + + for (var i = 0; i < folds.length; i++) { + fold = folds[i]; + + cmp = fold.range.compareStart(endRow, endColumn); + if (cmp == -1) { + callback(null, endRow, endColumn, lastEnd, isNewRow); + return; + } + + stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow); + stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd); + if (stop || cmp === 0) { + return; + } + isNewRow = !fold.sameRow; + lastEnd = fold.end.column; + } + callback(null, endRow, endColumn, lastEnd, isNewRow); + }; + + this.getNextFoldTo = function(row, column) { + var fold, cmp; + for (var i = 0; i < this.folds.length; i++) { + fold = this.folds[i]; + cmp = fold.range.compareEnd(row, column); + if (cmp == -1) { + return { + fold: fold, + kind: "after" + }; + } else if (cmp === 0) { + return { + fold: fold, + kind: "inside" + }; + } + } + return null; + }; + + this.addRemoveChars = function(row, column, len) { + var ret = this.getNextFoldTo(row, column), + fold, folds; + if (ret) { + fold = ret.fold; + if (ret.kind == "inside" + && fold.start.column != column + && fold.start.row != row) + { + window.console && window.console.log(row, column, fold); + } else if (fold.start.row == row) { + folds = this.folds; + var i = folds.indexOf(fold); + if (i === 0) { + this.start.column += len; + } + for (i; i < folds.length; i++) { + fold = folds[i]; + fold.start.column += len; + if (!fold.sameRow) { + return; + } + fold.end.column += len; + } + this.end.column += len; + } + } + }; + + this.split = function(row, column) { + var pos = this.getNextFoldTo(row, column); + + if (!pos || pos.kind == "inside") + return null; + + var fold = pos.fold; + var folds = this.folds; + var foldData = this.foldData; + + var i = folds.indexOf(fold); + var foldBefore = folds[i - 1]; + this.end.row = foldBefore.end.row; + this.end.column = foldBefore.end.column; + folds = folds.splice(i, folds.length - i); + + var newFoldLine = new FoldLine(foldData, folds); + foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); + return newFoldLine; + }; + + this.merge = function(foldLineNext) { + var folds = foldLineNext.folds; + for (var i = 0; i < folds.length; i++) { + this.addFold(folds[i]); + } + var foldData = this.foldData; + foldData.splice(foldData.indexOf(foldLineNext), 1); + }; + + this.toString = function() { + var ret = [this.range.toString() + ": [" ]; + + this.folds.forEach(function(fold) { + ret.push(" " + fold.toString()); + }); + ret.push("]"); + return ret.join("\n"); + }; + + this.idxToPosition = function(idx) { + var lastFoldEndColumn = 0; + + for (var i = 0; i < this.folds.length; i++) { + var fold = this.folds[i]; + + idx -= fold.start.column - lastFoldEndColumn; + if (idx < 0) { + return { + row: fold.start.row, + column: fold.start.column + idx + }; + } + + idx -= fold.placeholder.length; + if (idx < 0) { + return fold.start; + } + + lastFoldEndColumn = fold.end.column; + } + + return { + row: this.end.row, + column: this.end.column + idx + }; + }; + }).call(FoldLine.prototype); + + exports.FoldLine = FoldLine; + }); + + ace.define("ace/range_list",["require","exports","module","ace/range"], function(acequire, exports, module) { + "use strict"; + var Range = acequire("./range").Range; + var comparePoints = Range.comparePoints; + + var RangeList = function() { + this.ranges = []; + }; + + (function() { + this.comparePoints = comparePoints; + + this.pointIndex = function(pos, excludeEdges, startIndex) { + var list = this.ranges; + + for (var i = startIndex || 0; i < list.length; i++) { + var range = list[i]; + var cmpEnd = comparePoints(pos, range.end); + if (cmpEnd > 0) + continue; + var cmpStart = comparePoints(pos, range.start); + if (cmpEnd === 0) + return excludeEdges && cmpStart !== 0 ? -i-2 : i; + if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges)) + return i; + + return -i-1; + } + return -i - 1; + }; + + this.add = function(range) { + var excludeEdges = !range.isEmpty(); + var startIndex = this.pointIndex(range.start, excludeEdges); + if (startIndex < 0) + startIndex = -startIndex - 1; + + var endIndex = this.pointIndex(range.end, excludeEdges, startIndex); + + if (endIndex < 0) + endIndex = -endIndex - 1; + else + endIndex++; + return this.ranges.splice(startIndex, endIndex - startIndex, range); + }; + + this.addList = function(list) { + var removed = []; + for (var i = list.length; i--; ) { + removed.push.call(removed, this.add(list[i])); + } + return removed; + }; + + this.substractPoint = function(pos) { + var i = this.pointIndex(pos); + + if (i >= 0) + return this.ranges.splice(i, 1); + }; + this.merge = function() { + var removed = []; + var list = this.ranges; + + list = list.sort(function(a, b) { + return comparePoints(a.start, b.start); + }); + + var next = list[0], range; + for (var i = 1; i < list.length; i++) { + range = next; + next = list[i]; + var cmp = comparePoints(range.end, next.start); + if (cmp < 0) + continue; + + if (cmp == 0 && !range.isEmpty() && !next.isEmpty()) + continue; + + if (comparePoints(range.end, next.end) < 0) { + range.end.row = next.end.row; + range.end.column = next.end.column; + } + + list.splice(i, 1); + removed.push(next); + next = range; + i--; + } + + this.ranges = list; + + return removed; + }; + + this.contains = function(row, column) { + return this.pointIndex({row: row, column: column}) >= 0; + }; + + this.containsPoint = function(pos) { + return this.pointIndex(pos) >= 0; + }; + + this.rangeAtPoint = function(pos) { + var i = this.pointIndex(pos); + if (i >= 0) + return this.ranges[i]; + }; + + + this.clipRows = function(startRow, endRow) { + var list = this.ranges; + if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow) + return []; + + var startIndex = this.pointIndex({row: startRow, column: 0}); + if (startIndex < 0) + startIndex = -startIndex - 1; + var endIndex = this.pointIndex({row: endRow, column: 0}, startIndex); + if (endIndex < 0) + endIndex = -endIndex - 1; + + var clipped = []; + for (var i = startIndex; i < endIndex; i++) { + clipped.push(list[i]); + } + return clipped; + }; + + this.removeAll = function() { + return this.ranges.splice(0, this.ranges.length); + }; + + this.attach = function(session) { + if (this.session) + this.detach(); + + this.session = session; + this.onChange = this.$onChange.bind(this); + + this.session.on('change', this.onChange); + }; + + this.detach = function() { + if (!this.session) + return; + this.session.removeListener('change', this.onChange); + this.session = null; + }; + + this.$onChange = function(e) { + var changeRange = e.data.range; + if (e.data.action[0] == "i"){ + var start = changeRange.start; + var end = changeRange.end; + } else { + var end = changeRange.start; + var start = changeRange.end; + } + var startRow = start.row; + var endRow = end.row; + var lineDif = endRow - startRow; + + var colDiff = -start.column + end.column; + var ranges = this.ranges; + + for (var i = 0, n = ranges.length; i < n; i++) { + var r = ranges[i]; + if (r.end.row < startRow) + continue; + if (r.start.row > startRow) + break; + + if (r.start.row == startRow && r.start.column >= start.column ) { + if (r.start.column == start.column && this.$insertRight) { + } else { + r.start.column += colDiff; + r.start.row += lineDif; + } + } + if (r.end.row == startRow && r.end.column >= start.column) { + if (r.end.column == start.column && this.$insertRight) { + continue; + } + if (r.end.column == start.column && colDiff > 0 && i < n - 1) { + if (r.end.column > r.start.column && r.end.column == ranges[i+1].start.column) + r.end.column -= colDiff; + } + r.end.column += colDiff; + r.end.row += lineDif; + } + } + + if (lineDif != 0 && i < n) { + for (; i < n; i++) { + var r = ranges[i]; + r.start.row += lineDif; + r.end.row += lineDif; + } + } + }; + + }).call(RangeList.prototype); + + exports.RangeList = RangeList; + }); + + ace.define("ace/edit_session/fold",["require","exports","module","ace/range","ace/range_list","ace/lib/oop"], function(acequire, exports, module) { + "use strict"; + + var Range = acequire("../range").Range; + var RangeList = acequire("../range_list").RangeList; + var oop = acequire("../lib/oop") + var Fold = exports.Fold = function(range, placeholder) { + this.foldLine = null; + this.placeholder = placeholder; + this.range = range; + this.start = range.start; + this.end = range.end; + + this.sameRow = range.start.row == range.end.row; + this.subFolds = this.ranges = []; + }; + + oop.inherits(Fold, RangeList); + + (function() { + + this.toString = function() { + return '"' + this.placeholder + '" ' + this.range.toString(); + }; + + this.setFoldLine = function(foldLine) { + this.foldLine = foldLine; + this.subFolds.forEach(function(fold) { + fold.setFoldLine(foldLine); + }); + }; + + this.clone = function() { + var range = this.range.clone(); + var fold = new Fold(range, this.placeholder); + this.subFolds.forEach(function(subFold) { + fold.subFolds.push(subFold.clone()); + }); + fold.collapseChildren = this.collapseChildren; + return fold; + }; + + this.addSubFold = function(fold) { + if (this.range.isEqual(fold)) + return; + + if (!this.range.containsRange(fold)) + throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + consumeRange(fold, this.start); + + var row = fold.start.row, column = fold.start.column; + for (var i = 0, cmp = -1; i < this.subFolds.length; i++) { + cmp = this.subFolds[i].range.compare(row, column); + if (cmp != 1) + break; + } + var afterStart = this.subFolds[i]; + + if (cmp == 0) + return afterStart.addSubFold(fold); + var row = fold.range.end.row, column = fold.range.end.column; + for (var j = i, cmp = -1; j < this.subFolds.length; j++) { + cmp = this.subFolds[j].range.compare(row, column); + if (cmp != 1) + break; + } + var afterEnd = this.subFolds[j]; + + if (cmp == 0) + throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + + var consumedFolds = this.subFolds.splice(i, j - i, fold); + fold.setFoldLine(this.foldLine); + + return fold; + }; + + this.restoreRange = function(range) { + return restoreRange(range, this.start); + }; + + }).call(Fold.prototype); + + function consumePoint(point, anchor) { + point.row -= anchor.row; + if (point.row == 0) + point.column -= anchor.column; + } + function consumeRange(range, anchor) { + consumePoint(range.start, anchor); + consumePoint(range.end, anchor); + } + function restorePoint(point, anchor) { + if (point.row == 0) + point.column += anchor.column; + point.row += anchor.row; + } + function restoreRange(range, anchor) { + restorePoint(range.start, anchor); + restorePoint(range.end, anchor); + } + + }); + + ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"], function(acequire, exports, module) { + "use strict"; + + var Range = acequire("../range").Range; + var FoldLine = acequire("./fold_line").FoldLine; + var Fold = acequire("./fold").Fold; + var TokenIterator = acequire("../token_iterator").TokenIterator; + + function Folding() { + this.getFoldAt = function(row, column, side) { + var foldLine = this.getFoldLine(row); + if (!foldLine) + return null; + + var folds = foldLine.folds; + for (var i = 0; i < folds.length; i++) { + var fold = folds[i]; + if (fold.range.contains(row, column)) { + if (side == 1 && fold.range.isEnd(row, column)) { + continue; + } else if (side == -1 && fold.range.isStart(row, column)) { + continue; + } + return fold; + } + } + }; + this.getFoldsInRange = function(range) { + var start = range.start; + var end = range.end; + var foldLines = this.$foldData; + var foundFolds = []; + + start.column += 1; + end.column -= 1; + + for (var i = 0; i < foldLines.length; i++) { + var cmp = foldLines[i].range.compareRange(range); + if (cmp == 2) { + continue; + } + else if (cmp == -2) { + break; + } + + var folds = foldLines[i].folds; + for (var j = 0; j < folds.length; j++) { + var fold = folds[j]; + cmp = fold.range.compareRange(range); + if (cmp == -2) { + break; + } else if (cmp == 2) { + continue; + } else + if (cmp == 42) { + break; + } + foundFolds.push(fold); + } + } + start.column -= 1; + end.column += 1; + + return foundFolds; + }; + + this.getFoldsInRangeList = function(ranges) { + if (Array.isArray(ranges)) { + var folds = []; + ranges.forEach(function(range) { + folds = folds.concat(this.getFoldsInRange(range)); + }, this); + } else { + var folds = this.getFoldsInRange(ranges); + } + return folds; + } + this.getAllFolds = function() { + var folds = []; + var foldLines = this.$foldData; + + for (var i = 0; i < foldLines.length; i++) + for (var j = 0; j < foldLines[i].folds.length; j++) + folds.push(foldLines[i].folds[j]); + + return folds; + }; + this.getFoldStringAt = function(row, column, trim, foldLine) { + foldLine = foldLine || this.getFoldLine(row); + if (!foldLine) + return null; + + var lastFold = { + end: { column: 0 } + }; + var str, fold; + for (var i = 0; i < foldLine.folds.length; i++) { + fold = foldLine.folds[i]; + var cmp = fold.range.compareEnd(row, column); + if (cmp == -1) { + str = this + .getLine(fold.start.row) + .substring(lastFold.end.column, fold.start.column); + break; + } + else if (cmp === 0) { + return null; + } + lastFold = fold; + } + if (!str) + str = this.getLine(fold.start.row).substring(lastFold.end.column); + + if (trim == -1) + return str.substring(0, column - lastFold.end.column); + else if (trim == 1) + return str.substring(column - lastFold.end.column); + else + return str; + }; + + this.getFoldLine = function(docRow, startFoldLine) { + var foldData = this.$foldData; + var i = 0; + if (startFoldLine) + i = foldData.indexOf(startFoldLine); + if (i == -1) + i = 0; + for (i; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) { + return foldLine; + } else if (foldLine.end.row > docRow) { + return null; + } + } + return null; + }; + this.getNextFoldLine = function(docRow, startFoldLine) { + var foldData = this.$foldData; + var i = 0; + if (startFoldLine) + i = foldData.indexOf(startFoldLine); + if (i == -1) + i = 0; + for (i; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (foldLine.end.row >= docRow) { + return foldLine; + } + } + return null; + }; + + this.getFoldedRowCount = function(first, last) { + var foldData = this.$foldData, rowCount = last-first+1; + for (var i = 0; i < foldData.length; i++) { + var foldLine = foldData[i], + end = foldLine.end.row, + start = foldLine.start.row; + if (end >= last) { + if(start < last) { + if(start >= first) + rowCount -= last-start; + else + rowCount = 0;//in one fold + } + break; + } else if(end >= first){ + if (start >= first) //fold inside range + rowCount -= end-start; + else + rowCount -= end-first+1; + } + } + return rowCount; + }; + + this.$addFoldLine = function(foldLine) { + this.$foldData.push(foldLine); + this.$foldData.sort(function(a, b) { + return a.start.row - b.start.row; + }); + return foldLine; + }; + this.addFold = function(placeholder, range) { + var foldData = this.$foldData; + var added = false; + var fold; + + if (placeholder instanceof Fold) + fold = placeholder; + else { + fold = new Fold(range, placeholder); + fold.collapseChildren = range.collapseChildren; + } + this.$clipRangeToDocument(fold.range); + + var startRow = fold.start.row; + var startColumn = fold.start.column; + var endRow = fold.end.row; + var endColumn = fold.end.column; + if (!(startRow < endRow || + startRow == endRow && startColumn <= endColumn - 2)) + throw new Error("The range has to be at least 2 characters width"); + + var startFold = this.getFoldAt(startRow, startColumn, 1); + var endFold = this.getFoldAt(endRow, endColumn, -1); + if (startFold && endFold == startFold) + return startFold.addSubFold(fold); + + if (startFold && !startFold.range.isStart(startRow, startColumn)) + this.removeFold(startFold); + + if (endFold && !endFold.range.isEnd(endRow, endColumn)) + this.removeFold(endFold); + var folds = this.getFoldsInRange(fold.range); + if (folds.length > 0) { + this.removeFolds(folds); + folds.forEach(function(subFold) { + fold.addSubFold(subFold); + }); + } + + for (var i = 0; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (endRow == foldLine.start.row) { + foldLine.addFold(fold); + added = true; + break; + } else if (startRow == foldLine.end.row) { + foldLine.addFold(fold); + added = true; + if (!fold.sameRow) { + var foldLineNext = foldData[i + 1]; + if (foldLineNext && foldLineNext.start.row == endRow) { + foldLine.merge(foldLineNext); + break; + } + } + break; + } else if (endRow <= foldLine.start.row) { + break; + } + } + + if (!added) + foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold)); + + if (this.$useWrapMode) + this.$updateWrapData(foldLine.start.row, foldLine.start.row); + else + this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row); + this.$modified = true; + this._emit("changeFold", { data: fold, action: "add" }); + + return fold; + }; + + this.addFolds = function(folds) { + folds.forEach(function(fold) { + this.addFold(fold); + }, this); + }; + + this.removeFold = function(fold) { + var foldLine = fold.foldLine; + var startRow = foldLine.start.row; + var endRow = foldLine.end.row; + + var foldLines = this.$foldData; + var folds = foldLine.folds; + if (folds.length == 1) { + foldLines.splice(foldLines.indexOf(foldLine), 1); + } else + if (foldLine.range.isEnd(fold.end.row, fold.end.column)) { + folds.pop(); + foldLine.end.row = folds[folds.length - 1].end.row; + foldLine.end.column = folds[folds.length - 1].end.column; + } else + if (foldLine.range.isStart(fold.start.row, fold.start.column)) { + folds.shift(); + foldLine.start.row = folds[0].start.row; + foldLine.start.column = folds[0].start.column; + } else + if (fold.sameRow) { + folds.splice(folds.indexOf(fold), 1); + } else + { + var newFoldLine = foldLine.split(fold.start.row, fold.start.column); + folds = newFoldLine.folds; + folds.shift(); + newFoldLine.start.row = folds[0].start.row; + newFoldLine.start.column = folds[0].start.column; + } + + if (!this.$updating) { + if (this.$useWrapMode) + this.$updateWrapData(startRow, endRow); + else + this.$updateRowLengthCache(startRow, endRow); + } + this.$modified = true; + this._emit("changeFold", { data: fold, action: "remove" }); + }; + + this.removeFolds = function(folds) { + var cloneFolds = []; + for (var i = 0; i < folds.length; i++) { + cloneFolds.push(folds[i]); + } + + cloneFolds.forEach(function(fold) { + this.removeFold(fold); + }, this); + this.$modified = true; + }; + + this.expandFold = function(fold) { + this.removeFold(fold); + fold.subFolds.forEach(function(subFold) { + fold.restoreRange(subFold); + this.addFold(subFold); + }, this); + if (fold.collapseChildren > 0) { + this.foldAll(fold.start.row+1, fold.end.row, fold.collapseChildren-1); + } + fold.subFolds = []; + }; + + this.expandFolds = function(folds) { + folds.forEach(function(fold) { + this.expandFold(fold); + }, this); + }; + + this.unfold = function(location, expandInner) { + var range, folds; + if (location == null) { + range = new Range(0, 0, this.getLength(), 0); + expandInner = true; + } else if (typeof location == "number") + range = new Range(location, 0, location, this.getLine(location).length); + else if ("row" in location) + range = Range.fromPoints(location, location); + else + range = location; + + folds = this.getFoldsInRangeList(range); + if (expandInner) { + this.removeFolds(folds); + } else { + var subFolds = folds; + while (subFolds.length) { + this.expandFolds(subFolds); + subFolds = this.getFoldsInRangeList(range); + } + } + if (folds.length) + return folds; + }; + this.isRowFolded = function(docRow, startFoldRow) { + return !!this.getFoldLine(docRow, startFoldRow); + }; + + this.getRowFoldEnd = function(docRow, startFoldRow) { + var foldLine = this.getFoldLine(docRow, startFoldRow); + return foldLine ? foldLine.end.row : docRow; + }; + + this.getRowFoldStart = function(docRow, startFoldRow) { + var foldLine = this.getFoldLine(docRow, startFoldRow); + return foldLine ? foldLine.start.row : docRow; + }; + + this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { + if (startRow == null) + startRow = foldLine.start.row; + if (startColumn == null) + startColumn = 0; + if (endRow == null) + endRow = foldLine.end.row; + if (endColumn == null) + endColumn = this.getLine(endRow).length; + var doc = this.doc; + var textLine = ""; + + foldLine.walk(function(placeholder, row, column, lastColumn) { + if (row < startRow) + return; + if (row == startRow) { + if (column < startColumn) + return; + lastColumn = Math.max(startColumn, lastColumn); + } + + if (placeholder != null) { + textLine += placeholder; + } else { + textLine += doc.getLine(row).substring(lastColumn, column); + } + }, endRow, endColumn); + return textLine; + }; + + this.getDisplayLine = function(row, endColumn, startRow, startColumn) { + var foldLine = this.getFoldLine(row); + + if (!foldLine) { + var line; + line = this.doc.getLine(row); + return line.substring(startColumn || 0, endColumn || line.length); + } else { + return this.getFoldDisplayLine( + foldLine, row, endColumn, startRow, startColumn); + } + }; + + this.$cloneFoldData = function() { + var fd = []; + fd = this.$foldData.map(function(foldLine) { + var folds = foldLine.folds.map(function(fold) { + return fold.clone(); + }); + return new FoldLine(fd, folds); + }); + + return fd; + }; + + this.toggleFold = function(tryToUnfold) { + var selection = this.selection; + var range = selection.getRange(); + var fold; + var bracketPos; + + if (range.isEmpty()) { + var cursor = range.start; + fold = this.getFoldAt(cursor.row, cursor.column); + + if (fold) { + this.expandFold(fold); + return; + } else if (bracketPos = this.findMatchingBracket(cursor)) { + if (range.comparePoint(bracketPos) == 1) { + range.end = bracketPos; + } else { + range.start = bracketPos; + range.start.column++; + range.end.column--; + } + } else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) { + if (range.comparePoint(bracketPos) == 1) + range.end = bracketPos; + else + range.start = bracketPos; + + range.start.column++; + } else { + range = this.getCommentFoldRange(cursor.row, cursor.column) || range; + } + } else { + var folds = this.getFoldsInRange(range); + if (tryToUnfold && folds.length) { + this.expandFolds(folds); + return; + } else if (folds.length == 1 ) { + fold = folds[0]; + } + } + + if (!fold) + fold = this.getFoldAt(range.start.row, range.start.column); + + if (fold && fold.range.toString() == range.toString()) { + this.expandFold(fold); + return; + } + + var placeholder = "..."; + if (!range.isMultiLine()) { + placeholder = this.getTextRange(range); + if(placeholder.length < 4) + return; + placeholder = placeholder.trim().substring(0, 2) + ".."; + } + + this.addFold(placeholder, range); + }; + + this.getCommentFoldRange = function(row, column, dir) { + var iterator = new TokenIterator(this, row, column); + var token = iterator.getCurrentToken(); + if (token && /^comment|string/.test(token.type)) { + var range = new Range(); + var re = new RegExp(token.type.replace(/\..*/, "\\.")); + if (dir != 1) { + do { + token = iterator.stepBackward(); + } while(token && re.test(token.type)); + iterator.stepForward(); + } + + range.start.row = iterator.getCurrentTokenRow(); + range.start.column = iterator.getCurrentTokenColumn() + 2; + + iterator = new TokenIterator(this, row, column); + + if (dir != -1) { + do { + token = iterator.stepForward(); + } while(token && re.test(token.type)); + token = iterator.stepBackward(); + } else + token = iterator.getCurrentToken(); + + range.end.row = iterator.getCurrentTokenRow(); + range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 2; + return range; + } + }; + + this.foldAll = function(startRow, endRow, depth) { + if (depth == undefined) + depth = 100000; // JSON.stringify doesn't hanle Infinity + var foldWidgets = this.foldWidgets; + if (!foldWidgets) + return; // mode doesn't support folding + endRow = endRow || this.getLength(); + startRow = startRow || 0; + for (var row = startRow; row < endRow; row++) { + if (foldWidgets[row] == null) + foldWidgets[row] = this.getFoldWidget(row); + if (foldWidgets[row] != "start") + continue; + + var range = this.getFoldWidgetRange(row); + if (range && range.isMultiLine() + && range.end.row <= endRow + && range.start.row >= startRow + ) { + row = range.end.row; + try { + var fold = this.addFold("...", range); + if (fold) + fold.collapseChildren = depth; + } catch(e) {} + } + } + }; + this.$foldStyles = { + "manual": 1, + "markbegin": 1, + "markbeginend": 1 + }; + this.$foldStyle = "markbegin"; + this.setFoldStyle = function(style) { + if (!this.$foldStyles[style]) + throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]"); + + if (this.$foldStyle == style) + return; + + this.$foldStyle = style; + + if (style == "manual") + this.unfold(); + var mode = this.$foldMode; + this.$setFolding(null); + this.$setFolding(mode); + }; + + this.$setFolding = function(foldMode) { + if (this.$foldMode == foldMode) + return; + + this.$foldMode = foldMode; + + this.off('change', this.$updateFoldWidgets); + this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); + this._emit("changeAnnotation"); + + if (!foldMode || this.$foldStyle == "manual") { + this.foldWidgets = null; + return; + } + + this.foldWidgets = []; + this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle); + this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle); + + this.$updateFoldWidgets = this.updateFoldWidgets.bind(this); + this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this); + this.on('change', this.$updateFoldWidgets); + this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); + }; + + this.getParentFoldRangeData = function (row, ignoreCurrent) { + var fw = this.foldWidgets; + if (!fw || (ignoreCurrent && fw[row])) + return {}; + + var i = row - 1, firstRange; + while (i >= 0) { + var c = fw[i]; + if (c == null) + c = fw[i] = this.getFoldWidget(i); + + if (c == "start") { + var range = this.getFoldWidgetRange(i); + if (!firstRange) + firstRange = range; + if (range && range.end.row >= row) + break; + } + i--; + } + + return { + range: i !== -1 && range, + firstRange: firstRange + }; + } + + this.onFoldWidgetClick = function(row, e) { + e = e.domEvent; + var options = { + children: e.shiftKey, + all: e.ctrlKey || e.metaKey, + siblings: e.altKey + }; + + var range = this.$toggleFoldWidget(row, options); + if (!range) { + var el = (e.target || e.srcElement) + if (el && /ace_fold-widget/.test(el.className)) + el.className += " ace_invalid"; + } + }; + + this.$toggleFoldWidget = function(row, options) { + if (!this.getFoldWidget) + return; + var type = this.getFoldWidget(row); + var line = this.getLine(row); + + var dir = type === "end" ? -1 : 1; + var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir); + + if (fold) { + if (options.children || options.all) + this.removeFold(fold); + else + this.expandFold(fold); + return; + } + + var range = this.getFoldWidgetRange(row, true); + if (range && !range.isMultiLine()) { + fold = this.getFoldAt(range.start.row, range.start.column, 1); + if (fold && range.isEqual(fold.range)) { + this.removeFold(fold); + return; + } + } + + if (options.siblings) { + var data = this.getParentFoldRangeData(row); + if (data.range) { + var startRow = data.range.start.row + 1; + var endRow = data.range.end.row; + } + this.foldAll(startRow, endRow, options.all ? 10000 : 0); + } else if (options.children) { + endRow = range ? range.end.row : this.getLength(); + this.foldAll(row + 1, endRow, options.all ? 10000 : 0); + } else if (range) { + if (options.all) + range.collapseChildren = 10000; + this.addFold("...", range); + } + + return range; + }; + + + + this.toggleFoldWidget = function(toggleParent) { + var row = this.selection.getCursor().row; + row = this.getRowFoldStart(row); + var range = this.$toggleFoldWidget(row, {}); + + if (range) + return; + var data = this.getParentFoldRangeData(row, true); + range = data.range || data.firstRange; + + if (range) { + row = range.start.row; + var fold = this.getFoldAt(row, this.getLine(row).length, 1); + + if (fold) { + this.removeFold(fold); + } else { + this.addFold("...", range); + } + } + }; + + this.updateFoldWidgets = function(e) { + var delta = e.data; + var range = delta.range; + var firstRow = range.start.row; + var len = range.end.row - firstRow; + + if (len === 0) { + this.foldWidgets[firstRow] = null; + } else if (delta.action == "removeText" || delta.action == "removeLines") { + this.foldWidgets.splice(firstRow, len + 1, null); + } else { + var args = Array(len + 1); + args.unshift(firstRow, 1); + this.foldWidgets.splice.apply(this.foldWidgets, args); + } + }; + this.tokenizerUpdateFoldWidgets = function(e) { + var rows = e.data; + if (rows.first != rows.last) { + if (this.foldWidgets.length > rows.first) + this.foldWidgets.splice(rows.first, this.foldWidgets.length); + } + } + } + + exports.Folding = Folding; + + }); + + ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"], function(acequire, exports, module) { + "use strict"; + + var TokenIterator = acequire("../token_iterator").TokenIterator; + var Range = acequire("../range").Range; + + + function BracketMatch() { + + this.findMatchingBracket = function(position, chr) { + if (position.column == 0) return null; + + var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column-1); + if (charBeforeCursor == "") return null; + + var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); + if (!match) + return null; + + if (match[1]) + return this.$findClosingBracket(match[1], position); + else + return this.$findOpeningBracket(match[2], position); + }; + + this.getBracketRange = function(pos) { + var line = this.getLine(pos.row); + var before = true, range; + + var chr = line.charAt(pos.column-1); + var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + if (!match) { + chr = line.charAt(pos.column); + pos = {row: pos.row, column: pos.column + 1}; + match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + before = false; + } + if (!match) + return null; + + if (match[1]) { + var bracketPos = this.$findClosingBracket(match[1], pos); + if (!bracketPos) + return null; + range = Range.fromPoints(pos, bracketPos); + if (!before) { + range.end.column++; + range.start.column--; + } + range.cursor = range.end; + } else { + var bracketPos = this.$findOpeningBracket(match[2], pos); + if (!bracketPos) + return null; + range = Range.fromPoints(bracketPos, pos); + if (!before) { + range.start.column++; + range.end.column--; + } + range.cursor = range.start; + } + + return range; + }; + + this.$brackets = { + ")": "(", + "(": ")", + "]": "[", + "[": "]", + "{": "}", + "}": "{" + }; + + this.$findOpeningBracket = function(bracket, position, typeRe) { + var openBracket = this.$brackets[bracket]; + var depth = 1; + + var iterator = new TokenIterator(this, position.row, position.column); + var token = iterator.getCurrentToken(); + if (!token) + token = iterator.stepForward(); + if (!token) + return; + + if (!typeRe){ + typeRe = new RegExp( + "(\\.?" + + token.type.replace(".", "\\.").replace("rparen", ".paren") + .replace(/\b(?:end|start|begin)\b/, "") + + ")+" + ); + } + var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2; + var value = token.value; + + while (true) { + + while (valueIndex >= 0) { + var chr = value.charAt(valueIndex); + if (chr == openBracket) { + depth -= 1; + if (depth == 0) { + return {row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn()}; + } + } + else if (chr == bracket) { + depth += 1; + } + valueIndex -= 1; + } + do { + token = iterator.stepBackward(); + } while (token && !typeRe.test(token.type)); + + if (token == null) + break; + + value = token.value; + valueIndex = value.length - 1; + } + + return null; + }; + + this.$findClosingBracket = function(bracket, position, typeRe) { + var closingBracket = this.$brackets[bracket]; + var depth = 1; + + var iterator = new TokenIterator(this, position.row, position.column); + var token = iterator.getCurrentToken(); + if (!token) + token = iterator.stepForward(); + if (!token) + return; + + if (!typeRe){ + typeRe = new RegExp( + "(\\.?" + + token.type.replace(".", "\\.").replace("lparen", ".paren") + .replace(/\b(?:end|start|begin)\b/, "") + + ")+" + ); + } + var valueIndex = position.column - iterator.getCurrentTokenColumn(); + + while (true) { + + var value = token.value; + var valueLength = value.length; + while (valueIndex < valueLength) { + var chr = value.charAt(valueIndex); + if (chr == closingBracket) { + depth -= 1; + if (depth == 0) { + return {row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn()}; + } + } + else if (chr == bracket) { + depth += 1; + } + valueIndex += 1; + } + do { + token = iterator.stepForward(); + } while (token && !typeRe.test(token.type)); + + if (token == null) + break; + + valueIndex = 0; + } + + return null; + }; + } + exports.BracketMatch = BracketMatch; + + }); + + ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var lang = acequire("./lib/lang"); + var config = acequire("./config"); + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + var Selection = acequire("./selection").Selection; + var TextMode = acequire("./mode/text").Mode; + var Range = acequire("./range").Range; + var Document = acequire("./document").Document; + var BackgroundTokenizer = acequire("./background_tokenizer").BackgroundTokenizer; + var SearchHighlight = acequire("./search_highlight").SearchHighlight; + + var EditSession = function(text, mode) { + this.$breakpoints = []; + this.$decorations = []; + this.$frontMarkers = {}; + this.$backMarkers = {}; + this.$markerId = 1; + this.$undoSelect = true; + + this.$foldData = []; + this.$foldData.toString = function() { + return this.join("\n"); + } + this.on("changeFold", this.onChangeFold.bind(this)); + this.$onChange = this.onChange.bind(this); + + if (typeof text != "object" || !text.getLine) + text = new Document(text); + + this.setDocument(text); + this.selection = new Selection(this); + + config.resetOptions(this); + this.setMode(mode); + config._signal("session", this); + }; + + + (function() { + + oop.implement(this, EventEmitter); + this.setDocument = function(doc) { + if (this.doc) + this.doc.removeListener("change", this.$onChange); + + this.doc = doc; + doc.on("change", this.$onChange); + + if (this.bgTokenizer) + this.bgTokenizer.setDocument(this.getDocument()); + + this.resetCaches(); + }; + this.getDocument = function() { + return this.doc; + }; + this.$resetRowCache = function(docRow) { + if (!docRow) { + this.$docRowCache = []; + this.$screenRowCache = []; + return; + } + var l = this.$docRowCache.length; + var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1; + if (l > i) { + this.$docRowCache.splice(i, l); + this.$screenRowCache.splice(i, l); + } + }; + + this.$getRowCacheIndex = function(cacheArray, val) { + var low = 0; + var hi = cacheArray.length - 1; + + while (low <= hi) { + var mid = (low + hi) >> 1; + var c = cacheArray[mid]; + + if (val > c) + low = mid + 1; + else if (val < c) + hi = mid - 1; + else + return mid; + } + + return low -1; + }; + + this.resetCaches = function() { + this.$modified = true; + this.$wrapData = []; + this.$rowLengthCache = []; + this.$resetRowCache(0); + if (this.bgTokenizer) + this.bgTokenizer.start(0); + }; + + this.onChangeFold = function(e) { + var fold = e.data; + this.$resetRowCache(fold.start.row); + }; + + this.onChange = function(e) { + var delta = e.data; + this.$modified = true; + + this.$resetRowCache(delta.range.start.row); + + var removedFolds = this.$updateInternalDataOnChange(e); + if (!this.$fromUndo && this.$undoManager && !delta.ignore) { + this.$deltasDoc.push(delta); + if (removedFolds && removedFolds.length != 0) { + this.$deltasFold.push({ + action: "removeFolds", + folds: removedFolds + }); + } + + this.$informUndoManager.schedule(); + } + + this.bgTokenizer && this.bgTokenizer.$updateOnChange(delta); + this._signal("change", e); + }; + this.setValue = function(text) { + this.doc.setValue(text); + this.selection.moveTo(0, 0); + + this.$resetRowCache(0); + this.$deltas = []; + this.$deltasDoc = []; + this.$deltasFold = []; + this.setUndoManager(this.$undoManager); + this.getUndoManager().reset(); + }; + this.getValue = + this.toString = function() { + return this.doc.getValue(); + }; + this.getSelection = function() { + return this.selection; + }; + this.getState = function(row) { + return this.bgTokenizer.getState(row); + }; + this.getTokens = function(row) { + return this.bgTokenizer.getTokens(row); + }; + this.getTokenAt = function(row, column) { + var tokens = this.bgTokenizer.getTokens(row); + var token, c = 0; + if (column == null) { + i = tokens.length - 1; + c = this.getLine(row).length; + } else { + for (var i = 0; i < tokens.length; i++) { + c += tokens[i].value.length; + if (c >= column) + break; + } + } + token = tokens[i]; + if (!token) + return null; + token.index = i; + token.start = c - token.value.length; + return token; + }; + this.setUndoManager = function(undoManager) { + this.$undoManager = undoManager; + this.$deltas = []; + this.$deltasDoc = []; + this.$deltasFold = []; + + if (this.$informUndoManager) + this.$informUndoManager.cancel(); + + if (undoManager) { + var self = this; + + this.$syncInformUndoManager = function() { + self.$informUndoManager.cancel(); + + if (self.$deltasFold.length) { + self.$deltas.push({ + group: "fold", + deltas: self.$deltasFold + }); + self.$deltasFold = []; + } + + if (self.$deltasDoc.length) { + self.$deltas.push({ + group: "doc", + deltas: self.$deltasDoc + }); + self.$deltasDoc = []; + } + + if (self.$deltas.length > 0) { + undoManager.execute({ + action: "aceupdate", + args: [self.$deltas, self], + merge: self.mergeUndoDeltas + }); + } + self.mergeUndoDeltas = false; + self.$deltas = []; + }; + this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); + } + }; + this.markUndoGroup = function() { + if (this.$syncInformUndoManager) + this.$syncInformUndoManager(); + }; + + this.$defaultUndoManager = { + undo: function() {}, + redo: function() {}, + reset: function() {} + }; + this.getUndoManager = function() { + return this.$undoManager || this.$defaultUndoManager; + }; + this.getTabString = function() { + if (this.getUseSoftTabs()) { + return lang.stringRepeat(" ", this.getTabSize()); + } else { + return "\t"; + } + }; + this.setUseSoftTabs = function(val) { + this.setOption("useSoftTabs", val); + }; + this.getUseSoftTabs = function() { + return this.$useSoftTabs && !this.$mode.$indentWithTabs; + }; + this.setTabSize = function(tabSize) { + this.setOption("tabSize", tabSize); + }; + this.getTabSize = function() { + return this.$tabSize; + }; + this.isTabStop = function(position) { + return this.$useSoftTabs && (position.column % this.$tabSize === 0); + }; + + this.$overwrite = false; + this.setOverwrite = function(overwrite) { + this.setOption("overwrite", overwrite); + }; + this.getOverwrite = function() { + return this.$overwrite; + }; + this.toggleOverwrite = function() { + this.setOverwrite(!this.$overwrite); + }; + this.addGutterDecoration = function(row, className) { + if (!this.$decorations[row]) + this.$decorations[row] = ""; + this.$decorations[row] += " " + className; + this._signal("changeBreakpoint", {}); + }; + this.removeGutterDecoration = function(row, className) { + this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); + this._signal("changeBreakpoint", {}); + }; + this.getBreakpoints = function() { + return this.$breakpoints; + }; + this.setBreakpoints = function(rows) { + this.$breakpoints = []; + for (var i=0; i 0) + inToken = !!line.charAt(column - 1).match(this.tokenRe); + + if (!inToken) + inToken = !!line.charAt(column).match(this.tokenRe); + + if (inToken) + var re = this.tokenRe; + else if (/^\s+$/.test(line.slice(column-1, column+1))) + var re = /\s/; + else + var re = this.nonTokenRe; + + var start = column; + if (start > 0) { + do { + start--; + } + while (start >= 0 && line.charAt(start).match(re)); + start++; + } + + var end = column; + while (end < line.length && line.charAt(end).match(re)) { + end++; + } + + return new Range(row, start, row, end); + }; + this.getAWordRange = function(row, column) { + var wordRange = this.getWordRange(row, column); + var line = this.getLine(wordRange.end.row); + + while (line.charAt(wordRange.end.column).match(/[ \t]/)) { + wordRange.end.column += 1; + } + return wordRange; + }; + this.setNewLineMode = function(newLineMode) { + this.doc.setNewLineMode(newLineMode); + }; + this.getNewLineMode = function() { + return this.doc.getNewLineMode(); + }; + this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); }; + this.getUseWorker = function() { return this.$useWorker; }; + this.onReloadTokenizer = function(e) { + var rows = e.data; + this.bgTokenizer.start(rows.first); + this._signal("tokenizerUpdate", e); + }; + + this.$modes = {}; + this.$mode = null; + this.$modeId = null; + this.setMode = function(mode, cb) { + if (mode && typeof mode === "object") { + if (mode.getTokenizer) + return this.$onChangeMode(mode); + var options = mode; + var path = options.path; + } else { + path = mode || "ace/mode/text"; + } + if (!this.$modes["ace/mode/text"]) + this.$modes["ace/mode/text"] = new TextMode(); + + if (this.$modes[path] && !options) { + this.$onChangeMode(this.$modes[path]); + cb && cb(); + return; + } + this.$modeId = path; + config.loadModule(["mode", path], function(m) { + if (this.$modeId !== path) + return cb && cb(); + if (this.$modes[path] && !options) { + this.$onChangeMode(this.$modes[path]); + } else if (m && m.Mode) { + m = new m.Mode(options); + if (!options) { + this.$modes[path] = m; + m.$id = path; + } + this.$onChangeMode(m); + } + cb && cb(); + }.bind(this)); + if (!this.$mode) + this.$onChangeMode(this.$modes["ace/mode/text"], true); + }; + + this.$onChangeMode = function(mode, $isPlaceholder) { + if (!$isPlaceholder) + this.$modeId = mode.$id; + if (this.$mode === mode) + return; + + this.$mode = mode; + + this.$stopWorker(); + + if (this.$useWorker) + this.$startWorker(); + + var tokenizer = mode.getTokenizer(); + + if(tokenizer.addEventListener !== undefined) { + var onReloadTokenizer = this.onReloadTokenizer.bind(this); + tokenizer.addEventListener("update", onReloadTokenizer); + } + + if (!this.bgTokenizer) { + this.bgTokenizer = new BackgroundTokenizer(tokenizer); + var _self = this; + this.bgTokenizer.addEventListener("update", function(e) { + _self._signal("tokenizerUpdate", e); + }); + } else { + this.bgTokenizer.setTokenizer(tokenizer); + } + + this.bgTokenizer.setDocument(this.getDocument()); + + this.tokenRe = mode.tokenRe; + this.nonTokenRe = mode.nonTokenRe; + + + if (!$isPlaceholder) { + if (mode.attachToSession) + mode.attachToSession(this); + this.$options.wrapMethod.set.call(this, this.$wrapMethod); + this.$setFolding(mode.foldingRules); + this.bgTokenizer.start(0); + this._emit("changeMode"); + } + }; + + this.$stopWorker = function() { + if (this.$worker) { + this.$worker.terminate(); + this.$worker = null; + } + }; + + this.$startWorker = function() { + try { + this.$worker = this.$mode.createWorker(this); + } catch (e) { + config.warn("Could not load worker", e); + this.$worker = null; + } + }; + this.getMode = function() { + return this.$mode; + }; + + this.$scrollTop = 0; + this.setScrollTop = function(scrollTop) { + if (this.$scrollTop === scrollTop || isNaN(scrollTop)) + return; + + this.$scrollTop = scrollTop; + this._signal("changeScrollTop", scrollTop); + }; + this.getScrollTop = function() { + return this.$scrollTop; + }; + + this.$scrollLeft = 0; + this.setScrollLeft = function(scrollLeft) { + if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft)) + return; + + this.$scrollLeft = scrollLeft; + this._signal("changeScrollLeft", scrollLeft); + }; + this.getScrollLeft = function() { + return this.$scrollLeft; + }; + this.getScreenWidth = function() { + this.$computeWidth(); + if (this.lineWidgets) + return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth); + return this.screenWidth; + }; + + this.getLineWidgetMaxWidth = function() { + if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth; + var width = 0; + this.lineWidgets.forEach(function(w) { + if (w && w.screenWidth > width) + width = w.screenWidth; + }); + return this.lineWidgetWidth = width; + }; + + this.$computeWidth = function(force) { + if (this.$modified || force) { + this.$modified = false; + + if (this.$useWrapMode) + return this.screenWidth = this.$wrapLimit; + + var lines = this.doc.getAllLines(); + var cache = this.$rowLengthCache; + var longestScreenLine = 0; + var foldIndex = 0; + var foldLine = this.$foldData[foldIndex]; + var foldStart = foldLine ? foldLine.start.row : Infinity; + var len = lines.length; + + for (var i = 0; i < len; i++) { + if (i > foldStart) { + i = foldLine.end.row + 1; + if (i >= len) + break; + foldLine = this.$foldData[foldIndex++]; + foldStart = foldLine ? foldLine.start.row : Infinity; + } + + if (cache[i] == null) + cache[i] = this.$getStringScreenWidth(lines[i])[0]; + + if (cache[i] > longestScreenLine) + longestScreenLine = cache[i]; + } + this.screenWidth = longestScreenLine; + } + }; + this.getLine = function(row) { + return this.doc.getLine(row); + }; + this.getLines = function(firstRow, lastRow) { + return this.doc.getLines(firstRow, lastRow); + }; + this.getLength = function() { + return this.doc.getLength(); + }; + this.getTextRange = function(range) { + return this.doc.getTextRange(range || this.selection.getRange()); + }; + this.insert = function(position, text) { + return this.doc.insert(position, text); + }; + this.remove = function(range) { + return this.doc.remove(range); + }; + this.undoChanges = function(deltas, dontSelect) { + if (!deltas.length) + return; + + this.$fromUndo = true; + var lastUndoRange = null; + for (var i = deltas.length - 1; i != -1; i--) { + var delta = deltas[i]; + if (delta.group == "doc") { + this.doc.revertDeltas(delta.deltas); + lastUndoRange = + this.$getUndoSelection(delta.deltas, true, lastUndoRange); + } else { + delta.deltas.forEach(function(foldDelta) { + this.addFolds(foldDelta.folds); + }, this); + } + } + this.$fromUndo = false; + lastUndoRange && + this.$undoSelect && + !dontSelect && + this.selection.setSelectionRange(lastUndoRange); + return lastUndoRange; + }; + this.redoChanges = function(deltas, dontSelect) { + if (!deltas.length) + return; + + this.$fromUndo = true; + var lastUndoRange = null; + for (var i = 0; i < deltas.length; i++) { + var delta = deltas[i]; + if (delta.group == "doc") { + this.doc.applyDeltas(delta.deltas); + lastUndoRange = + this.$getUndoSelection(delta.deltas, false, lastUndoRange); + } + } + this.$fromUndo = false; + lastUndoRange && + this.$undoSelect && + !dontSelect && + this.selection.setSelectionRange(lastUndoRange); + return lastUndoRange; + }; + this.setUndoSelect = function(enable) { + this.$undoSelect = enable; + }; + + this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { + function isInsert(delta) { + var insert = + delta.action === "insertText" || delta.action === "insertLines"; + return isUndo ? !insert : insert; + } + + var delta = deltas[0]; + var range, point; + var lastDeltaIsInsert = false; + if (isInsert(delta)) { + range = Range.fromPoints(delta.range.start, delta.range.end); + lastDeltaIsInsert = true; + } else { + range = Range.fromPoints(delta.range.start, delta.range.start); + lastDeltaIsInsert = false; + } + + for (var i = 1; i < deltas.length; i++) { + delta = deltas[i]; + if (isInsert(delta)) { + point = delta.range.start; + if (range.compare(point.row, point.column) == -1) { + range.setStart(delta.range.start); + } + point = delta.range.end; + if (range.compare(point.row, point.column) == 1) { + range.setEnd(delta.range.end); + } + lastDeltaIsInsert = true; + } else { + point = delta.range.start; + if (range.compare(point.row, point.column) == -1) { + range = + Range.fromPoints(delta.range.start, delta.range.start); + } + lastDeltaIsInsert = false; + } + } + if (lastUndoRange != null) { + if (Range.comparePoints(lastUndoRange.start, range.start) === 0) { + lastUndoRange.start.column += range.end.column - range.start.column; + lastUndoRange.end.column += range.end.column - range.start.column; + } + + var cmp = lastUndoRange.compareRange(range); + if (cmp == 1) { + range.setStart(lastUndoRange.start); + } else if (cmp == -1) { + range.setEnd(lastUndoRange.end); + } + } + + return range; + }; + this.replace = function(range, text) { + return this.doc.replace(range, text); + }; + this.moveText = function(fromRange, toPosition, copy) { + var text = this.getTextRange(fromRange); + var folds = this.getFoldsInRange(fromRange); + + var toRange = Range.fromPoints(toPosition, toPosition); + if (!copy) { + this.remove(fromRange); + var rowDiff = fromRange.start.row - fromRange.end.row; + var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column; + if (collDiff) { + if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column) + toRange.start.column += collDiff; + if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column) + toRange.end.column += collDiff; + } + if (rowDiff && toRange.start.row >= fromRange.end.row) { + toRange.start.row += rowDiff; + toRange.end.row += rowDiff; + } + } + + toRange.end = this.insert(toRange.start, text); + if (folds.length) { + var oldStart = fromRange.start; + var newStart = toRange.start; + var rowDiff = newStart.row - oldStart.row; + var collDiff = newStart.column - oldStart.column; + this.addFolds(folds.map(function(x) { + x = x.clone(); + if (x.start.row == oldStart.row) + x.start.column += collDiff; + if (x.end.row == oldStart.row) + x.end.column += collDiff; + x.start.row += rowDiff; + x.end.row += rowDiff; + return x; + })); + } + + return toRange; + }; + this.indentRows = function(startRow, endRow, indentString) { + indentString = indentString.replace(/\t/g, this.getTabString()); + for (var row=startRow; row<=endRow; row++) + this.insert({row: row, column:0}, indentString); + }; + this.outdentRows = function (range) { + var rowRange = range.collapseRows(); + var deleteRange = new Range(0, 0, 0, 0); + var size = this.getTabSize(); + + for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) { + var line = this.getLine(i); + + deleteRange.start.row = i; + deleteRange.end.row = i; + for (var j = 0; j < size; ++j) + if (line.charAt(j) != ' ') + break; + if (j < size && line.charAt(j) == '\t') { + deleteRange.start.column = j; + deleteRange.end.column = j + 1; + } else { + deleteRange.start.column = 0; + deleteRange.end.column = j; + } + this.remove(deleteRange); + } + }; + + this.$moveLines = function(firstRow, lastRow, dir) { + firstRow = this.getRowFoldStart(firstRow); + lastRow = this.getRowFoldEnd(lastRow); + if (dir < 0) { + var row = this.getRowFoldStart(firstRow + dir); + if (row < 0) return 0; + var diff = row-firstRow; + } else if (dir > 0) { + var row = this.getRowFoldEnd(lastRow + dir); + if (row > this.doc.getLength()-1) return 0; + var diff = row-lastRow; + } else { + firstRow = this.$clipRowToDocument(firstRow); + lastRow = this.$clipRowToDocument(lastRow); + var diff = lastRow - firstRow + 1; + } + + var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE); + var folds = this.getFoldsInRange(range).map(function(x){ + x = x.clone(); + x.start.row += diff; + x.end.row += diff; + return x; + }); + + var lines = dir == 0 + ? this.doc.getLines(firstRow, lastRow) + : this.doc.removeLines(firstRow, lastRow); + this.doc.insertLines(firstRow+diff, lines); + folds.length && this.addFolds(folds); + return diff; + }; + this.moveLinesUp = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, -1); + }; + this.moveLinesDown = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, 1); + }; + this.duplicateLines = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, 0); + }; + + + this.$clipRowToDocument = function(row) { + return Math.max(0, Math.min(row, this.doc.getLength()-1)); + }; + + this.$clipColumnToRow = function(row, column) { + if (column < 0) + return 0; + return Math.min(this.doc.getLine(row).length, column); + }; + + + this.$clipPositionToDocument = function(row, column) { + column = Math.max(0, column); + + if (row < 0) { + row = 0; + column = 0; + } else { + var len = this.doc.getLength(); + if (row >= len) { + row = len - 1; + column = this.doc.getLine(len-1).length; + } else { + column = Math.min(this.doc.getLine(row).length, column); + } + } + + return { + row: row, + column: column + }; + }; + + this.$clipRangeToDocument = function(range) { + if (range.start.row < 0) { + range.start.row = 0; + range.start.column = 0; + } else { + range.start.column = this.$clipColumnToRow( + range.start.row, + range.start.column + ); + } + + var len = this.doc.getLength() - 1; + if (range.end.row > len) { + range.end.row = len; + range.end.column = this.doc.getLine(len).length; + } else { + range.end.column = this.$clipColumnToRow( + range.end.row, + range.end.column + ); + } + return range; + }; + this.$wrapLimit = 80; + this.$useWrapMode = false; + this.$wrapLimitRange = { + min : null, + max : null + }; + this.setUseWrapMode = function(useWrapMode) { + if (useWrapMode != this.$useWrapMode) { + this.$useWrapMode = useWrapMode; + this.$modified = true; + this.$resetRowCache(0); + if (useWrapMode) { + var len = this.getLength(); + this.$wrapData = Array(len); + this.$updateWrapData(0, len - 1); + } + + this._signal("changeWrapMode"); + } + }; + this.getUseWrapMode = function() { + return this.$useWrapMode; + }; + this.setWrapLimitRange = function(min, max) { + if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { + this.$wrapLimitRange = { min: min, max: max }; + this.$modified = true; + if (this.$useWrapMode) + this._signal("changeWrapMode"); + } + }; + this.adjustWrapLimit = function(desiredLimit, $printMargin) { + var limits = this.$wrapLimitRange; + if (limits.max < 0) + limits = {min: $printMargin, max: $printMargin}; + var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max); + if (wrapLimit != this.$wrapLimit && wrapLimit > 1) { + this.$wrapLimit = wrapLimit; + this.$modified = true; + if (this.$useWrapMode) { + this.$updateWrapData(0, this.getLength() - 1); + this.$resetRowCache(0); + this._signal("changeWrapLimit"); + } + return true; + } + return false; + }; + + this.$constrainWrapLimit = function(wrapLimit, min, max) { + if (min) + wrapLimit = Math.max(min, wrapLimit); + + if (max) + wrapLimit = Math.min(max, wrapLimit); + + return wrapLimit; + }; + this.getWrapLimit = function() { + return this.$wrapLimit; + }; + this.setWrapLimit = function (limit) { + this.setWrapLimitRange(limit, limit); + }; + this.getWrapLimitRange = function() { + return { + min : this.$wrapLimitRange.min, + max : this.$wrapLimitRange.max + }; + }; + + this.$updateInternalDataOnChange = function(e) { + var useWrapMode = this.$useWrapMode; + var len; + var action = e.data.action; + var firstRow = e.data.range.start.row; + var lastRow = e.data.range.end.row; + var start = e.data.range.start; + var end = e.data.range.end; + var removedFolds = null; + + if (action.indexOf("Lines") != -1) { + if (action == "insertLines") { + lastRow = firstRow + (e.data.lines.length); + } else { + lastRow = firstRow; + } + len = e.data.lines ? e.data.lines.length : lastRow - firstRow; + } else { + len = lastRow - firstRow; + } + + this.$updating = true; + if (len != 0) { + if (action.indexOf("remove") != -1) { + this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len); + + var foldLines = this.$foldData; + removedFolds = this.getFoldsInRange(e.data.range); + this.removeFolds(removedFolds); + + var foldLine = this.getFoldLine(end.row); + var idx = 0; + if (foldLine) { + foldLine.addRemoveChars(end.row, end.column, start.column - end.column); + foldLine.shiftRow(-len); + + var foldLineBefore = this.getFoldLine(firstRow); + if (foldLineBefore && foldLineBefore !== foldLine) { + foldLineBefore.merge(foldLine); + foldLine = foldLineBefore; + } + idx = foldLines.indexOf(foldLine) + 1; + } + + for (idx; idx < foldLines.length; idx++) { + var foldLine = foldLines[idx]; + if (foldLine.start.row >= end.row) { + foldLine.shiftRow(-len); + } + } + + lastRow = firstRow; + } else { + var args = Array(len); + args.unshift(firstRow, 0); + var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache + arr.splice.apply(arr, args); + var foldLines = this.$foldData; + var foldLine = this.getFoldLine(firstRow); + var idx = 0; + if (foldLine) { + var cmp = foldLine.range.compareInside(start.row, start.column); + if (cmp == 0) { + foldLine = foldLine.split(start.row, start.column); + if (foldLine) { + foldLine.shiftRow(len); + foldLine.addRemoveChars(lastRow, 0, end.column - start.column); + } + } else + if (cmp == -1) { + foldLine.addRemoveChars(firstRow, 0, end.column - start.column); + foldLine.shiftRow(len); + } + idx = foldLines.indexOf(foldLine) + 1; + } + + for (idx; idx < foldLines.length; idx++) { + var foldLine = foldLines[idx]; + if (foldLine.start.row >= firstRow) { + foldLine.shiftRow(len); + } + } + } + } else { + len = Math.abs(e.data.range.start.column - e.data.range.end.column); + if (action.indexOf("remove") != -1) { + removedFolds = this.getFoldsInRange(e.data.range); + this.removeFolds(removedFolds); + + len = -len; + } + var foldLine = this.getFoldLine(firstRow); + if (foldLine) { + foldLine.addRemoveChars(firstRow, start.column, len); + } + } + + if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { + console.error("doc.getLength() and $wrapData.length have to be the same!"); + } + this.$updating = false; + + if (useWrapMode) + this.$updateWrapData(firstRow, lastRow); + else + this.$updateRowLengthCache(firstRow, lastRow); + + return removedFolds; + }; + + this.$updateRowLengthCache = function(firstRow, lastRow, b) { + this.$rowLengthCache[firstRow] = null; + this.$rowLengthCache[lastRow] = null; + }; + + this.$updateWrapData = function(firstRow, lastRow) { + var lines = this.doc.getAllLines(); + var tabSize = this.getTabSize(); + var wrapData = this.$wrapData; + var wrapLimit = this.$wrapLimit; + var tokens; + var foldLine; + + var row = firstRow; + lastRow = Math.min(lastRow, lines.length - 1); + while (row <= lastRow) { + foldLine = this.getFoldLine(row, foldLine); + if (!foldLine) { + tokens = this.$getDisplayTokens(lines[row]); + wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); + row ++; + } else { + tokens = []; + foldLine.walk(function(placeholder, row, column, lastColumn) { + var walkTokens; + if (placeholder != null) { + walkTokens = this.$getDisplayTokens( + placeholder, tokens.length); + walkTokens[0] = PLACEHOLDER_START; + for (var i = 1; i < walkTokens.length; i++) { + walkTokens[i] = PLACEHOLDER_BODY; + } + } else { + walkTokens = this.$getDisplayTokens( + lines[row].substring(lastColumn, column), + tokens.length); + } + tokens = tokens.concat(walkTokens); + }.bind(this), + foldLine.end.row, + lines[foldLine.end.row].length + 1 + ); + + wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); + row = foldLine.end.row + 1; + } + } + }; + var CHAR = 1, + CHAR_EXT = 2, + PLACEHOLDER_START = 3, + PLACEHOLDER_BODY = 4, + PUNCTUATION = 9, + SPACE = 10, + TAB = 11, + TAB_SPACE = 12; + + + this.$computeWrapSplits = function(tokens, wrapLimit) { + if (tokens.length == 0) { + return []; + } + + var splits = []; + var displayLength = tokens.length; + var lastSplit = 0, lastDocSplit = 0; + + var isCode = this.$wrapAsCode; + + function addSplit(screenPos) { + var displayed = tokens.slice(lastSplit, screenPos); + var len = displayed.length; + displayed.join(""). + replace(/12/g, function() { + len -= 1; + }). + replace(/2/g, function() { + len -= 1; + }); + + lastDocSplit += len; + splits.push(lastDocSplit); + lastSplit = screenPos; + } + + while (displayLength - lastSplit > wrapLimit) { + var split = lastSplit + wrapLimit; + if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) { + addSplit(split); + continue; + } + if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) { + for (split; split != lastSplit - 1; split--) { + if (tokens[split] == PLACEHOLDER_START) { + break; + } + } + if (split > lastSplit) { + addSplit(split); + continue; + } + split = lastSplit + wrapLimit; + for (split; split < tokens.length; split++) { + if (tokens[split] != PLACEHOLDER_BODY) { + break; + } + } + if (split == tokens.length) { + break; // Breaks the while-loop. + } + addSplit(split); + continue; + } + var minSplit = Math.max(split - (isCode ? 10 : wrapLimit-(wrapLimit>>2)), lastSplit - 1); + while (split > minSplit && tokens[split] < PLACEHOLDER_START) { + split --; + } + if (isCode) { + while (split > minSplit && tokens[split] < PLACEHOLDER_START) { + split --; + } + while (split > minSplit && tokens[split] == PUNCTUATION) { + split --; + } + } else { + while (split > minSplit && tokens[split] < SPACE) { + split --; + } + } + if (split > minSplit) { + addSplit(++split); + continue; + } + split = lastSplit + wrapLimit; + if (tokens[split] == CHAR_EXT) + split--; + addSplit(split); + } + return splits; + }; + this.$getDisplayTokens = function(str, offset) { + var arr = []; + var tabSize; + offset = offset || 0; + + for (var i = 0; i < str.length; i++) { + var c = str.charCodeAt(i); + if (c == 9) { + tabSize = this.getScreenTabSize(arr.length + offset); + arr.push(TAB); + for (var n = 1; n < tabSize; n++) { + arr.push(TAB_SPACE); + } + } + else if (c == 32) { + arr.push(SPACE); + } else if((c > 39 && c < 48) || (c > 57 && c < 64)) { + arr.push(PUNCTUATION); + } + else if (c >= 0x1100 && isFullWidth(c)) { + arr.push(CHAR, CHAR_EXT); + } else { + arr.push(CHAR); + } + } + return arr; + }; + this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { + if (maxScreenColumn == 0) + return [0, 0]; + if (maxScreenColumn == null) + maxScreenColumn = Infinity; + screenColumn = screenColumn || 0; + + var c, column; + for (column = 0; column < str.length; column++) { + c = str.charCodeAt(column); + if (c == 9) { + screenColumn += this.getScreenTabSize(screenColumn); + } + else if (c >= 0x1100 && isFullWidth(c)) { + screenColumn += 2; + } else { + screenColumn += 1; + } + if (screenColumn > maxScreenColumn) { + break; + } + } + + return [screenColumn, column]; + }; + + this.lineWidgets = null; + this.getRowLength = function(row) { + if (this.lineWidgets) + var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0 + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1 + h; + } else { + return this.$wrapData[row].length + 1 + h; + } + }; + this.getRowLineCount = function(row) { + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1; + } else { + return this.$wrapData[row].length + 1; + } + }; + this.getScreenLastRowColumn = function(screenRow) { + var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); + return this.documentToScreenColumn(pos.row, pos.column); + }; + this.getDocumentLastRowColumn = function(docRow, docColumn) { + var screenRow = this.documentToScreenRow(docRow, docColumn); + return this.getScreenLastRowColumn(screenRow); + }; + this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { + var screenRow = this.documentToScreenRow(docRow, docColumn); + return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); + }; + this.getRowSplitData = function(row) { + if (!this.$useWrapMode) { + return undefined; + } else { + return this.$wrapData[row]; + } + }; + this.getScreenTabSize = function(screenColumn) { + return this.$tabSize - screenColumn % this.$tabSize; + }; + + + this.screenToDocumentRow = function(screenRow, screenColumn) { + return this.screenToDocumentPosition(screenRow, screenColumn).row; + }; + + + this.screenToDocumentColumn = function(screenRow, screenColumn) { + return this.screenToDocumentPosition(screenRow, screenColumn).column; + }; + this.screenToDocumentPosition = function(screenRow, screenColumn) { + if (screenRow < 0) + return {row: 0, column: 0}; + + var line; + var docRow = 0; + var docColumn = 0; + var column; + var row = 0; + var rowLength = 0; + + var rowCache = this.$screenRowCache; + var i = this.$getRowCacheIndex(rowCache, screenRow); + var l = rowCache.length; + if (l && i >= 0) { + var row = rowCache[i]; + var docRow = this.$docRowCache[i]; + var doCache = screenRow > rowCache[l - 1]; + } else { + var doCache = !l; + } + + var maxRow = this.getLength() - 1; + var foldLine = this.getNextFoldLine(docRow); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (row <= screenRow) { + rowLength = this.getRowLength(docRow); + if (row + rowLength > screenRow || docRow >= maxRow) { + break; + } else { + row += rowLength; + docRow++; + if (docRow > foldStart) { + docRow = foldLine.end.row+1; + foldLine = this.getNextFoldLine(docRow, foldLine); + foldStart = foldLine ? foldLine.start.row : Infinity; + } + } + + if (doCache) { + this.$docRowCache.push(docRow); + this.$screenRowCache.push(row); + } + } + + if (foldLine && foldLine.start.row <= docRow) { + line = this.getFoldDisplayLine(foldLine); + docRow = foldLine.start.row; + } else if (row + rowLength <= screenRow || docRow > maxRow) { + return { + row: maxRow, + column: this.getLine(maxRow).length + }; + } else { + line = this.getLine(docRow); + foldLine = null; + } + + if (this.$useWrapMode) { + var splits = this.$wrapData[docRow]; + if (splits) { + var splitIndex = Math.floor(screenRow - row); + column = splits[splitIndex]; + if(splitIndex > 0 && splits.length) { + docColumn = splits[splitIndex - 1] || splits[splits.length - 1]; + line = line.substring(docColumn); + } + } + } + + docColumn += this.$getStringScreenWidth(line, screenColumn)[1]; + if (this.$useWrapMode && docColumn >= column) + docColumn = column - 1; + + if (foldLine) + return foldLine.idxToPosition(docColumn); + + return {row: docRow, column: docColumn}; + }; + this.documentToScreenPosition = function(docRow, docColumn) { + if (typeof docColumn === "undefined") + var pos = this.$clipPositionToDocument(docRow.row, docRow.column); + else + pos = this.$clipPositionToDocument(docRow, docColumn); + + docRow = pos.row; + docColumn = pos.column; + + var screenRow = 0; + var foldStartRow = null; + var fold = null; + fold = this.getFoldAt(docRow, docColumn, 1); + if (fold) { + docRow = fold.start.row; + docColumn = fold.start.column; + } + + var rowEnd, row = 0; + + + var rowCache = this.$docRowCache; + var i = this.$getRowCacheIndex(rowCache, docRow); + var l = rowCache.length; + if (l && i >= 0) { + var row = rowCache[i]; + var screenRow = this.$screenRowCache[i]; + var doCache = docRow > rowCache[l - 1]; + } else { + var doCache = !l; + } + + var foldLine = this.getNextFoldLine(row); + var foldStart = foldLine ?foldLine.start.row :Infinity; + + while (row < docRow) { + if (row >= foldStart) { + rowEnd = foldLine.end.row + 1; + if (rowEnd > docRow) + break; + foldLine = this.getNextFoldLine(rowEnd, foldLine); + foldStart = foldLine ?foldLine.start.row :Infinity; + } + else { + rowEnd = row + 1; + } + + screenRow += this.getRowLength(row); + row = rowEnd; + + if (doCache) { + this.$docRowCache.push(row); + this.$screenRowCache.push(screenRow); + } + } + var textLine = ""; + if (foldLine && row >= foldStart) { + textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn); + foldStartRow = foldLine.start.row; + } else { + textLine = this.getLine(docRow).substring(0, docColumn); + foldStartRow = docRow; + } + if (this.$useWrapMode) { + var wrapRow = this.$wrapData[foldStartRow]; + if (wrapRow) { + var screenRowOffset = 0; + while (textLine.length >= wrapRow[screenRowOffset]) { + screenRow ++; + screenRowOffset++; + } + textLine = textLine.substring( + wrapRow[screenRowOffset - 1] || 0, textLine.length + ); + } + } + + return { + row: screenRow, + column: this.$getStringScreenWidth(textLine)[0] + }; + }; + this.documentToScreenColumn = function(row, docColumn) { + return this.documentToScreenPosition(row, docColumn).column; + }; + this.documentToScreenRow = function(docRow, docColumn) { + return this.documentToScreenPosition(docRow, docColumn).row; + }; + this.getScreenLength = function() { + var screenRows = 0; + var fold = null; + if (!this.$useWrapMode) { + screenRows = this.getLength(); + var foldData = this.$foldData; + for (var i = 0; i < foldData.length; i++) { + fold = foldData[i]; + screenRows -= fold.end.row - fold.start.row; + } + } else { + var lastRow = this.$wrapData.length; + var row = 0, i = 0; + var fold = this.$foldData[i++]; + var foldStart = fold ? fold.start.row :Infinity; + + while (row < lastRow) { + var splits = this.$wrapData[row]; + screenRows += splits ? splits.length + 1 : 1; + row ++; + if (row > foldStart) { + row = fold.end.row+1; + fold = this.$foldData[i++]; + foldStart = fold ?fold.start.row :Infinity; + } + } + } + if (this.lineWidgets) + screenRows += this.$getWidgetScreenLength(); + + return screenRows; + }; + this.$setFontMetrics = function(fm) { + }; + + this.destroy = function() { + if (this.bgTokenizer) { + this.bgTokenizer.setDocument(null); + this.bgTokenizer = null; + } + this.$stopWorker(); + }; + function isFullWidth(c) { + if (c < 0x1100) + return false; + return c >= 0x1100 && c <= 0x115F || + c >= 0x11A3 && c <= 0x11A7 || + c >= 0x11FA && c <= 0x11FF || + c >= 0x2329 && c <= 0x232A || + c >= 0x2E80 && c <= 0x2E99 || + c >= 0x2E9B && c <= 0x2EF3 || + c >= 0x2F00 && c <= 0x2FD5 || + c >= 0x2FF0 && c <= 0x2FFB || + c >= 0x3000 && c <= 0x303E || + c >= 0x3041 && c <= 0x3096 || + c >= 0x3099 && c <= 0x30FF || + c >= 0x3105 && c <= 0x312D || + c >= 0x3131 && c <= 0x318E || + c >= 0x3190 && c <= 0x31BA || + c >= 0x31C0 && c <= 0x31E3 || + c >= 0x31F0 && c <= 0x321E || + c >= 0x3220 && c <= 0x3247 || + c >= 0x3250 && c <= 0x32FE || + c >= 0x3300 && c <= 0x4DBF || + c >= 0x4E00 && c <= 0xA48C || + c >= 0xA490 && c <= 0xA4C6 || + c >= 0xA960 && c <= 0xA97C || + c >= 0xAC00 && c <= 0xD7A3 || + c >= 0xD7B0 && c <= 0xD7C6 || + c >= 0xD7CB && c <= 0xD7FB || + c >= 0xF900 && c <= 0xFAFF || + c >= 0xFE10 && c <= 0xFE19 || + c >= 0xFE30 && c <= 0xFE52 || + c >= 0xFE54 && c <= 0xFE66 || + c >= 0xFE68 && c <= 0xFE6B || + c >= 0xFF01 && c <= 0xFF60 || + c >= 0xFFE0 && c <= 0xFFE6; + }; + + }).call(EditSession.prototype); + + acequire("./edit_session/folding").Folding.call(EditSession.prototype); + acequire("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); + + + config.defineOptions(EditSession.prototype, "session", { + wrap: { + set: function(value) { + if (!value || value == "off") + value = false; + else if (value == "free") + value = true; + else if (value == "printMargin") + value = -1; + else if (typeof value == "string") + value = parseInt(value, 10) || false; + + if (this.$wrap == value) + return; + this.$wrap = value; + if (!value) { + this.setUseWrapMode(false); + } else { + var col = typeof value == "number" ? value : null; + this.setWrapLimitRange(col, col); + this.setUseWrapMode(true); + } + }, + get: function() { + if (this.getUseWrapMode()) { + if (this.$wrap == -1) + return "printMargin"; + if (!this.getWrapLimitRange().min) + return "free"; + return this.$wrap; + } + return "off"; + }, + handlesSet: true + }, + wrapMethod: { + set: function(val) { + val = val == "auto" + ? this.$mode.type != "text" + : val != "text"; + if (val != this.$wrapAsCode) { + this.$wrapAsCode = val; + if (this.$useWrapMode) { + this.$modified = true; + this.$resetRowCache(0); + this.$updateWrapData(0, this.getLength() - 1); + } + } + }, + initialValue: "auto" + }, + firstLineNumber: { + set: function() {this._signal("changeBreakpoint");}, + initialValue: 1 + }, + useWorker: { + set: function(useWorker) { + this.$useWorker = useWorker; + + this.$stopWorker(); + if (useWorker) + this.$startWorker(); + }, + initialValue: true + }, + useSoftTabs: {initialValue: true}, + tabSize: { + set: function(tabSize) { + if (isNaN(tabSize) || this.$tabSize === tabSize) return; + + this.$modified = true; + this.$rowLengthCache = []; + this.$tabSize = tabSize; + this._signal("changeTabSize"); + }, + initialValue: 4, + handlesSet: true + }, + overwrite: { + set: function(val) {this._signal("changeOverwrite");}, + initialValue: false + }, + newLineMode: { + set: function(val) {this.doc.setNewLineMode(val)}, + get: function() {return this.doc.getNewLineMode()}, + handlesSet: true + }, + mode: { + set: function(val) { this.setMode(val) }, + get: function() { return this.$modeId } + } + }); + + exports.EditSession = EditSession; + }); + + ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(acequire, exports, module) { + "use strict"; + + var lang = acequire("./lib/lang"); + var oop = acequire("./lib/oop"); + var Range = acequire("./range").Range; + + var Search = function() { + this.$options = {}; + }; + + (function() { + this.set = function(options) { + oop.mixin(this.$options, options); + return this; + }; + this.getOptions = function() { + return lang.copyObject(this.$options); + }; + this.setOptions = function(options) { + this.$options = options; + }; + this.find = function(session) { + var options = this.$options; + var iterator = this.$matchIterator(session, options); + if (!iterator) + return false; + + var firstRange = null; + iterator.forEach(function(range, row, offset) { + if (!range.start) { + var column = range.offset + (offset || 0); + firstRange = new Range(row, column, row, column + range.length); + if (!range.length && options.start && options.start.start + && options.skipCurrent != false && firstRange.isEqual(options.start) + ) { + firstRange = null; + return false; + } + } else + firstRange = range; + return true; + }); + + return firstRange; + }; + this.findAll = function(session) { + var options = this.$options; + if (!options.needle) + return []; + this.$assembleRegExp(options); + + var range = options.range; + var lines = range + ? session.getLines(range.start.row, range.end.row) + : session.doc.getAllLines(); + + var ranges = []; + var re = options.re; + if (options.$isMultiLine) { + var len = re.length; + var maxRow = lines.length - len; + var prevRange; + outer: for (var row = re.offset || 0; row <= maxRow; row++) { + for (var j = 0; j < len; j++) + if (lines[row + j].search(re[j]) == -1) + continue outer; + + var startLine = lines[row]; + var line = lines[row + len - 1]; + var startIndex = startLine.length - startLine.match(re[0])[0].length; + var endIndex = line.match(re[len - 1])[0].length; + + if (prevRange && prevRange.end.row === row && + prevRange.end.column > startIndex + ) { + continue; + } + ranges.push(prevRange = new Range( + row, startIndex, row + len - 1, endIndex + )); + if (len > 2) + row = row + len - 2; + } + } else { + for (var i = 0; i < lines.length; i++) { + var matches = lang.getMatchOffsets(lines[i], re); + for (var j = 0; j < matches.length; j++) { + var match = matches[j]; + ranges.push(new Range(i, match.offset, i, match.offset + match.length)); + } + } + } + + if (range) { + var startColumn = range.start.column; + var endColumn = range.start.column; + var i = 0, j = ranges.length - 1; + while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == range.start.row) + i++; + + while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == range.end.row) + j--; + + ranges = ranges.slice(i, j + 1); + for (i = 0, j = ranges.length; i < j; i++) { + ranges[i].start.row += range.start.row; + ranges[i].end.row += range.start.row; + } + } + + return ranges; + }; + this.replace = function(input, replacement) { + var options = this.$options; + + var re = this.$assembleRegExp(options); + if (options.$isMultiLine) + return replacement; + + if (!re) + return; + + var match = re.exec(input); + if (!match || match[0].length != input.length) + return null; + + replacement = input.replace(re, replacement); + if (options.preserveCase) { + replacement = replacement.split(""); + for (var i = Math.min(input.length, input.length); i--; ) { + var ch = input[i]; + if (ch && ch.toLowerCase() != ch) + replacement[i] = replacement[i].toUpperCase(); + else + replacement[i] = replacement[i].toLowerCase(); + } + replacement = replacement.join(""); + } + + return replacement; + }; + + this.$matchIterator = function(session, options) { + var re = this.$assembleRegExp(options); + if (!re) + return false; + + var callback; + if (options.$isMultiLine) { + var len = re.length; + var matchIterator = function(line, row, offset) { + var startIndex = line.search(re[0]); + if (startIndex == -1) + return; + for (var i = 1; i < len; i++) { + line = session.getLine(row + i); + if (line.search(re[i]) == -1) + return; + } + + var endIndex = line.match(re[len - 1])[0].length; + + var range = new Range(row, startIndex, row + len - 1, endIndex); + if (re.offset == 1) { + range.start.row--; + range.start.column = Number.MAX_VALUE; + } else if (offset) + range.start.column += offset; + + if (callback(range)) + return true; + }; + } else if (options.backwards) { + var matchIterator = function(line, row, startIndex) { + var matches = lang.getMatchOffsets(line, re); + for (var i = matches.length-1; i >= 0; i--) + if (callback(matches[i], row, startIndex)) + return true; + }; + } else { + var matchIterator = function(line, row, startIndex) { + var matches = lang.getMatchOffsets(line, re); + for (var i = 0; i < matches.length; i++) + if (callback(matches[i], row, startIndex)) + return true; + }; + } + + var lineIterator = this.$lineIterator(session, options); + + return { + forEach: function(_callback) { + callback = _callback; + lineIterator.forEach(matchIterator); + } + }; + }; + + this.$assembleRegExp = function(options, $disableFakeMultiline) { + if (options.needle instanceof RegExp) + return options.re = options.needle; + + var needle = options.needle; + + if (!options.needle) + return options.re = false; + + if (!options.regExp) + needle = lang.escapeRegExp(needle); + + if (options.wholeWord) + needle = "\\b" + needle + "\\b"; + + var modifier = options.caseSensitive ? "gm" : "gmi"; + + options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle); + if (options.$isMultiLine) + return options.re = this.$assembleMultilineRegExp(needle, modifier); + + try { + var re = new RegExp(needle, modifier); + } catch(e) { + re = false; + } + return options.re = re; + }; + + this.$assembleMultilineRegExp = function(needle, modifier) { + var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n"); + var re = []; + for (var i = 0; i < parts.length; i++) try { + re.push(new RegExp(parts[i], modifier)); + } catch(e) { + return false; + } + if (parts[0] == "") { + re.shift(); + re.offset = 1; + } else { + re.offset = 0; + } + return re; + }; + + this.$lineIterator = function(session, options) { + var backwards = options.backwards == true; + var skipCurrent = options.skipCurrent != false; + + var range = options.range; + var start = options.start; + if (!start) + start = range ? range[backwards ? "end" : "start"] : session.selection.getRange(); + + if (start.start) + start = start[skipCurrent != backwards ? "end" : "start"]; + + var firstRow = range ? range.start.row : 0; + var lastRow = range ? range.end.row : session.getLength() - 1; + + var forEach = backwards ? function(callback) { + var row = start.row; + + var line = session.getLine(row).substring(0, start.column); + if (callback(line, row)) + return; + + for (row--; row >= firstRow; row--) + if (callback(session.getLine(row), row)) + return; + + if (options.wrap == false) + return; + + for (row = lastRow, firstRow = start.row; row >= firstRow; row--) + if (callback(session.getLine(row), row)) + return; + } : function(callback) { + var row = start.row; + + var line = session.getLine(row).substr(start.column); + if (callback(line, row, start.column)) + return; + + for (row = row+1; row <= lastRow; row++) + if (callback(session.getLine(row), row)) + return; + + if (options.wrap == false) + return; + + for (row = firstRow, lastRow = start.row; row <= lastRow; row++) + if (callback(session.getLine(row), row)) + return; + }; + + return {forEach: forEach}; + }; + + }).call(Search.prototype); + + exports.Search = Search; + }); + + ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(acequire, exports, module) { + "use strict"; + + var keyUtil = acequire("../lib/keys"); + var useragent = acequire("../lib/useragent"); + var KEY_MODS = keyUtil.KEY_MODS; + + function HashHandler(config, platform) { + this.platform = platform || (useragent.isMac ? "mac" : "win"); + this.commands = {}; + this.commandKeyBinding = {}; + this.addCommands(config); + this.$singleCommand = true; + } + + function MultiHashHandler(config, platform) { + HashHandler.call(this, config, platform); + this.$singleCommand = false; + } + + MultiHashHandler.prototype = HashHandler.prototype; + + (function() { + + + this.addCommand = function(command) { + if (this.commands[command.name]) + this.removeCommand(command); + + this.commands[command.name] = command; + + if (command.bindKey) + this._buildKeyHash(command); + }; + + this.removeCommand = function(command, keepCommand) { + var name = command && (typeof command === 'string' ? command : command.name); + command = this.commands[name]; + if (!keepCommand) + delete this.commands[name]; + var ckb = this.commandKeyBinding; + for (var keyId in ckb) { + var cmdGroup = ckb[keyId]; + if (cmdGroup == command) { + delete ckb[keyId]; + } else if (Array.isArray(cmdGroup)) { + var i = cmdGroup.indexOf(command); + if (i != -1) { + cmdGroup.splice(i, 1); + if (cmdGroup.length == 1) + ckb[keyId] = cmdGroup[0]; + } + } + } + }; + + this.bindKey = function(key, command, asDefault) { + if (typeof key == "object") + key = key[this.platform]; + if (!key) + return; + if (typeof command == "function") + return this.addCommand({exec: command, bindKey: key, name: command.name || key}); + + key.split("|").forEach(function(keyPart) { + var chain = ""; + if (keyPart.indexOf(" ") != -1) { + var parts = keyPart.split(/\s+/); + keyPart = parts.pop(); + parts.forEach(function(keyPart) { + var binding = this.parseKeys(keyPart); + var id = KEY_MODS[binding.hashId] + binding.key; + chain += (chain ? " " : "") + id; + this._addCommandToBinding(chain, "chainKeys"); + }, this); + chain += " "; + } + var binding = this.parseKeys(keyPart); + var id = KEY_MODS[binding.hashId] + binding.key; + this._addCommandToBinding(chain + id, command, asDefault); + }, this); + }; + + this._addCommandToBinding = function(keyId, command, asDefault) { + var ckb = this.commandKeyBinding, i; + if (!command) { + delete ckb[keyId]; + } else if (!ckb[keyId] || this.$singleCommand) { + ckb[keyId] = command; + } else { + if (!Array.isArray(ckb[keyId])) { + ckb[keyId] = [ckb[keyId]]; + } else if ((i = ckb[keyId].indexOf(command)) != -1) { + ckb[keyId].splice(i, 1); + } + + if (asDefault || command.isDefault) + ckb[keyId].unshift(command); + else + ckb[keyId].push(command); + } + }; + + this.addCommands = function(commands) { + commands && Object.keys(commands).forEach(function(name) { + var command = commands[name]; + if (!command) + return; + + if (typeof command === "string") + return this.bindKey(command, name); + + if (typeof command === "function") + command = { exec: command }; + + if (typeof command !== "object") + return; + + if (!command.name) + command.name = name; + + this.addCommand(command); + }, this); + }; + + this.removeCommands = function(commands) { + Object.keys(commands).forEach(function(name) { + this.removeCommand(commands[name]); + }, this); + }; + + this.bindKeys = function(keyList) { + Object.keys(keyList).forEach(function(key) { + this.bindKey(key, keyList[key]); + }, this); + }; + + this._buildKeyHash = function(command) { + this.bindKey(command.bindKey, command); + }; + this.parseKeys = function(keys) { + var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x}); + var key = parts.pop(); + + var keyCode = keyUtil[key]; + if (keyUtil.FUNCTION_KEYS[keyCode]) + key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase(); + else if (!parts.length) + return {key: key, hashId: -1}; + else if (parts.length == 1 && parts[0] == "shift") + return {key: key.toUpperCase(), hashId: -1}; + + var hashId = 0; + for (var i = parts.length; i--;) { + var modifier = keyUtil.KEY_MODS[parts[i]]; + if (modifier == null) { + if (typeof console != "undefined") + console.error("invalid modifier " + parts[i] + " in " + keys); + return false; + } + hashId |= modifier; + } + return {key: key, hashId: hashId}; + }; + + this.findKeyCommand = function findKeyCommand(hashId, keyString) { + var key = KEY_MODS[hashId] + keyString; + return this.commandKeyBinding[key]; + }; + + this.handleKeyboard = function(data, hashId, keyString, keyCode) { + var key = KEY_MODS[hashId] + keyString; + var command = this.commandKeyBinding[key]; + if (data.$keyChain) { + data.$keyChain += " " + key; + command = this.commandKeyBinding[data.$keyChain] || command; + } + + if (command) { + if (command == "chainKeys" || command[command.length - 1] == "chainKeys") { + data.$keyChain = data.$keyChain || key; + return {command: "null"}; + } + } + + if (data.$keyChain && keyCode > 0) + data.$keyChain = ""; + return {command: command}; + }; + + }).call(HashHandler.prototype); + + exports.HashHandler = HashHandler; + exports.MultiHashHandler = MultiHashHandler; + }); + + ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("../lib/oop"); + var MultiHashHandler = acequire("../keyboard/hash_handler").MultiHashHandler; + var EventEmitter = acequire("../lib/event_emitter").EventEmitter; + + var CommandManager = function(platform, commands) { + MultiHashHandler.call(this, commands, platform); + this.byName = this.commands; + this.setDefaultHandler("exec", function(e) { + return e.command.exec(e.editor, e.args || {}); + }); + }; + + oop.inherits(CommandManager, MultiHashHandler); + + (function() { + + oop.implement(this, EventEmitter); + + this.exec = function(command, editor, args) { + if (Array.isArray(command)) { + for (var i = command.length; i--; ) { + if (this.exec(command[i], editor, args)) return true; + } + return false; + } + + if (typeof command === "string") + command = this.commands[command]; + + if (!command) + return false; + + if (editor && editor.$readOnly && !command.readOnly) + return false; + + var e = {editor: editor, command: command, args: args}; + e.returnValue = this._emit("exec", e); + this._signal("afterExec", e); + + return e.returnValue === false ? false : true; + }; + + this.toggleRecording = function(editor) { + if (this.$inReplay) + return; + + editor && editor._emit("changeStatus"); + if (this.recording) { + this.macro.pop(); + this.removeEventListener("exec", this.$addCommandToMacro); + + if (!this.macro.length) + this.macro = this.oldMacro; + + return this.recording = false; + } + if (!this.$addCommandToMacro) { + this.$addCommandToMacro = function(e) { + this.macro.push([e.command, e.args]); + }.bind(this); + } + + this.oldMacro = this.macro; + this.macro = []; + this.on("exec", this.$addCommandToMacro); + return this.recording = true; + }; + + this.replay = function(editor) { + if (this.$inReplay || !this.macro) + return; + + if (this.recording) + return this.toggleRecording(editor); + + try { + this.$inReplay = true; + this.macro.forEach(function(x) { + if (typeof x == "string") + this.exec(x, editor); + else + this.exec(x[0], editor, x[1]); + }, this); + } finally { + this.$inReplay = false; + } + }; + + this.trimMacro = function(m) { + return m.map(function(x){ + if (typeof x[0] != "string") + x[0] = x[0].name; + if (!x[1]) + x = x[0]; + return x; + }); + }; + + }).call(CommandManager.prototype); + + exports.CommandManager = CommandManager; + + }); + + ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"], function(acequire, exports, module) { + "use strict"; + + var lang = acequire("../lib/lang"); + var config = acequire("../config"); + var Range = acequire("../range").Range; + + function bindKey(win, mac) { + return {win: win, mac: mac}; + } + exports.commands = [{ + name: "showSettingsMenu", + bindKey: bindKey("Ctrl-,", "Command-,"), + exec: function(editor) { + config.loadModule("ace/ext/settings_menu", function(module) { + module.init(editor); + editor.showSettingsMenu(); + }); + }, + readOnly: true + }, { + name: "goToNextError", + bindKey: bindKey("Alt-E", "Ctrl-E"), + exec: function(editor) { + config.loadModule("ace/ext/error_marker", function(module) { + module.showErrorMarker(editor, 1); + }); + }, + scrollIntoView: "animate", + readOnly: true + }, { + name: "goToPreviousError", + bindKey: bindKey("Alt-Shift-E", "Ctrl-Shift-E"), + exec: function(editor) { + config.loadModule("ace/ext/error_marker", function(module) { + module.showErrorMarker(editor, -1); + }); + }, + scrollIntoView: "animate", + readOnly: true + }, { + name: "selectall", + bindKey: bindKey("Ctrl-A", "Command-A"), + exec: function(editor) { editor.selectAll(); }, + readOnly: true + }, { + name: "centerselection", + bindKey: bindKey(null, "Ctrl-L"), + exec: function(editor) { editor.centerSelection(); }, + readOnly: true + }, { + name: "gotoline", + bindKey: bindKey("Ctrl-L", "Command-L"), + exec: function(editor) { + var line = parseInt(prompt("Enter line number:"), 10); + if (!isNaN(line)) { + editor.gotoLine(line); + } + }, + readOnly: true + }, { + name: "fold", + bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), + exec: function(editor) { editor.session.toggleFold(false); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "unfold", + bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), + exec: function(editor) { editor.session.toggleFold(true); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "toggleFoldWidget", + bindKey: bindKey("F2", "F2"), + exec: function(editor) { editor.session.toggleFoldWidget(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "toggleParentFoldWidget", + bindKey: bindKey("Alt-F2", "Alt-F2"), + exec: function(editor) { editor.session.toggleFoldWidget(true); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "foldall", + bindKey: bindKey(null, "Ctrl-Command-Option-0"), + exec: function(editor) { editor.session.foldAll(); }, + scrollIntoView: "center", + readOnly: true + }, { + name: "foldOther", + bindKey: bindKey("Alt-0", "Command-Option-0"), + exec: function(editor) { + editor.session.foldAll(); + editor.session.unfold(editor.selection.getAllRanges()); + }, + scrollIntoView: "center", + readOnly: true + }, { + name: "unfoldall", + bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"), + exec: function(editor) { editor.session.unfold(); }, + scrollIntoView: "center", + readOnly: true + }, { + name: "findnext", + bindKey: bindKey("Ctrl-K", "Command-G"), + exec: function(editor) { editor.findNext(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "findprevious", + bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), + exec: function(editor) { editor.findPrevious(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "selectOrFindNext", + bindKey: bindKey("Alt-K", "Ctrl-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findNext(); + }, + readOnly: true + }, { + name: "selectOrFindPrevious", + bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findPrevious(); + }, + readOnly: true + }, { + name: "find", + bindKey: bindKey("Ctrl-F", "Command-F"), + exec: function(editor) { + config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor)}); + }, + readOnly: true + }, { + name: "overwrite", + bindKey: "Insert", + exec: function(editor) { editor.toggleOverwrite(); }, + readOnly: true + }, { + name: "selecttostart", + bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"), + exec: function(editor) { editor.getSelection().selectFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "gotostart", + bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), + exec: function(editor) { editor.navigateFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "selectup", + bindKey: bindKey("Shift-Up", "Shift-Up"), + exec: function(editor) { editor.getSelection().selectUp(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "golineup", + bindKey: bindKey("Up", "Up|Ctrl-P"), + exec: function(editor, args) { editor.navigateUp(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selecttoend", + bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"), + exec: function(editor) { editor.getSelection().selectFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "gotoend", + bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), + exec: function(editor) { editor.navigateFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "selectdown", + bindKey: bindKey("Shift-Down", "Shift-Down"), + exec: function(editor) { editor.getSelection().selectDown(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "golinedown", + bindKey: bindKey("Down", "Down|Ctrl-N"), + exec: function(editor, args) { editor.navigateDown(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectwordleft", + bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), + exec: function(editor) { editor.getSelection().selectWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotowordleft", + bindKey: bindKey("Ctrl-Left", "Option-Left"), + exec: function(editor) { editor.navigateWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selecttolinestart", + bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"), + exec: function(editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotolinestart", + bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), + exec: function(editor) { editor.navigateLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectleft", + bindKey: bindKey("Shift-Left", "Shift-Left"), + exec: function(editor) { editor.getSelection().selectLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotoleft", + bindKey: bindKey("Left", "Left|Ctrl-B"), + exec: function(editor, args) { editor.navigateLeft(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectwordright", + bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), + exec: function(editor) { editor.getSelection().selectWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotowordright", + bindKey: bindKey("Ctrl-Right", "Option-Right"), + exec: function(editor) { editor.navigateWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selecttolineend", + bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"), + exec: function(editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotolineend", + bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), + exec: function(editor) { editor.navigateLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectright", + bindKey: bindKey("Shift-Right", "Shift-Right"), + exec: function(editor) { editor.getSelection().selectRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotoright", + bindKey: bindKey("Right", "Right|Ctrl-F"), + exec: function(editor, args) { editor.navigateRight(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectpagedown", + bindKey: "Shift-PageDown", + exec: function(editor) { editor.selectPageDown(); }, + readOnly: true + }, { + name: "pagedown", + bindKey: bindKey(null, "Option-PageDown"), + exec: function(editor) { editor.scrollPageDown(); }, + readOnly: true + }, { + name: "gotopagedown", + bindKey: bindKey("PageDown", "PageDown|Ctrl-V"), + exec: function(editor) { editor.gotoPageDown(); }, + readOnly: true + }, { + name: "selectpageup", + bindKey: "Shift-PageUp", + exec: function(editor) { editor.selectPageUp(); }, + readOnly: true + }, { + name: "pageup", + bindKey: bindKey(null, "Option-PageUp"), + exec: function(editor) { editor.scrollPageUp(); }, + readOnly: true + }, { + name: "gotopageup", + bindKey: "PageUp", + exec: function(editor) { editor.gotoPageUp(); }, + readOnly: true + }, { + name: "scrollup", + bindKey: bindKey("Ctrl-Up", null), + exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true + }, { + name: "scrolldown", + bindKey: bindKey("Ctrl-Down", null), + exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true + }, { + name: "selectlinestart", + bindKey: "Shift-Home", + exec: function(editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectlineend", + bindKey: "Shift-End", + exec: function(editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "togglerecording", + bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"), + exec: function(editor) { editor.commands.toggleRecording(editor); }, + readOnly: true + }, { + name: "replaymacro", + bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"), + exec: function(editor) { editor.commands.replay(editor); }, + readOnly: true + }, { + name: "jumptomatching", + bindKey: bindKey("Ctrl-P", "Ctrl-P"), + exec: function(editor) { editor.jumpToMatching(); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true + }, { + name: "selecttomatching", + bindKey: bindKey("Ctrl-Shift-P", "Ctrl-Shift-P"), + exec: function(editor) { editor.jumpToMatching(true); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true + }, { + name: "expandToMatching", + bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"), + exec: function(editor) { editor.jumpToMatching(true, true); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true + }, { + name: "passKeysToBrowser", + bindKey: bindKey(null, null), + exec: function() {}, + passEvent: true, + readOnly: true + }, + { + name: "cut", + exec: function(editor) { + var range = editor.getSelectionRange(); + editor._emit("cut", range); + + if (!editor.selection.isEmpty()) { + editor.session.remove(range); + editor.clearSelection(); + } + }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "removeline", + bindKey: bindKey("Ctrl-D", "Command-D"), + exec: function(editor) { editor.removeLines(); }, + scrollIntoView: "cursor", + multiSelectAction: "forEachLine" + }, { + name: "duplicateSelection", + bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), + exec: function(editor) { editor.duplicateSelection(); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "sortlines", + bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), + exec: function(editor) { editor.sortLines(); }, + scrollIntoView: "selection", + multiSelectAction: "forEachLine" + }, { + name: "togglecomment", + bindKey: bindKey("Ctrl-/", "Command-/"), + exec: function(editor) { editor.toggleCommentLines(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" + }, { + name: "toggleBlockComment", + bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), + exec: function(editor) { editor.toggleBlockComment(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" + }, { + name: "modifyNumberUp", + bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), + exec: function(editor) { editor.modifyNumber(1); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "modifyNumberDown", + bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), + exec: function(editor) { editor.modifyNumber(-1); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "replace", + bindKey: bindKey("Ctrl-H", "Command-Option-F"), + exec: function(editor) { + config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true)}); + } + }, { + name: "undo", + bindKey: bindKey("Ctrl-Z", "Command-Z"), + exec: function(editor) { editor.undo(); } + }, { + name: "redo", + bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), + exec: function(editor) { editor.redo(); } + }, { + name: "copylinesup", + bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), + exec: function(editor) { editor.copyLinesUp(); }, + scrollIntoView: "cursor" + }, { + name: "movelinesup", + bindKey: bindKey("Alt-Up", "Option-Up"), + exec: function(editor) { editor.moveLinesUp(); }, + scrollIntoView: "cursor" + }, { + name: "copylinesdown", + bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), + exec: function(editor) { editor.copyLinesDown(); }, + scrollIntoView: "cursor" + }, { + name: "movelinesdown", + bindKey: bindKey("Alt-Down", "Option-Down"), + exec: function(editor) { editor.moveLinesDown(); }, + scrollIntoView: "cursor" + }, { + name: "del", + bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), + exec: function(editor) { editor.remove("right"); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "backspace", + bindKey: bindKey( + "Shift-Backspace|Backspace", + "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H" + ), + exec: function(editor) { editor.remove("left"); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "cut_or_delete", + bindKey: bindKey("Shift-Delete", null), + exec: function(editor) { + if (editor.selection.isEmpty()) { + editor.remove("left"); + } else { + return false; + } + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removetolinestart", + bindKey: bindKey("Alt-Backspace", "Command-Backspace"), + exec: function(editor) { editor.removeToLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removetolineend", + bindKey: bindKey("Alt-Delete", "Ctrl-K"), + exec: function(editor) { editor.removeToLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removewordleft", + bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), + exec: function(editor) { editor.removeWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removewordright", + bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), + exec: function(editor) { editor.removeWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "outdent", + bindKey: bindKey("Shift-Tab", "Shift-Tab"), + exec: function(editor) { editor.blockOutdent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" + }, { + name: "indent", + bindKey: bindKey("Tab", "Tab"), + exec: function(editor) { editor.indent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" + }, { + name: "blockoutdent", + bindKey: bindKey("Ctrl-[", "Ctrl-["), + exec: function(editor) { editor.blockOutdent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" + }, { + name: "blockindent", + bindKey: bindKey("Ctrl-]", "Ctrl-]"), + exec: function(editor) { editor.blockIndent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" + }, { + name: "insertstring", + exec: function(editor, str) { editor.insert(str); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "inserttext", + exec: function(editor, args) { + editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "splitline", + bindKey: bindKey(null, "Ctrl-O"), + exec: function(editor) { editor.splitLine(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "transposeletters", + bindKey: bindKey("Ctrl-T", "Ctrl-T"), + exec: function(editor) { editor.transposeLetters(); }, + multiSelectAction: function(editor) {editor.transposeSelections(1); }, + scrollIntoView: "cursor" + }, { + name: "touppercase", + bindKey: bindKey("Ctrl-U", "Ctrl-U"), + exec: function(editor) { editor.toUpperCase(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "tolowercase", + bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), + exec: function(editor) { editor.toLowerCase(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "expandtoline", + bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"), + exec: function(editor) { + var range = editor.selection.getRange(); + + range.start.column = range.end.column = 0; + range.end.row++; + editor.selection.setRange(range, false); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "joinlines", + bindKey: bindKey(null, null), + exec: function(editor) { + var isBackwards = editor.selection.isBackwards(); + var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor(); + var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead(); + var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length; + var selectedText = editor.session.doc.getTextRange(editor.selection.getRange()); + var selectedCount = selectedText.replace(/\n\s*/, " ").length; + var insertLine = editor.session.doc.getLine(selectionStart.row); + + for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) { + var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i))); + if (curLine.length !== 0) { + curLine = " " + curLine; + } + insertLine += curLine; + } + + if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) { + insertLine += editor.session.doc.getNewLineCharacter(); + } + + editor.clearSelection(); + editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine); + + if (selectedCount > 0) { + editor.selection.moveCursorTo(selectionStart.row, selectionStart.column); + editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount); + } else { + firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol; + editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol); + } + }, + multiSelectAction: "forEach", + readOnly: true + }, { + name: "invertSelection", + bindKey: bindKey(null, null), + exec: function(editor) { + var endRow = editor.session.doc.getLength() - 1; + var endCol = editor.session.doc.getLine(endRow).length; + var ranges = editor.selection.rangeList.ranges; + var newRanges = []; + if (ranges.length < 1) { + ranges = [editor.selection.getRange()]; + } + + for (var i = 0; i < ranges.length; i++) { + if (i == (ranges.length - 1)) { + if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) { + newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol)); + } + } + + if (i === 0) { + if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) { + newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column)); + } + } else { + newRanges.push(new Range(ranges[i-1].end.row, ranges[i-1].end.column, ranges[i].start.row, ranges[i].start.column)); + } + } + + editor.exitMultiSelectMode(); + editor.clearSelection(); + + for(var i = 0; i < newRanges.length; i++) { + editor.selection.addRange(newRanges[i], false); + } + }, + readOnly: true, + scrollIntoView: "none" + }]; + + }); + + ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator"], function(acequire, exports, module) { + "use strict"; + + acequire("./lib/fixoldbrowsers"); + + var oop = acequire("./lib/oop"); + var dom = acequire("./lib/dom"); + var lang = acequire("./lib/lang"); + var useragent = acequire("./lib/useragent"); + var TextInput = acequire("./keyboard/textinput").TextInput; + var MouseHandler = acequire("./mouse/mouse_handler").MouseHandler; + var FoldHandler = acequire("./mouse/fold_handler").FoldHandler; + var KeyBinding = acequire("./keyboard/keybinding").KeyBinding; + var EditSession = acequire("./edit_session").EditSession; + var Search = acequire("./search").Search; + var Range = acequire("./range").Range; + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + var CommandManager = acequire("./commands/command_manager").CommandManager; + var defaultCommands = acequire("./commands/default_commands").commands; + var config = acequire("./config"); + var TokenIterator = acequire("./token_iterator").TokenIterator; + var Editor = function(renderer, session) { + var container = renderer.getContainerElement(); + this.container = container; + this.renderer = renderer; + + this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); + this.textInput = new TextInput(renderer.getTextAreaContainer(), this); + this.renderer.textarea = this.textInput.getElement(); + this.keyBinding = new KeyBinding(this); + this.$mouseHandler = new MouseHandler(this); + new FoldHandler(this); + + this.$blockScrolling = 0; + this.$search = new Search().set({ + wrap: true + }); + + this.$historyTracker = this.$historyTracker.bind(this); + this.commands.on("exec", this.$historyTracker); + + this.$initOperationListeners(); + + this._$emitInputEvent = lang.delayedCall(function() { + this._signal("input", {}); + if (this.session && this.session.bgTokenizer) + this.session.bgTokenizer.scheduleStart(); + }.bind(this)); + + this.on("change", function(_, _self) { + _self._$emitInputEvent.schedule(31); + }); + + this.setSession(session || new EditSession("")); + config.resetOptions(this); + config._signal("editor", this); + }; + + (function(){ + + oop.implement(this, EventEmitter); + + this.$initOperationListeners = function() { + function last(a) {return a[a.length - 1]} + + this.selections = []; + this.commands.on("exec", this.startOperation.bind(this), true); + this.commands.on("afterExec", this.endOperation.bind(this), true); + + this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this)); + + this.on("change", function() { + this.curOp || this.startOperation(); + this.curOp.docChanged = true; + }.bind(this), true); + + this.on("changeSelection", function() { + this.curOp || this.startOperation(); + this.curOp.selectionChanged = true; + }.bind(this), true); + }; + + this.curOp = null; + this.prevOp = {}; + this.startOperation = function(commadEvent) { + if (this.curOp) { + if (!commadEvent || this.curOp.command) + return; + this.prevOp = this.curOp; + } + if (!commadEvent) { + this.previousCommand = null; + commadEvent = {}; + } + + this.$opResetTimer.schedule(); + this.curOp = { + command: commadEvent.command || {}, + args: commadEvent.args, + scrollTop: this.renderer.scrollTop + }; + if (this.curOp.command.name && this.curOp.command.scrollIntoView !== undefined) + this.$blockScrolling++; + }; + + this.endOperation = function(e) { + if (this.curOp) { + if (e && e.returnValue === false) + return this.curOp = null; + this._signal("beforeEndOperation"); + var command = this.curOp.command; + if (command.name && this.$blockScrolling > 0) + this.$blockScrolling--; + if (command && command.scrollIntoView) { + switch (command.scrollIntoView) { + case "center": + this.renderer.scrollCursorIntoView(null, 0.5); + break; + case "animate": + case "cursor": + this.renderer.scrollCursorIntoView(); + break; + case "selectionPart": + var range = this.selection.getRange(); + var config = this.renderer.layerConfig; + if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) { + this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead); + } + break; + default: + break; + } + if (command.scrollIntoView == "animate") + this.renderer.animateScrolling(this.curOp.scrollTop); + } + + this.prevOp = this.curOp; + this.curOp = null; + } + }; + this.$mergeableCommands = ["backspace", "del", "insertstring"]; + this.$historyTracker = function(e) { + if (!this.$mergeUndoDeltas) + return; + + var prev = this.prevOp; + var mergeableCommands = this.$mergeableCommands; + var shouldMerge = prev.command && (e.command.name == prev.command.name); + if (e.command.name == "insertstring") { + var text = e.args; + if (this.mergeNextCommand === undefined) + this.mergeNextCommand = true; + + shouldMerge = shouldMerge + && this.mergeNextCommand // previous command allows to coalesce with + && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type + + this.mergeNextCommand = true; + } else { + shouldMerge = shouldMerge + && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable + } + + if ( + this.$mergeUndoDeltas != "always" + && Date.now() - this.sequenceStartTime > 2000 + ) { + shouldMerge = false; // the sequence is too long + } + + if (shouldMerge) + this.session.mergeUndoDeltas = true; + else if (mergeableCommands.indexOf(e.command.name) !== -1) + this.sequenceStartTime = Date.now(); + }; + this.setKeyboardHandler = function(keyboardHandler, cb) { + if (keyboardHandler && typeof keyboardHandler === "string") { + this.$keybindingId = keyboardHandler; + var _self = this; + config.loadModule(["keybinding", keyboardHandler], function(module) { + if (_self.$keybindingId == keyboardHandler) + _self.keyBinding.setKeyboardHandler(module && module.handler); + cb && cb(); + }); + } else { + this.$keybindingId = null; + this.keyBinding.setKeyboardHandler(keyboardHandler); + cb && cb(); + } + }; + this.getKeyboardHandler = function() { + return this.keyBinding.getKeyboardHandler(); + }; + this.setSession = function(session) { + if (this.session == session) + return; + + var oldSession = this.session; + if (oldSession) { + this.session.removeEventListener("change", this.$onDocumentChange); + this.session.removeEventListener("changeMode", this.$onChangeMode); + this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate); + this.session.removeEventListener("changeTabSize", this.$onChangeTabSize); + this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit); + this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode); + this.session.removeEventListener("onChangeFold", this.$onChangeFold); + this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker); + this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker); + this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint); + this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation); + this.session.removeEventListener("changeOverwrite", this.$onCursorChange); + this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange); + this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange); + + var selection = this.session.getSelection(); + selection.removeEventListener("changeCursor", this.$onCursorChange); + selection.removeEventListener("changeSelection", this.$onSelectionChange); + } + + this.session = session; + if (session) { + this.$onDocumentChange = this.onDocumentChange.bind(this); + session.addEventListener("change", this.$onDocumentChange); + this.renderer.setSession(session); + + this.$onChangeMode = this.onChangeMode.bind(this); + session.addEventListener("changeMode", this.$onChangeMode); + + this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); + session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate); + + this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer); + session.addEventListener("changeTabSize", this.$onChangeTabSize); + + this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); + session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit); + + this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); + session.addEventListener("changeWrapMode", this.$onChangeWrapMode); + + this.$onChangeFold = this.onChangeFold.bind(this); + session.addEventListener("changeFold", this.$onChangeFold); + + this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); + this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker); + + this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); + this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker); + + this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); + this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint); + + this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); + this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation); + + this.$onCursorChange = this.onCursorChange.bind(this); + this.session.addEventListener("changeOverwrite", this.$onCursorChange); + + this.$onScrollTopChange = this.onScrollTopChange.bind(this); + this.session.addEventListener("changeScrollTop", this.$onScrollTopChange); + + this.$onScrollLeftChange = this.onScrollLeftChange.bind(this); + this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange); + + this.selection = session.getSelection(); + this.selection.addEventListener("changeCursor", this.$onCursorChange); + + this.$onSelectionChange = this.onSelectionChange.bind(this); + this.selection.addEventListener("changeSelection", this.$onSelectionChange); + + this.onChangeMode(); + + this.$blockScrolling += 1; + this.onCursorChange(); + this.$blockScrolling -= 1; + + this.onScrollTopChange(); + this.onScrollLeftChange(); + this.onSelectionChange(); + this.onChangeFrontMarker(); + this.onChangeBackMarker(); + this.onChangeBreakpoint(); + this.onChangeAnnotation(); + this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); + this.renderer.updateFull(); + } else { + this.selection = null; + this.renderer.setSession(session); + } + + this._signal("changeSession", { + session: session, + oldSession: oldSession + }); + + oldSession && oldSession._signal("changeEditor", {oldEditor: this}); + session && session._signal("changeEditor", {editor: this}); + }; + this.getSession = function() { + return this.session; + }; + this.setValue = function(val, cursorPos) { + this.session.doc.setValue(val); + + if (!cursorPos) + this.selectAll(); + else if (cursorPos == 1) + this.navigateFileEnd(); + else if (cursorPos == -1) + this.navigateFileStart(); + + return val; + }; + this.getValue = function() { + return this.session.getValue(); + }; + this.getSelection = function() { + return this.selection; + }; + this.resize = function(force) { + this.renderer.onResize(force); + }; + this.setTheme = function(theme, cb) { + this.renderer.setTheme(theme, cb); + }; + this.getTheme = function() { + return this.renderer.getTheme(); + }; + this.setStyle = function(style) { + this.renderer.setStyle(style); + }; + this.unsetStyle = function(style) { + this.renderer.unsetStyle(style); + }; + this.getFontSize = function () { + return this.getOption("fontSize") || + dom.computedStyle(this.container, "fontSize"); + }; + this.setFontSize = function(size) { + this.setOption("fontSize", size); + }; + + this.$highlightBrackets = function() { + if (this.session.$bracketHighlight) { + this.session.removeMarker(this.session.$bracketHighlight); + this.session.$bracketHighlight = null; + } + + if (this.$highlightPending) { + return; + } + var self = this; + this.$highlightPending = true; + setTimeout(function() { + self.$highlightPending = false; + var session = self.session; + if (!session || !session.bgTokenizer) return; + var pos = session.findMatchingBracket(self.getCursorPosition()); + if (pos) { + var range = new Range(pos.row, pos.column, pos.row, pos.column + 1); + } else if (session.$mode.getMatching) { + var range = session.$mode.getMatching(self.session); + } + if (range) + session.$bracketHighlight = session.addMarker(range, "ace_bracket", "text"); + }, 50); + }; + this.$highlightTags = function() { + if (this.$highlightTagPending) + return; + var self = this; + this.$highlightTagPending = true; + setTimeout(function() { + self.$highlightTagPending = false; + + var session = self.session; + if (!session || !session.bgTokenizer) return; + + var pos = self.getCursorPosition(); + var iterator = new TokenIterator(self.session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + + if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) { + session.removeMarker(session.$tagHighlight); + session.$tagHighlight = null; + return; + } + + if (token.type.indexOf("tag-open") != -1) { + token = iterator.stepForward(); + if (!token) + return; + } + + var tag = token.value; + var depth = 0; + var prevToken = iterator.stepBackward(); + + if (prevToken.value == '<'){ + do { + prevToken = token; + token = iterator.stepForward(); + + if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { + if (prevToken.value === '<'){ + depth++; + } else if (prevToken.value === '= 0); + } else { + do { + token = prevToken; + prevToken = iterator.stepBackward(); + + if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { + if (prevToken.value === '<') { + depth++; + } else if (prevToken.value === ' 1)) + highlight = false; + } + + if (session.$highlightLineMarker && !highlight) { + session.removeMarker(session.$highlightLineMarker.id); + session.$highlightLineMarker = null; + } else if (!session.$highlightLineMarker && highlight) { + var range = new Range(highlight.row, highlight.column, highlight.row, Infinity); + range.id = session.addMarker(range, "ace_active-line", "screenLine"); + session.$highlightLineMarker = range; + } else if (highlight) { + session.$highlightLineMarker.start.row = highlight.row; + session.$highlightLineMarker.end.row = highlight.row; + session.$highlightLineMarker.start.column = highlight.column; + session._signal("changeBackMarker"); + } + }; + + this.onSelectionChange = function(e) { + var session = this.session; + + if (session.$selectionMarker) { + session.removeMarker(session.$selectionMarker); + } + session.$selectionMarker = null; + + if (!this.selection.isEmpty()) { + var range = this.selection.getRange(); + var style = this.getSelectionStyle(); + session.$selectionMarker = session.addMarker(range, "ace_selection", style); + } else { + this.$updateHighlightActiveLine(); + } + + var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp(); + this.session.highlight(re); + + this._signal("changeSelection"); + }; + + this.$getSelectionHighLightRegexp = function() { + var session = this.session; + + var selection = this.getSelectionRange(); + if (selection.isEmpty() || selection.isMultiLine()) + return; + + var startOuter = selection.start.column - 1; + var endOuter = selection.end.column + 1; + var line = session.getLine(selection.start.row); + var lineCols = line.length; + var needle = line.substring(Math.max(startOuter, 0), + Math.min(endOuter, lineCols)); + if ((startOuter >= 0 && /^[\w\d]/.test(needle)) || + (endOuter <= lineCols && /[\w\d]$/.test(needle))) + return; + + needle = line.substring(selection.start.column, selection.end.column); + if (!/^[\w\d]+$/.test(needle)) + return; + + var re = this.$search.$assembleRegExp({ + wholeWord: true, + caseSensitive: true, + needle: needle + }); + + return re; + }; + + + this.onChangeFrontMarker = function() { + this.renderer.updateFrontMarkers(); + }; + + this.onChangeBackMarker = function() { + this.renderer.updateBackMarkers(); + }; + + + this.onChangeBreakpoint = function() { + this.renderer.updateBreakpoints(); + }; + + this.onChangeAnnotation = function() { + this.renderer.setAnnotations(this.session.getAnnotations()); + }; + + + this.onChangeMode = function(e) { + this.renderer.updateText(); + this._emit("changeMode", e); + }; + + + this.onChangeWrapLimit = function() { + this.renderer.updateFull(); + }; + + this.onChangeWrapMode = function() { + this.renderer.onResize(true); + }; + + + this.onChangeFold = function() { + this.$updateHighlightActiveLine(); + this.renderer.updateFull(); + }; + this.getSelectedText = function() { + return this.session.getTextRange(this.getSelectionRange()); + }; + this.getCopyText = function() { + var text = this.getSelectedText(); + this._signal("copy", text); + return text; + }; + this.onCopy = function() { + this.commands.exec("copy", this); + }; + this.onCut = function() { + this.commands.exec("cut", this); + }; + this.onPaste = function(text) { + if (this.$readOnly) + return; + + var e = {text: text}; + this._signal("paste", e); + text = e.text; + if (!this.inMultiSelectMode || this.inVirtualSelectionMode) { + this.insert(text); + } else { + var lines = text.split(/\r\n|\r|\n/); + var ranges = this.selection.rangeList.ranges; + + if (lines.length > ranges.length || lines.length < 2 || !lines[1]) + return this.commands.exec("insertstring", this, text); + + for (var i = ranges.length; i--;) { + var range = ranges[i]; + if (!range.isEmpty()) + this.session.remove(range); + + this.session.insert(range.start, lines[i]); + } + } + this.renderer.scrollCursorIntoView(); + }; + + this.execCommand = function(command, args) { + return this.commands.exec(command, this, args); + }; + this.insert = function(text, pasted) { + var session = this.session; + var mode = session.getMode(); + var cursor = this.getCursorPosition(); + + if (this.getBehavioursEnabled() && !pasted) { + var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); + if (transform) { + if (text !== transform.text) { + this.session.mergeUndoDeltas = false; + this.$mergeNextCommand = false; + } + text = transform.text; + + } + } + + if (text == "\t") + text = this.session.getTabString(); + if (!this.selection.isEmpty()) { + var range = this.getSelectionRange(); + cursor = this.session.remove(range); + this.clearSelection(); + } + else if (this.session.getOverwrite()) { + var range = new Range.fromPoints(cursor, cursor); + range.end.column += text.length; + this.session.remove(range); + } + + if (text == "\n" || text == "\r\n") { + var line = session.getLine(cursor.row); + if (cursor.column > line.search(/\S|$/)) { + var d = line.substr(cursor.column).search(/\S|$/); + session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d); + } + } + this.clearSelection(); + + var start = cursor.column; + var lineState = session.getState(cursor.row); + var line = session.getLine(cursor.row); + var shouldOutdent = mode.checkOutdent(lineState, line, text); + var end = session.insert(cursor, text); + + if (transform && transform.selection) { + if (transform.selection.length == 2) { // Transform relative to the current column + this.selection.setSelectionRange( + new Range(cursor.row, start + transform.selection[0], + cursor.row, start + transform.selection[1])); + } else { // Transform relative to the current row. + this.selection.setSelectionRange( + new Range(cursor.row + transform.selection[0], + transform.selection[1], + cursor.row + transform.selection[2], + transform.selection[3])); + } + } + + if (session.getDocument().isNewLine(text)) { + var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); + + session.insert({row: cursor.row+1, column: 0}, lineIndent); + } + if (shouldOutdent) + mode.autoOutdent(lineState, session, cursor.row); + }; + + this.onTextInput = function(text) { + this.keyBinding.onTextInput(text); + }; + + this.onCommandKey = function(e, hashId, keyCode) { + this.keyBinding.onCommandKey(e, hashId, keyCode); + }; + this.setOverwrite = function(overwrite) { + this.session.setOverwrite(overwrite); + }; + this.getOverwrite = function() { + return this.session.getOverwrite(); + }; + this.toggleOverwrite = function() { + this.session.toggleOverwrite(); + }; + this.setScrollSpeed = function(speed) { + this.setOption("scrollSpeed", speed); + }; + this.getScrollSpeed = function() { + return this.getOption("scrollSpeed"); + }; + this.setDragDelay = function(dragDelay) { + this.setOption("dragDelay", dragDelay); + }; + this.getDragDelay = function() { + return this.getOption("dragDelay"); + }; + this.setSelectionStyle = function(val) { + this.setOption("selectionStyle", val); + }; + this.getSelectionStyle = function() { + return this.getOption("selectionStyle"); + }; + this.setHighlightActiveLine = function(shouldHighlight) { + this.setOption("highlightActiveLine", shouldHighlight); + }; + this.getHighlightActiveLine = function() { + return this.getOption("highlightActiveLine"); + }; + this.setHighlightGutterLine = function(shouldHighlight) { + this.setOption("highlightGutterLine", shouldHighlight); + }; + + this.getHighlightGutterLine = function() { + return this.getOption("highlightGutterLine"); + }; + this.setHighlightSelectedWord = function(shouldHighlight) { + this.setOption("highlightSelectedWord", shouldHighlight); + }; + this.getHighlightSelectedWord = function() { + return this.$highlightSelectedWord; + }; + + this.setAnimatedScroll = function(shouldAnimate){ + this.renderer.setAnimatedScroll(shouldAnimate); + }; + + this.getAnimatedScroll = function(){ + return this.renderer.getAnimatedScroll(); + }; + this.setShowInvisibles = function(showInvisibles) { + this.renderer.setShowInvisibles(showInvisibles); + }; + this.getShowInvisibles = function() { + return this.renderer.getShowInvisibles(); + }; + + this.setDisplayIndentGuides = function(display) { + this.renderer.setDisplayIndentGuides(display); + }; + + this.getDisplayIndentGuides = function() { + return this.renderer.getDisplayIndentGuides(); + }; + this.setShowPrintMargin = function(showPrintMargin) { + this.renderer.setShowPrintMargin(showPrintMargin); + }; + this.getShowPrintMargin = function() { + return this.renderer.getShowPrintMargin(); + }; + this.setPrintMarginColumn = function(showPrintMargin) { + this.renderer.setPrintMarginColumn(showPrintMargin); + }; + this.getPrintMarginColumn = function() { + return this.renderer.getPrintMarginColumn(); + }; + this.setReadOnly = function(readOnly) { + this.setOption("readOnly", readOnly); + }; + this.getReadOnly = function() { + return this.getOption("readOnly"); + }; + this.setBehavioursEnabled = function (enabled) { + this.setOption("behavioursEnabled", enabled); + }; + this.getBehavioursEnabled = function () { + return this.getOption("behavioursEnabled"); + }; + this.setWrapBehavioursEnabled = function (enabled) { + this.setOption("wrapBehavioursEnabled", enabled); + }; + this.getWrapBehavioursEnabled = function () { + return this.getOption("wrapBehavioursEnabled"); + }; + this.setShowFoldWidgets = function(show) { + this.setOption("showFoldWidgets", show); + + }; + this.getShowFoldWidgets = function() { + return this.getOption("showFoldWidgets"); + }; + + this.setFadeFoldWidgets = function(fade) { + this.setOption("fadeFoldWidgets", fade); + }; + + this.getFadeFoldWidgets = function() { + return this.getOption("fadeFoldWidgets"); + }; + this.remove = function(dir) { + if (this.selection.isEmpty()){ + if (dir == "left") + this.selection.selectLeft(); + else + this.selection.selectRight(); + } + + var range = this.getSelectionRange(); + if (this.getBehavioursEnabled()) { + var session = this.session; + var state = session.getState(range.start.row); + var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); + + if (range.end.column === 0) { + var text = session.getTextRange(range); + if (text[text.length - 1] == "\n") { + var line = session.getLine(range.end.row); + if (/^\s+$/.test(line)) { + range.end.column = line.length; + } + } + } + if (new_range) + range = new_range; + } + + this.session.remove(range); + this.clearSelection(); + }; + this.removeWordRight = function() { + if (this.selection.isEmpty()) + this.selection.selectWordRight(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeWordLeft = function() { + if (this.selection.isEmpty()) + this.selection.selectWordLeft(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeToLineStart = function() { + if (this.selection.isEmpty()) + this.selection.selectLineStart(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeToLineEnd = function() { + if (this.selection.isEmpty()) + this.selection.selectLineEnd(); + + var range = this.getSelectionRange(); + if (range.start.column == range.end.column && range.start.row == range.end.row) { + range.end.column = 0; + range.end.row++; + } + + this.session.remove(range); + this.clearSelection(); + }; + this.splitLine = function() { + if (!this.selection.isEmpty()) { + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + } + + var cursor = this.getCursorPosition(); + this.insert("\n"); + this.moveCursorToPosition(cursor); + }; + this.transposeLetters = function() { + if (!this.selection.isEmpty()) { + return; + } + + var cursor = this.getCursorPosition(); + var column = cursor.column; + if (column === 0) + return; + + var line = this.session.getLine(cursor.row); + var swap, range; + if (column < line.length) { + swap = line.charAt(column) + line.charAt(column-1); + range = new Range(cursor.row, column-1, cursor.row, column+1); + } + else { + swap = line.charAt(column-1) + line.charAt(column-2); + range = new Range(cursor.row, column-2, cursor.row, column); + } + this.session.replace(range, swap); + }; + this.toLowerCase = function() { + var originalRange = this.getSelectionRange(); + if (this.selection.isEmpty()) { + this.selection.selectWord(); + } + + var range = this.getSelectionRange(); + var text = this.session.getTextRange(range); + this.session.replace(range, text.toLowerCase()); + this.selection.setSelectionRange(originalRange); + }; + this.toUpperCase = function() { + var originalRange = this.getSelectionRange(); + if (this.selection.isEmpty()) { + this.selection.selectWord(); + } + + var range = this.getSelectionRange(); + var text = this.session.getTextRange(range); + this.session.replace(range, text.toUpperCase()); + this.selection.setSelectionRange(originalRange); + }; + this.indent = function() { + var session = this.session; + var range = this.getSelectionRange(); + + if (range.start.row < range.end.row) { + var rows = this.$getSelectedRows(); + session.indentRows(rows.first, rows.last, "\t"); + return; + } else if (range.start.column < range.end.column) { + var text = session.getTextRange(range); + if (!/^\s+$/.test(text)) { + var rows = this.$getSelectedRows(); + session.indentRows(rows.first, rows.last, "\t"); + return; + } + } + + var line = session.getLine(range.start.row); + var position = range.start; + var size = session.getTabSize(); + var column = session.documentToScreenColumn(position.row, position.column); + + if (this.session.getUseSoftTabs()) { + var count = (size - column % size); + var indentString = lang.stringRepeat(" ", count); + } else { + var count = column % size; + while (line[range.start.column] == " " && count) { + range.start.column--; + count--; + } + this.selection.setSelectionRange(range); + indentString = "\t"; + } + return this.insert(indentString); + }; + this.blockIndent = function() { + var rows = this.$getSelectedRows(); + this.session.indentRows(rows.first, rows.last, "\t"); + }; + this.blockOutdent = function() { + var selection = this.session.getSelection(); + this.session.outdentRows(selection.getRange()); + }; + this.sortLines = function() { + var rows = this.$getSelectedRows(); + var session = this.session; + + var lines = []; + for (i = rows.first; i <= rows.last; i++) + lines.push(session.getLine(i)); + + lines.sort(function(a, b) { + if (a.toLowerCase() < b.toLowerCase()) return -1; + if (a.toLowerCase() > b.toLowerCase()) return 1; + return 0; + }); + + var deleteRange = new Range(0, 0, 0, 0); + for (var i = rows.first; i <= rows.last; i++) { + var line = session.getLine(i); + deleteRange.start.row = i; + deleteRange.end.row = i; + deleteRange.end.column = line.length; + session.replace(deleteRange, lines[i-rows.first]); + } + }; + this.toggleCommentLines = function() { + var state = this.session.getState(this.getCursorPosition().row); + var rows = this.$getSelectedRows(); + this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); + }; + + this.toggleBlockComment = function() { + var cursor = this.getCursorPosition(); + var state = this.session.getState(cursor.row); + var range = this.getSelectionRange(); + this.session.getMode().toggleBlockComment(state, this.session, range, cursor); + }; + this.getNumberAt = function(row, column) { + var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; + _numberRx.lastIndex = 0; + + var s = this.session.getLine(row); + while (_numberRx.lastIndex < column) { + var m = _numberRx.exec(s); + if(m.index <= column && m.index+m[0].length >= column){ + var number = { + value: m[0], + start: m.index, + end: m.index+m[0].length + }; + return number; + } + } + return null; + }; + this.modifyNumber = function(amount) { + var row = this.selection.getCursor().row; + var column = this.selection.getCursor().column; + var charRange = new Range(row, column-1, row, column); + + var c = this.session.getTextRange(charRange); + if (!isNaN(parseFloat(c)) && isFinite(c)) { + var nr = this.getNumberAt(row, column); + if (nr) { + var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end; + var decimals = nr.start + nr.value.length - fp; + + var t = parseFloat(nr.value); + t *= Math.pow(10, decimals); + + + if(fp !== nr.end && column < fp){ + amount *= Math.pow(10, nr.end - column - 1); + } else { + amount *= Math.pow(10, nr.end - column); + } + + t += amount; + t /= Math.pow(10, decimals); + var nnr = t.toFixed(decimals); + var replaceRange = new Range(row, nr.start, row, nr.end); + this.session.replace(replaceRange, nnr); + this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length)); + + } + } + }; + this.removeLines = function() { + var rows = this.$getSelectedRows(); + var range; + if (rows.first === 0 || rows.last+1 < this.session.getLength()) + range = new Range(rows.first, 0, rows.last+1, 0); + else + range = new Range( + rows.first-1, this.session.getLine(rows.first-1).length, + rows.last, this.session.getLine(rows.last).length + ); + this.session.remove(range); + this.clearSelection(); + }; + + this.duplicateSelection = function() { + var sel = this.selection; + var doc = this.session; + var range = sel.getRange(); + var reverse = sel.isBackwards(); + if (range.isEmpty()) { + var row = range.start.row; + doc.duplicateLines(row, row); + } else { + var point = reverse ? range.start : range.end; + var endPoint = doc.insert(point, doc.getTextRange(range), false); + range.start = point; + range.end = endPoint; + + sel.setSelectionRange(range, reverse); + } + }; + this.moveLinesDown = function() { + this.$moveLines(1, false); + }; + this.moveLinesUp = function() { + this.$moveLines(-1, false); + }; + this.moveText = function(range, toPosition, copy) { + return this.session.moveText(range, toPosition, copy); + }; + this.copyLinesUp = function() { + this.$moveLines(-1, true); + }; + this.copyLinesDown = function() { + this.$moveLines(1, true); + }; + this.$moveLines = function(dir, copy) { + var rows, moved; + var selection = this.selection; + if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) { + var range = selection.toOrientedRange(); + rows = this.$getSelectedRows(range); + moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir); + if (copy && dir == -1) moved = 0; + range.moveBy(moved, 0); + selection.fromOrientedRange(range); + } else { + var ranges = selection.rangeList.ranges; + selection.rangeList.detach(this.session); + this.inVirtualSelectionMode = true; + + var diff = 0; + var totalDiff = 0; + var l = ranges.length; + for (var i = 0; i < l; i++) { + var rangeIndex = i; + ranges[i].moveBy(diff, 0); + rows = this.$getSelectedRows(ranges[i]); + var first = rows.first; + var last = rows.last; + while (++i < l) { + if (totalDiff) ranges[i].moveBy(totalDiff, 0); + var subRows = this.$getSelectedRows(ranges[i]); + if (copy && subRows.first != last) + break; + else if (!copy && subRows.first > last + 1) + break; + last = subRows.last; + } + i--; + diff = this.session.$moveLines(first, last, copy ? 0 : dir); + if (copy && dir == -1) rangeIndex = i + 1; + while (rangeIndex <= i) { + ranges[rangeIndex].moveBy(diff, 0); + rangeIndex++; + } + if (!copy) diff = 0; + totalDiff += diff; + } + + selection.fromOrientedRange(selection.ranges[0]); + selection.rangeList.attach(this.session); + this.inVirtualSelectionMode = false; + } + }; + this.$getSelectedRows = function(range) { + range = (range || this.getSelectionRange()).collapseRows(); + + return { + first: this.session.getRowFoldStart(range.start.row), + last: this.session.getRowFoldEnd(range.end.row) + }; + }; + + this.onCompositionStart = function(text) { + this.renderer.showComposition(this.getCursorPosition()); + }; + + this.onCompositionUpdate = function(text) { + this.renderer.setCompositionText(text); + }; + + this.onCompositionEnd = function() { + this.renderer.hideComposition(); + }; + this.getFirstVisibleRow = function() { + return this.renderer.getFirstVisibleRow(); + }; + this.getLastVisibleRow = function() { + return this.renderer.getLastVisibleRow(); + }; + this.isRowVisible = function(row) { + return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); + }; + this.isRowFullyVisible = function(row) { + return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow()); + }; + this.$getVisibleRowCount = function() { + return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; + }; + + this.$moveByPage = function(dir, select) { + var renderer = this.renderer; + var config = this.renderer.layerConfig; + var rows = dir * Math.floor(config.height / config.lineHeight); + + this.$blockScrolling++; + if (select === true) { + this.selection.$moveSelection(function(){ + this.moveCursorBy(rows, 0); + }); + } else if (select === false) { + this.selection.moveCursorBy(rows, 0); + this.selection.clearSelection(); + } + this.$blockScrolling--; + + var scrollTop = renderer.scrollTop; + + renderer.scrollBy(0, rows * config.lineHeight); + if (select != null) + renderer.scrollCursorIntoView(null, 0.5); + + renderer.animateScrolling(scrollTop); + }; + this.selectPageDown = function() { + this.$moveByPage(1, true); + }; + this.selectPageUp = function() { + this.$moveByPage(-1, true); + }; + this.gotoPageDown = function() { + this.$moveByPage(1, false); + }; + this.gotoPageUp = function() { + this.$moveByPage(-1, false); + }; + this.scrollPageDown = function() { + this.$moveByPage(1); + }; + this.scrollPageUp = function() { + this.$moveByPage(-1); + }; + this.scrollToRow = function(row) { + this.renderer.scrollToRow(row); + }; + this.scrollToLine = function(line, center, animate, callback) { + this.renderer.scrollToLine(line, center, animate, callback); + }; + this.centerSelection = function() { + var range = this.getSelectionRange(); + var pos = { + row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2), + column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2) + }; + this.renderer.alignCursor(pos, 0.5); + }; + this.getCursorPosition = function() { + return this.selection.getCursor(); + }; + this.getCursorPositionScreen = function() { + return this.session.documentToScreenPosition(this.getCursorPosition()); + }; + this.getSelectionRange = function() { + return this.selection.getRange(); + }; + this.selectAll = function() { + this.$blockScrolling += 1; + this.selection.selectAll(); + this.$blockScrolling -= 1; + }; + this.clearSelection = function() { + this.selection.clearSelection(); + }; + this.moveCursorTo = function(row, column) { + this.selection.moveCursorTo(row, column); + }; + this.moveCursorToPosition = function(pos) { + this.selection.moveCursorToPosition(pos); + }; + this.jumpToMatching = function(select, expand) { + var cursor = this.getCursorPosition(); + var iterator = new TokenIterator(this.session, cursor.row, cursor.column); + var prevToken = iterator.getCurrentToken(); + var token = prevToken || iterator.stepForward(); + + if (!token) return; + var matchType; + var found = false; + var depth = {}; + var i = cursor.column - token.start; + var bracketType; + var brackets = { + ")": "(", + "(": "(", + "]": "[", + "[": "[", + "{": "{", + "}": "{" + }; + + do { + if (token.value.match(/[{}()\[\]]/g)) { + for (; i < token.value.length && !found; i++) { + if (!brackets[token.value[i]]) { + continue; + } + + bracketType = brackets[token.value[i]] + '.' + token.type.replace("rparen", "lparen"); + + if (isNaN(depth[bracketType])) { + depth[bracketType] = 0; + } + + switch (token.value[i]) { + case '(': + case '[': + case '{': + depth[bracketType]++; + break; + case ')': + case ']': + case '}': + depth[bracketType]--; + + if (depth[bracketType] === -1) { + matchType = 'bracket'; + found = true; + } + break; + } + } + } + else if (token && token.type.indexOf('tag-name') !== -1) { + if (isNaN(depth[token.value])) { + depth[token.value] = 0; + } + + if (prevToken.value === '<') { + depth[token.value]++; + } + else if (prevToken.value === '= 0; --i) { + if(this.$tryReplace(ranges[i], replacement)) { + replaced++; + } + } + + this.selection.setSelectionRange(selection); + this.$blockScrolling -= 1; + + return replaced; + }; + + this.$tryReplace = function(range, replacement) { + var input = this.session.getTextRange(range); + replacement = this.$search.replace(input, replacement); + if (replacement !== null) { + range.end = this.session.replace(range, replacement); + return range; + } else { + return null; + } + }; + this.getLastSearchOptions = function() { + return this.$search.getOptions(); + }; + this.find = function(needle, options, animate) { + if (!options) + options = {}; + + if (typeof needle == "string" || needle instanceof RegExp) + options.needle = needle; + else if (typeof needle == "object") + oop.mixin(options, needle); + + var range = this.selection.getRange(); + if (options.needle == null) { + needle = this.session.getTextRange(range) + || this.$search.$options.needle; + if (!needle) { + range = this.session.getWordRange(range.start.row, range.start.column); + needle = this.session.getTextRange(range); + } + this.$search.set({needle: needle}); + } + + this.$search.set(options); + if (!options.start) + this.$search.set({start: range}); + + var newRange = this.$search.find(this.session); + if (options.preventScroll) + return newRange; + if (newRange) { + this.revealRange(newRange, animate); + return newRange; + } + if (options.backwards) + range.start = range.end; + else + range.end = range.start; + this.selection.setRange(range); + }; + this.findNext = function(options, animate) { + this.find({skipCurrent: true, backwards: false}, options, animate); + }; + this.findPrevious = function(options, animate) { + this.find(options, {skipCurrent: true, backwards: true}, animate); + }; + + this.revealRange = function(range, animate) { + this.$blockScrolling += 1; + this.session.unfold(range); + this.selection.setSelectionRange(range); + this.$blockScrolling -= 1; + + var scrollTop = this.renderer.scrollTop; + this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); + if (animate !== false) + this.renderer.animateScrolling(scrollTop); + }; + this.undo = function() { + this.$blockScrolling++; + this.session.getUndoManager().undo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); + }; + this.redo = function() { + this.$blockScrolling++; + this.session.getUndoManager().redo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); + }; + this.destroy = function() { + this.renderer.destroy(); + this._signal("destroy", this); + if (this.session) { + this.session.destroy(); + } + }; + this.setAutoScrollEditorIntoView = function(enable) { + if (!enable) + return; + var rect; + var self = this; + var shouldScroll = false; + if (!this.$scrollAnchor) + this.$scrollAnchor = document.createElement("div"); + var scrollAnchor = this.$scrollAnchor; + scrollAnchor.style.cssText = "position:absolute"; + this.container.insertBefore(scrollAnchor, this.container.firstChild); + var onChangeSelection = this.on("changeSelection", function() { + shouldScroll = true; + }); + var onBeforeRender = this.renderer.on("beforeRender", function() { + if (shouldScroll) + rect = self.renderer.container.getBoundingClientRect(); + }); + var onAfterRender = this.renderer.on("afterRender", function() { + if (shouldScroll && rect && (self.isFocused() + || self.searchBox && self.searchBox.isFocused()) + ) { + var renderer = self.renderer; + var pos = renderer.$cursorLayer.$pixelPos; + var config = renderer.layerConfig; + var top = pos.top - config.offset; + if (pos.top >= 0 && top + rect.top < 0) { + shouldScroll = true; + } else if (pos.top < config.height && + pos.top + rect.top + config.lineHeight > window.innerHeight) { + shouldScroll = false; + } else { + shouldScroll = null; + } + if (shouldScroll != null) { + scrollAnchor.style.top = top + "px"; + scrollAnchor.style.left = pos.left + "px"; + scrollAnchor.style.height = config.lineHeight + "px"; + scrollAnchor.scrollIntoView(shouldScroll); + } + shouldScroll = rect = null; + } + }); + this.setAutoScrollEditorIntoView = function(enable) { + if (enable) + return; + delete this.setAutoScrollEditorIntoView; + this.removeEventListener("changeSelection", onChangeSelection); + this.renderer.removeEventListener("afterRender", onAfterRender); + this.renderer.removeEventListener("beforeRender", onBeforeRender); + }; + }; + + + this.$resetCursorStyle = function() { + var style = this.$cursorStyle || "ace"; + var cursorLayer = this.renderer.$cursorLayer; + if (!cursorLayer) + return; + cursorLayer.setSmoothBlinking(/smooth/.test(style)); + cursorLayer.isBlinking = !this.$readOnly && style != "wide"; + dom.setCssClass(cursorLayer.element, "ace_slim-cursors", /slim/.test(style)); + }; + + }).call(Editor.prototype); + + + + config.defineOptions(Editor.prototype, "editor", { + selectionStyle: { + set: function(style) { + this.onSelectionChange(); + this._signal("changeSelectionStyle", {data: style}); + }, + initialValue: "line" + }, + highlightActiveLine: { + set: function() {this.$updateHighlightActiveLine();}, + initialValue: true + }, + highlightSelectedWord: { + set: function(shouldHighlight) {this.$onSelectionChange();}, + initialValue: true + }, + readOnly: { + set: function(readOnly) { + this.$resetCursorStyle(); + }, + initialValue: false + }, + cursorStyle: { + set: function(val) { this.$resetCursorStyle(); }, + values: ["ace", "slim", "smooth", "wide"], + initialValue: "ace" + }, + mergeUndoDeltas: { + values: [false, true, "always"], + initialValue: true + }, + behavioursEnabled: {initialValue: true}, + wrapBehavioursEnabled: {initialValue: true}, + autoScrollEditorIntoView: { + set: function(val) {this.setAutoScrollEditorIntoView(val)} + }, + + hScrollBarAlwaysVisible: "renderer", + vScrollBarAlwaysVisible: "renderer", + highlightGutterLine: "renderer", + animatedScroll: "renderer", + showInvisibles: "renderer", + showPrintMargin: "renderer", + printMarginColumn: "renderer", + printMargin: "renderer", + fadeFoldWidgets: "renderer", + showFoldWidgets: "renderer", + showLineNumbers: "renderer", + showGutter: "renderer", + displayIndentGuides: "renderer", + fontSize: "renderer", + fontFamily: "renderer", + maxLines: "renderer", + minLines: "renderer", + scrollPastEnd: "renderer", + fixedWidthGutter: "renderer", + theme: "renderer", + + scrollSpeed: "$mouseHandler", + dragDelay: "$mouseHandler", + dragEnabled: "$mouseHandler", + focusTimout: "$mouseHandler", + tooltipFollowsMouse: "$mouseHandler", + + firstLineNumber: "session", + overwrite: "session", + newLineMode: "session", + useWorker: "session", + useSoftTabs: "session", + tabSize: "session", + wrap: "session", + foldStyle: "session", + mode: "session" + }); + + exports.Editor = Editor; + }); + + ace.define("ace/undomanager",["require","exports","module"], function(acequire, exports, module) { + "use strict"; + var UndoManager = function() { + this.reset(); + }; + + (function() { + this.execute = function(options) { + var deltas = options.args[0]; + this.$doc = options.args[1]; + if (options.merge && this.hasUndo()){ + this.dirtyCounter--; + deltas = this.$undoStack.pop().concat(deltas); + } + this.$undoStack.push(deltas); + this.$redoStack = []; + + if (this.dirtyCounter < 0) { + this.dirtyCounter = NaN; + } + this.dirtyCounter++; + }; + this.undo = function(dontSelect) { + var deltas = this.$undoStack.pop(); + var undoSelectionRange = null; + if (deltas) { + undoSelectionRange = + this.$doc.undoChanges(deltas, dontSelect); + this.$redoStack.push(deltas); + this.dirtyCounter--; + } + + return undoSelectionRange; + }; + this.redo = function(dontSelect) { + var deltas = this.$redoStack.pop(); + var redoSelectionRange = null; + if (deltas) { + redoSelectionRange = + this.$doc.redoChanges(deltas, dontSelect); + this.$undoStack.push(deltas); + this.dirtyCounter++; + } + + return redoSelectionRange; + }; + this.reset = function() { + this.$undoStack = []; + this.$redoStack = []; + this.dirtyCounter = 0; + }; + this.hasUndo = function() { + return this.$undoStack.length > 0; + }; + this.hasRedo = function() { + return this.$redoStack.length > 0; + }; + this.markClean = function() { + this.dirtyCounter = 0; + }; + this.isClean = function() { + return this.dirtyCounter === 0; + }; + + }).call(UndoManager.prototype); + + exports.UndoManager = UndoManager; + }); + + ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter"], function(acequire, exports, module) { + "use strict"; + + var dom = acequire("../lib/dom"); + var oop = acequire("../lib/oop"); + var lang = acequire("../lib/lang"); + var EventEmitter = acequire("../lib/event_emitter").EventEmitter; + + var Gutter = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_gutter-layer"; + parentEl.appendChild(this.element); + this.setShowFoldWidgets(this.$showFoldWidgets); + + this.gutterWidth = 0; + + this.$annotations = []; + this.$updateAnnotations = this.$updateAnnotations.bind(this); + + this.$cells = []; + }; + + (function() { + + oop.implement(this, EventEmitter); + + this.setSession = function(session) { + if (this.session) + this.session.removeEventListener("change", this.$updateAnnotations); + this.session = session; + if (session) + session.on("change", this.$updateAnnotations); + }; + + this.addGutterDecoration = function(row, className){ + if (window.console) + console.warn && console.warn("deprecated use session.addGutterDecoration"); + this.session.addGutterDecoration(row, className); + }; + + this.removeGutterDecoration = function(row, className){ + if (window.console) + console.warn && console.warn("deprecated use session.removeGutterDecoration"); + this.session.removeGutterDecoration(row, className); + }; + + this.setAnnotations = function(annotations) { + this.$annotations = []; + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + var row = annotation.row; + var rowInfo = this.$annotations[row]; + if (!rowInfo) + rowInfo = this.$annotations[row] = {text: []}; + + var annoText = annotation.text; + annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || ""; + + if (rowInfo.text.indexOf(annoText) === -1) + rowInfo.text.push(annoText); + + var type = annotation.type; + if (type == "error") + rowInfo.className = " ace_error"; + else if (type == "warning" && rowInfo.className != " ace_error") + rowInfo.className = " ace_warning"; + else if (type == "info" && (!rowInfo.className)) + rowInfo.className = " ace_info"; + } + }; + + this.$updateAnnotations = function (e) { + if (!this.$annotations.length) + return; + var delta = e.data; + var range = delta.range; + var firstRow = range.start.row; + var len = range.end.row - firstRow; + if (len === 0) { + } else if (delta.action == "removeText" || delta.action == "removeLines") { + this.$annotations.splice(firstRow, len + 1, null); + } else { + var args = new Array(len + 1); + args.unshift(firstRow, 1); + this.$annotations.splice.apply(this.$annotations, args); + } + }; + + this.update = function(config) { + var session = this.session; + var firstRow = config.firstRow; + var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar + session.getLength() - 1); + var fold = session.getNextFoldLine(firstRow); + var foldStart = fold ? fold.start.row : Infinity; + var foldWidgets = this.$showFoldWidgets && session.foldWidgets; + var breakpoints = session.$breakpoints; + var decorations = session.$decorations; + var firstLineNumber = session.$firstLineNumber; + var lastLineNumber = 0; + + var gutterRenderer = session.gutterRenderer || this.$renderer; + + var cell = null; + var index = -1; + var row = firstRow; + while (true) { + if (row > foldStart) { + row = fold.end.row + 1; + fold = session.getNextFoldLine(row, fold); + foldStart = fold ? fold.start.row : Infinity; + } + if (row > lastRow) { + while (this.$cells.length > index + 1) { + cell = this.$cells.pop(); + this.element.removeChild(cell.element); + } + break; + } + + cell = this.$cells[++index]; + if (!cell) { + cell = {element: null, textNode: null, foldWidget: null}; + cell.element = dom.createElement("div"); + cell.textNode = document.createTextNode(''); + cell.element.appendChild(cell.textNode); + this.element.appendChild(cell.element); + this.$cells[index] = cell; + } + + var className = "ace_gutter-cell "; + if (breakpoints[row]) + className += breakpoints[row]; + if (decorations[row]) + className += decorations[row]; + if (this.$annotations[row]) + className += this.$annotations[row].className; + if (cell.element.className != className) + cell.element.className = className; + + var height = session.getRowLength(row) * config.lineHeight + "px"; + if (height != cell.element.style.height) + cell.element.style.height = height; + + if (foldWidgets) { + var c = foldWidgets[row]; + if (c == null) + c = foldWidgets[row] = session.getFoldWidget(row); + } + + if (c) { + if (!cell.foldWidget) { + cell.foldWidget = dom.createElement("span"); + cell.element.appendChild(cell.foldWidget); + } + var className = "ace_fold-widget ace_" + c; + if (c == "start" && row == foldStart && row < fold.end.row) + className += " ace_closed"; + else + className += " ace_open"; + if (cell.foldWidget.className != className) + cell.foldWidget.className = className; + + var height = config.lineHeight + "px"; + if (cell.foldWidget.style.height != height) + cell.foldWidget.style.height = height; + } else { + if (cell.foldWidget) { + cell.element.removeChild(cell.foldWidget); + cell.foldWidget = null; + } + } + + var text = lastLineNumber = gutterRenderer + ? gutterRenderer.getText(session, row) + : row + firstLineNumber; + if (text != cell.textNode.data) + cell.textNode.data = text; + + row++; + } + + this.element.style.height = config.minHeight + "px"; + + if (this.$fixedWidth || session.$useWrapMode) + lastLineNumber = session.getLength() + firstLineNumber; + + var gutterWidth = gutterRenderer + ? gutterRenderer.getWidth(session, lastLineNumber, config) + : lastLineNumber.toString().length * config.characterWidth; + + var padding = this.$padding || this.$computePadding(); + gutterWidth += padding.left + padding.right; + if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) { + this.gutterWidth = gutterWidth; + this.element.style.width = Math.ceil(this.gutterWidth) + "px"; + this._emit("changeGutterWidth", gutterWidth); + } + }; + + this.$fixedWidth = false; + + this.$showLineNumbers = true; + this.$renderer = ""; + this.setShowLineNumbers = function(show) { + this.$renderer = !show && { + getWidth: function() {return ""}, + getText: function() {return ""} + }; + }; + + this.getShowLineNumbers = function() { + return this.$showLineNumbers; + }; + + this.$showFoldWidgets = true; + this.setShowFoldWidgets = function(show) { + if (show) + dom.addCssClass(this.element, "ace_folding-enabled"); + else + dom.removeCssClass(this.element, "ace_folding-enabled"); + + this.$showFoldWidgets = show; + this.$padding = null; + }; + + this.getShowFoldWidgets = function() { + return this.$showFoldWidgets; + }; + + this.$computePadding = function() { + if (!this.element.firstChild) + return {left: 0, right: 0}; + var style = dom.computedStyle(this.element.firstChild); + this.$padding = {}; + this.$padding.left = parseInt(style.paddingLeft) + 1 || 0; + this.$padding.right = parseInt(style.paddingRight) || 0; + return this.$padding; + }; + + this.getRegion = function(point) { + var padding = this.$padding || this.$computePadding(); + var rect = this.element.getBoundingClientRect(); + if (point.x < padding.left + rect.left) + return "markers"; + if (this.$showFoldWidgets && point.x > rect.right - padding.right) + return "foldWidgets"; + }; + + }).call(Gutter.prototype); + + exports.Gutter = Gutter; + + }); + + ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"], function(acequire, exports, module) { + "use strict"; + + var Range = acequire("../range").Range; + var dom = acequire("../lib/dom"); + + var Marker = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_marker-layer"; + parentEl.appendChild(this.element); + }; + + (function() { + + this.$padding = 0; + + this.setPadding = function(padding) { + this.$padding = padding; + }; + this.setSession = function(session) { + this.session = session; + }; + + this.setMarkers = function(markers) { + this.markers = markers; + }; + + this.update = function(config) { + var config = config || this.config; + if (!config) + return; + + this.config = config; + + + var html = []; + for (var key in this.markers) { + var marker = this.markers[key]; + + if (!marker.range) { + marker.update(html, this, this.session, config); + continue; + } + + var range = marker.range.clipRows(config.firstRow, config.lastRow); + if (range.isEmpty()) continue; + + range = range.toScreenRange(this.session); + if (marker.renderer) { + var top = this.$getTop(range.start.row, config); + var left = this.$padding + range.start.column * config.characterWidth; + marker.renderer(html, range, left, top, config); + } else if (marker.type == "fullLine") { + this.drawFullLineMarker(html, range, marker.clazz, config); + } else if (marker.type == "screenLine") { + this.drawScreenLineMarker(html, range, marker.clazz, config); + } else if (range.isMultiLine()) { + if (marker.type == "text") + this.drawTextMarker(html, range, marker.clazz, config); + else + this.drawMultiLineMarker(html, range, marker.clazz, config); + } else { + this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config); + } + } + this.element.innerHTML = html.join(""); + }; + + this.$getTop = function(row, layerConfig) { + return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; + }; + this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) { + var row = range.start.row; + + var lineRange = new Range( + row, range.start.column, + row, this.session.getScreenLastRowColumn(row) + ); + this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " ace_start", layerConfig, 1, extraStyle); + row = range.end.row; + lineRange = new Range(row, 0, row, range.end.column); + this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, extraStyle); + + for (row = range.start.row + 1; row < range.end.row; row++) { + lineRange.start.row = row; + lineRange.end.row = row; + lineRange.end.column = this.session.getScreenLastRowColumn(row); + this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, extraStyle); + } + }; + this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var padding = this.$padding; + var height = config.lineHeight; + var top = this.$getTop(range.start.row, config); + var left = padding + range.start.column * config.characterWidth; + extraStyle = extraStyle || ""; + + stringBuilder.push( + "
    " + ); + top = this.$getTop(range.end.row, config); + var width = range.end.column * config.characterWidth; + + stringBuilder.push( + "
    " + ); + height = (range.end.row - range.start.row - 1) * config.lineHeight; + if (height < 0) + return; + top = this.$getTop(range.start.row + 1, config); + + stringBuilder.push( + "
    " + ); + }; + this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { + var height = config.lineHeight; + var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; + + var top = this.$getTop(range.start.row, config); + var left = this.$padding + range.start.column * config.characterWidth; + + stringBuilder.push( + "
    " + ); + }; + + this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var top = this.$getTop(range.start.row, config); + var height = config.lineHeight; + if (range.start.row != range.end.row) + height += this.$getTop(range.end.row, config) - top; + + stringBuilder.push( + "
    " + ); + }; + + this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var top = this.$getTop(range.start.row, config); + var height = config.lineHeight; + + stringBuilder.push( + "
    " + ); + }; + + }).call(Marker.prototype); + + exports.Marker = Marker; + + }); + + ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("../lib/oop"); + var dom = acequire("../lib/dom"); + var lang = acequire("../lib/lang"); + var useragent = acequire("../lib/useragent"); + var EventEmitter = acequire("../lib/event_emitter").EventEmitter; + + var Text = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_text-layer"; + parentEl.appendChild(this.element); + this.$updateEolChar = this.$updateEolChar.bind(this); + }; + + (function() { + + oop.implement(this, EventEmitter); + + this.EOF_CHAR = "\xB6"; + this.EOL_CHAR_LF = "\xAC"; + this.EOL_CHAR_CRLF = "\xa4"; + this.EOL_CHAR = this.EOL_CHAR_LF; + this.TAB_CHAR = "\u2192"; //"\u21E5"; + this.SPACE_CHAR = "\xB7"; + this.$padding = 0; + + this.$updateEolChar = function() { + var EOL_CHAR = this.session.doc.getNewLineCharacter() == "\n" + ? this.EOL_CHAR_LF + : this.EOL_CHAR_CRLF; + if (this.EOL_CHAR != EOL_CHAR) { + this.EOL_CHAR = EOL_CHAR; + return true; + } + } + + this.setPadding = function(padding) { + this.$padding = padding; + this.element.style.padding = "0 " + padding + "px"; + }; + + this.getLineHeight = function() { + return this.$fontMetrics.$characterSize.height || 0; + }; + + this.getCharacterWidth = function() { + return this.$fontMetrics.$characterSize.width || 0; + }; + + this.$setFontMetrics = function(measure) { + this.$fontMetrics = measure; + this.$fontMetrics.on("changeCharacterSize", function(e) { + this._signal("changeCharacterSize", e); + }.bind(this)); + this.$pollSizeChanges(); + } + + this.checkForSizeChanges = function() { + this.$fontMetrics.checkForSizeChanges(); + }; + this.$pollSizeChanges = function() { + return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges(); + }; + this.setSession = function(session) { + this.session = session; + if (session) + this.$computeTabString(); + }; + + this.showInvisibles = false; + this.setShowInvisibles = function(showInvisibles) { + if (this.showInvisibles == showInvisibles) + return false; + + this.showInvisibles = showInvisibles; + this.$computeTabString(); + return true; + }; + + this.displayIndentGuides = true; + this.setDisplayIndentGuides = function(display) { + if (this.displayIndentGuides == display) + return false; + + this.displayIndentGuides = display; + this.$computeTabString(); + return true; + }; + + this.$tabStrings = []; + this.onChangeTabSize = + this.$computeTabString = function() { + var tabSize = this.session.getTabSize(); + this.tabSize = tabSize; + var tabStr = this.$tabStrings = [0]; + for (var i = 1; i < tabSize + 1; i++) { + if (this.showInvisibles) { + tabStr.push("" + + this.TAB_CHAR + + lang.stringRepeat(" ", i - 1) + + ""); + } else { + tabStr.push(lang.stringRepeat(" ", i)); + } + } + if (this.displayIndentGuides) { + this.$indentGuideRe = /\s\S| \t|\t |\s$/; + var className = "ace_indent-guide"; + var spaceClass = ""; + var tabClass = ""; + if (this.showInvisibles) { + className += " ace_invisible"; + spaceClass = " ace_invisible_space"; + tabClass = " ace_invisible_tab"; + var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); + var tabContent = this.TAB_CHAR + lang.stringRepeat(" ", this.tabSize - 1); + } else{ + var spaceContent = lang.stringRepeat(" ", this.tabSize); + var tabContent = spaceContent; + } + + this.$tabStrings[" "] = "" + spaceContent + ""; + this.$tabStrings["\t"] = "" + tabContent + ""; + } + }; + + this.updateLines = function(config, firstRow, lastRow) { + if (this.config.lastRow != config.lastRow || + this.config.firstRow != config.firstRow) { + this.scrollLines(config); + } + this.config = config; + + var first = Math.max(firstRow, config.firstRow); + var last = Math.min(lastRow, config.lastRow); + + var lineElements = this.element.childNodes; + var lineElementsIdx = 0; + + for (var row = config.firstRow; row < first; row++) { + var foldLine = this.session.getFoldLine(row); + if (foldLine) { + if (foldLine.containsRow(first)) { + first = foldLine.start.row; + break; + } else { + row = foldLine.end.row; + } + } + lineElementsIdx ++; + } + + var row = first; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row :Infinity; + } + if (row > last) + break; + + var lineElement = lineElements[lineElementsIdx++]; + if (lineElement) { + var html = []; + this.$renderLine( + html, row, !this.$useLineGroups(), row == foldStart ? foldLine : false + ); + lineElement.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; + lineElement.innerHTML = html.join(""); + } + row++; + } + }; + + this.scrollLines = function(config) { + var oldConfig = this.config; + this.config = config; + + if (!oldConfig || oldConfig.lastRow < config.firstRow) + return this.update(config); + + if (config.lastRow < oldConfig.firstRow) + return this.update(config); + + var el = this.element; + if (oldConfig.firstRow < config.firstRow) + for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) + el.removeChild(el.firstChild); + + if (oldConfig.lastRow > config.lastRow) + for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--) + el.removeChild(el.lastChild); + + if (config.firstRow < oldConfig.firstRow) { + var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1); + if (el.firstChild) + el.insertBefore(fragment, el.firstChild); + else + el.appendChild(fragment); + } + + if (config.lastRow > oldConfig.lastRow) { + var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow); + el.appendChild(fragment); + } + }; + + this.$renderLinesFragment = function(config, firstRow, lastRow) { + var fragment = this.element.ownerDocument.createDocumentFragment(); + var row = firstRow; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row : Infinity; + } + if (row > lastRow) + break; + + var container = dom.createElement("div"); + + var html = []; + this.$renderLine(html, row, false, row == foldStart ? foldLine : false); + container.innerHTML = html.join(""); + if (this.$useLineGroups()) { + container.className = 'ace_line_group'; + fragment.appendChild(container); + container.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; + + } else { + while(container.firstChild) + fragment.appendChild(container.firstChild); + } + + row++; + } + return fragment; + }; + + this.update = function(config) { + this.config = config; + + var html = []; + var firstRow = config.firstRow, lastRow = config.lastRow; + + var row = firstRow; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row :Infinity; + } + if (row > lastRow) + break; + + if (this.$useLineGroups()) + html.push("
    ") + + this.$renderLine(html, row, false, row == foldStart ? foldLine : false); + + if (this.$useLineGroups()) + html.push("
    "); // end the line group + + row++; + } + this.element.innerHTML = html.join(""); + }; + + this.$textToken = { + "text": true, + "rparen": true, + "lparen": true + }; + + this.$renderToken = function(stringBuilder, screenColumn, token, value) { + var self = this; + var replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; + var replaceFunc = function(c, a, b, tabIdx, idx4) { + if (a) { + return self.showInvisibles + ? "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" + : c; + } else if (c == "&") { + return "&"; + } else if (c == "<") { + return "<"; + } else if (c == "\t") { + var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); + screenColumn += tabSize - 1; + return self.$tabStrings[tabSize]; + } else if (c == "\u3000") { + var classToUse = self.showInvisibles ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk"; + var space = self.showInvisibles ? self.SPACE_CHAR : ""; + screenColumn += 1; + return "" + space + ""; + } else if (b) { + return "" + self.SPACE_CHAR + ""; + } else { + screenColumn += 1; + return "" + c + ""; + } + }; + + var output = value.replace(replaceReg, replaceFunc); + + if (!this.$textToken[token.type]) { + var classes = "ace_" + token.type.replace(/\./g, " ace_"); + var style = ""; + if (token.type == "fold") + style = " style='width:" + (token.value.length * this.config.characterWidth) + "px;' "; + stringBuilder.push("", output, ""); + } + else { + stringBuilder.push(output); + } + return screenColumn + value.length; + }; + + this.renderIndentGuide = function(stringBuilder, value, max) { + var cols = value.search(this.$indentGuideRe); + if (cols <= 0 || cols >= max) + return value; + if (value[0] == " ") { + cols -= cols % this.tabSize; + stringBuilder.push(lang.stringRepeat(this.$tabStrings[" "], cols/this.tabSize)); + return value.substr(cols); + } else if (value[0] == "\t") { + stringBuilder.push(lang.stringRepeat(this.$tabStrings["\t"], cols)); + return value.substr(cols); + } + return value; + }; + + this.$renderWrappedLine = function(stringBuilder, tokens, splits, onlyContents) { + var chars = 0; + var split = 0; + var splitChars = splits[0]; + var screenColumn = 0; + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + var value = token.value; + if (i == 0 && this.displayIndentGuides) { + chars = value.length; + value = this.renderIndentGuide(stringBuilder, value, splitChars); + if (!value) + continue; + chars -= value.length; + } + + if (chars + value.length < splitChars) { + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + chars += value.length; + } else { + while (chars + value.length >= splitChars) { + screenColumn = this.$renderToken( + stringBuilder, screenColumn, + token, value.substring(0, splitChars - chars) + ); + value = value.substring(splitChars - chars); + chars = splitChars; + + if (!onlyContents) { + stringBuilder.push("
    ", + "
    " + ); + } + + split ++; + screenColumn = 0; + splitChars = splits[split] || Number.MAX_VALUE; + } + if (value.length != 0) { + chars += value.length; + screenColumn = this.$renderToken( + stringBuilder, screenColumn, token, value + ); + } + } + } + }; + + this.$renderSimpleLine = function(stringBuilder, tokens) { + var screenColumn = 0; + var token = tokens[0]; + var value = token.value; + if (this.displayIndentGuides) + value = this.renderIndentGuide(stringBuilder, value); + if (value) + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + for (var i = 1; i < tokens.length; i++) { + token = tokens[i]; + value = token.value; + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + } + }; + this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) { + if (!foldLine && foldLine != false) + foldLine = this.session.getFoldLine(row); + + if (foldLine) + var tokens = this.$getFoldLineTokens(row, foldLine); + else + var tokens = this.session.getTokens(row); + + + if (!onlyContents) { + stringBuilder.push( + "
    " + ); + } + + if (tokens.length) { + var splits = this.session.getRowSplitData(row); + if (splits && splits.length) + this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents); + else + this.$renderSimpleLine(stringBuilder, tokens); + } + + if (this.showInvisibles) { + if (foldLine) + row = foldLine.end.row + + stringBuilder.push( + "", + row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, + "" + ); + } + if (!onlyContents) + stringBuilder.push("
    "); + }; + + this.$getFoldLineTokens = function(row, foldLine) { + var session = this.session; + var renderTokens = []; + + function addTokens(tokens, from, to) { + var idx = 0, col = 0; + while ((col + tokens[idx].value.length) < from) { + col += tokens[idx].value.length; + idx++; + + if (idx == tokens.length) + return; + } + if (col != from) { + var value = tokens[idx].value.substring(from - col); + if (value.length > (to - from)) + value = value.substring(0, to - from); + + renderTokens.push({ + type: tokens[idx].type, + value: value + }); + + col = from + value.length; + idx += 1; + } + + while (col < to && idx < tokens.length) { + var value = tokens[idx].value; + if (value.length + col > to) { + renderTokens.push({ + type: tokens[idx].type, + value: value.substring(0, to - col) + }); + } else + renderTokens.push(tokens[idx]); + col += value.length; + idx += 1; + } + } + + var tokens = session.getTokens(row); + foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { + if (placeholder != null) { + renderTokens.push({ + type: "fold", + value: placeholder + }); + } else { + if (isNewRow) + tokens = session.getTokens(row); + + if (tokens.length) + addTokens(tokens, lastColumn, column); + } + }, foldLine.end.row, this.session.getLine(foldLine.end.row).length); + + return renderTokens; + }; + + this.$useLineGroups = function() { + return this.session.getUseWrapMode(); + }; + + this.destroy = function() { + clearInterval(this.$pollSizeChangesTimer); + if (this.$measureNode) + this.$measureNode.parentNode.removeChild(this.$measureNode); + delete this.$measureNode; + }; + + }).call(Text.prototype); + + exports.Text = Text; + + }); + + ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { + "use strict"; + + var dom = acequire("../lib/dom"); + var IE8; + + var Cursor = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_cursor-layer"; + parentEl.appendChild(this.element); + + if (IE8 === undefined) + IE8 = "opacity" in this.element; + + this.isVisible = false; + this.isBlinking = true; + this.blinkInterval = 1000; + this.smoothBlinking = false; + + this.cursors = []; + this.cursor = this.addCursor(); + dom.addCssClass(this.element, "ace_hidden-cursors"); + this.$updateCursors = this.$updateVisibility.bind(this); + }; + + (function() { + + this.$updateVisibility = function(val) { + var cursors = this.cursors; + for (var i = cursors.length; i--; ) + cursors[i].style.visibility = val ? "" : "hidden"; + }; + this.$updateOpacity = function(val) { + var cursors = this.cursors; + for (var i = cursors.length; i--; ) + cursors[i].style.opacity = val ? "" : "0"; + }; + + + this.$padding = 0; + this.setPadding = function(padding) { + this.$padding = padding; + }; + + this.setSession = function(session) { + this.session = session; + }; + + this.setBlinking = function(blinking) { + if (blinking != this.isBlinking){ + this.isBlinking = blinking; + this.restartTimer(); + } + }; + + this.setBlinkInterval = function(blinkInterval) { + if (blinkInterval != this.blinkInterval){ + this.blinkInterval = blinkInterval; + this.restartTimer(); + } + }; + + this.setSmoothBlinking = function(smoothBlinking) { + if (smoothBlinking != this.smoothBlinking && !IE8) { + this.smoothBlinking = smoothBlinking; + dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking); + this.$updateCursors(true); + this.$updateCursors = (smoothBlinking + ? this.$updateOpacity + : this.$updateVisibility).bind(this); + this.restartTimer(); + } + }; + + this.addCursor = function() { + var el = dom.createElement("div"); + el.className = "ace_cursor"; + this.element.appendChild(el); + this.cursors.push(el); + return el; + }; + + this.removeCursor = function() { + if (this.cursors.length > 1) { + var el = this.cursors.pop(); + el.parentNode.removeChild(el); + return el; + } + }; + + this.hideCursor = function() { + this.isVisible = false; + dom.addCssClass(this.element, "ace_hidden-cursors"); + this.restartTimer(); + }; + + this.showCursor = function() { + this.isVisible = true; + dom.removeCssClass(this.element, "ace_hidden-cursors"); + this.restartTimer(); + }; + + this.restartTimer = function() { + var update = this.$updateCursors; + clearInterval(this.intervalId); + clearTimeout(this.timeoutId); + if (this.smoothBlinking) { + dom.removeCssClass(this.element, "ace_smooth-blinking"); + } + + update(true); + + if (!this.isBlinking || !this.blinkInterval || !this.isVisible) + return; + + if (this.smoothBlinking) { + setTimeout(function(){ + dom.addCssClass(this.element, "ace_smooth-blinking"); + }.bind(this)); + } + + var blink = function(){ + this.timeoutId = setTimeout(function() { + update(false); + }, 0.6 * this.blinkInterval); + }.bind(this); + + this.intervalId = setInterval(function() { + update(true); + blink(); + }, this.blinkInterval); + + blink(); + }; + + this.getPixelPosition = function(position, onScreen) { + if (!this.config || !this.session) + return {left : 0, top : 0}; + + if (!position) + position = this.session.selection.getCursor(); + var pos = this.session.documentToScreenPosition(position); + var cursorLeft = this.$padding + pos.column * this.config.characterWidth; + var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * + this.config.lineHeight; + + return {left : cursorLeft, top : cursorTop}; + }; + + this.update = function(config) { + this.config = config; + + var selections = this.session.$selectionMarkers; + var i = 0, cursorIndex = 0; + + if (selections === undefined || selections.length === 0){ + selections = [{cursor: null}]; + } + + for (var i = 0, n = selections.length; i < n; i++) { + var pixelPos = this.getPixelPosition(selections[i].cursor, true); + if ((pixelPos.top > config.height + config.offset || + pixelPos.top < 0) && i > 1) { + continue; + } + + var style = (this.cursors[cursorIndex++] || this.addCursor()).style; + + if (!this.drawCursor) { + style.left = pixelPos.left + "px"; + style.top = pixelPos.top + "px"; + style.width = config.characterWidth + "px"; + style.height = config.lineHeight + "px"; + } else { + this.drawCursor(style, pixelPos, config, selections[i], this.session); + } + } + while (this.cursors.length > cursorIndex) + this.removeCursor(); + + var overwrite = this.session.getOverwrite(); + this.$setOverwrite(overwrite); + this.$pixelPos = pixelPos; + this.restartTimer(); + }; + + this.drawCursor = null; + + this.$setOverwrite = function(overwrite) { + if (overwrite != this.overwrite) { + this.overwrite = overwrite; + if (overwrite) + dom.addCssClass(this.element, "ace_overwrite-cursors"); + else + dom.removeCssClass(this.element, "ace_overwrite-cursors"); + } + }; + + this.destroy = function() { + clearInterval(this.intervalId); + clearTimeout(this.timeoutId); + }; + + }).call(Cursor.prototype); + + exports.Cursor = Cursor; + + }); + + ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var dom = acequire("./lib/dom"); + var event = acequire("./lib/event"); + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + var ScrollBar = function(parent) { + this.element = dom.createElement("div"); + this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix; + + this.inner = dom.createElement("div"); + this.inner.className = "ace_scrollbar-inner"; + this.element.appendChild(this.inner); + + parent.appendChild(this.element); + + this.setVisible(false); + this.skipEvent = false; + + event.addListener(this.element, "scroll", this.onScroll.bind(this)); + event.addListener(this.element, "mousedown", event.preventDefault); + }; + + (function() { + oop.implement(this, EventEmitter); + + this.setVisible = function(isVisible) { + this.element.style.display = isVisible ? "" : "none"; + this.isVisible = isVisible; + }; + }).call(ScrollBar.prototype); + var VScrollBar = function(parent, renderer) { + ScrollBar.call(this, parent); + this.scrollTop = 0; + renderer.$scrollbarWidth = + this.width = dom.scrollbarWidth(parent.ownerDocument); + this.inner.style.width = + this.element.style.width = (this.width || 15) + 5 + "px"; + }; + + oop.inherits(VScrollBar, ScrollBar); + + (function() { + + this.classSuffix = '-v'; + this.onScroll = function() { + if (!this.skipEvent) { + this.scrollTop = this.element.scrollTop; + this._emit("scroll", {data: this.scrollTop}); + } + this.skipEvent = false; + }; + this.getWidth = function() { + return this.isVisible ? this.width : 0; + }; + this.setHeight = function(height) { + this.element.style.height = height + "px"; + }; + this.setInnerHeight = function(height) { + this.inner.style.height = height + "px"; + }; + this.setScrollHeight = function(height) { + this.inner.style.height = height + "px"; + }; + this.setScrollTop = function(scrollTop) { + if (this.scrollTop != scrollTop) { + this.skipEvent = true; + this.scrollTop = this.element.scrollTop = scrollTop; + } + }; + + }).call(VScrollBar.prototype); + var HScrollBar = function(parent, renderer) { + ScrollBar.call(this, parent); + this.scrollLeft = 0; + this.height = renderer.$scrollbarWidth; + this.inner.style.height = + this.element.style.height = (this.height || 15) + 5 + "px"; + }; + + oop.inherits(HScrollBar, ScrollBar); + + (function() { + + this.classSuffix = '-h'; + this.onScroll = function() { + if (!this.skipEvent) { + this.scrollLeft = this.element.scrollLeft; + this._emit("scroll", {data: this.scrollLeft}); + } + this.skipEvent = false; + }; + this.getHeight = function() { + return this.isVisible ? this.height : 0; + }; + this.setWidth = function(width) { + this.element.style.width = width + "px"; + }; + this.setInnerWidth = function(width) { + this.inner.style.width = width + "px"; + }; + this.setScrollWidth = function(width) { + this.inner.style.width = width + "px"; + }; + this.setScrollLeft = function(scrollLeft) { + if (this.scrollLeft != scrollLeft) { + this.skipEvent = true; + this.scrollLeft = this.element.scrollLeft = scrollLeft; + } + }; + + }).call(HScrollBar.prototype); + + + exports.ScrollBar = VScrollBar; // backward compatibility + exports.ScrollBarV = VScrollBar; // backward compatibility + exports.ScrollBarH = HScrollBar; // backward compatibility + + exports.VScrollBar = VScrollBar; + exports.HScrollBar = HScrollBar; + }); + + ace.define("ace/renderloop",["require","exports","module","ace/lib/event"], function(acequire, exports, module) { + "use strict"; + + var event = acequire("./lib/event"); + + + var RenderLoop = function(onRender, win) { + this.onRender = onRender; + this.pending = false; + this.changes = 0; + this.window = win || window; + }; + + (function() { + + + this.schedule = function(change) { + this.changes = this.changes | change; + if (!this.pending && this.changes) { + this.pending = true; + var _self = this; + event.nextFrame(function() { + _self.pending = false; + var changes; + while (changes = _self.changes) { + _self.changes = 0; + _self.onRender(changes); + } + }, this.window); + } + }; + + }).call(RenderLoop.prototype); + + exports.RenderLoop = RenderLoop; + }); + + ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"], function(acequire, exports, module) { + + var oop = acequire("../lib/oop"); + var dom = acequire("../lib/dom"); + var lang = acequire("../lib/lang"); + var useragent = acequire("../lib/useragent"); + var EventEmitter = acequire("../lib/event_emitter").EventEmitter; + + var CHAR_COUNT = 0; + + var FontMetrics = exports.FontMetrics = function(parentEl, interval) { + this.el = dom.createElement("div"); + this.$setMeasureNodeStyles(this.el.style, true); + + this.$main = dom.createElement("div"); + this.$setMeasureNodeStyles(this.$main.style); + + this.$measureNode = dom.createElement("div"); + this.$setMeasureNodeStyles(this.$measureNode.style); + + + this.el.appendChild(this.$main); + this.el.appendChild(this.$measureNode); + parentEl.appendChild(this.el); + + if (!CHAR_COUNT) + this.$testFractionalRect(); + this.$measureNode.innerHTML = lang.stringRepeat("X", CHAR_COUNT); + + this.$characterSize = {width: 0, height: 0}; + this.checkForSizeChanges(); + }; + + (function() { + + oop.implement(this, EventEmitter); + + this.$characterSize = {width: 0, height: 0}; + + this.$testFractionalRect = function() { + var el = dom.createElement("div"); + this.$setMeasureNodeStyles(el.style); + el.style.width = "0.2px"; + document.documentElement.appendChild(el); + var w = el.getBoundingClientRect().width; + if (w > 0 && w < 1) + CHAR_COUNT = 50; + else + CHAR_COUNT = 100; + el.parentNode.removeChild(el); + }; + + this.$setMeasureNodeStyles = function(style, isRoot) { + style.width = style.height = "auto"; + style.left = style.top = "0px"; + style.visibility = "hidden"; + style.position = "absolute"; + style.whiteSpace = "pre"; + + if (useragent.isIE < 8) { + style["font-family"] = "inherit"; + } else { + style.font = "inherit"; + } + style.overflow = isRoot ? "hidden" : "visible"; + }; + + this.checkForSizeChanges = function() { + var size = this.$measureSizes(); + if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { + this.$measureNode.style.fontWeight = "bold"; + var boldSize = this.$measureSizes(); + this.$measureNode.style.fontWeight = ""; + this.$characterSize = size; + this.charSizes = Object.create(null); + this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; + this._emit("changeCharacterSize", {data: size}); + } + }; + + this.$pollSizeChanges = function() { + if (this.$pollSizeChangesTimer) + return this.$pollSizeChangesTimer; + var self = this; + return this.$pollSizeChangesTimer = setInterval(function() { + self.checkForSizeChanges(); + }, 500); + }; + + this.setPolling = function(val) { + if (val) { + this.$pollSizeChanges(); + } else { + if (this.$pollSizeChangesTimer) + this.$pollSizeChangesTimer; + } + }; + + this.$measureSizes = function() { + if (CHAR_COUNT === 50) { + var rect = null; + try { + rect = this.$measureNode.getBoundingClientRect(); + } catch(e) { + rect = {width: 0, height:0 }; + }; + var size = { + height: rect.height, + width: rect.width / CHAR_COUNT + }; + } else { + var size = { + height: this.$measureNode.clientHeight, + width: this.$measureNode.clientWidth / CHAR_COUNT + }; + } + if (size.width === 0 || size.height === 0) + return null; + return size; + }; + + this.$measureCharWidth = function(ch) { + this.$main.innerHTML = lang.stringRepeat(ch, CHAR_COUNT); + var rect = this.$main.getBoundingClientRect(); + return rect.width / CHAR_COUNT; + }; + + this.getCharacterWidth = function(ch) { + var w = this.charSizes[ch]; + if (w === undefined) { + this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; + } + return w; + }; + + this.destroy = function() { + clearInterval(this.$pollSizeChangesTimer); + if (this.el && this.el.parentNode) + this.el.parentNode.removeChild(this.el); + }; + + }).call(FontMetrics.prototype); + + }); + + ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/lib/useragent","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var dom = acequire("./lib/dom"); + var config = acequire("./config"); + var useragent = acequire("./lib/useragent"); + var GutterLayer = acequire("./layer/gutter").Gutter; + var MarkerLayer = acequire("./layer/marker").Marker; + var TextLayer = acequire("./layer/text").Text; + var CursorLayer = acequire("./layer/cursor").Cursor; + var HScrollBar = acequire("./scrollbar").HScrollBar; + var VScrollBar = acequire("./scrollbar").VScrollBar; + var RenderLoop = acequire("./renderloop").RenderLoop; + var FontMetrics = acequire("./layer/font_metrics").FontMetrics; + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + var editorCss = ".ace_editor {\ + position: relative;\ + overflow: hidden;\ + font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\ + direction: ltr;\ + }\ + .ace_scroller {\ + position: absolute;\ + overflow: hidden;\ + top: 0;\ + bottom: 0;\ + background-color: inherit;\ + -ms-user-select: none;\ + -moz-user-select: none;\ + -webkit-user-select: none;\ + user-select: none;\ + cursor: text;\ + }\ + .ace_content {\ + position: absolute;\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ + min-width: 100%;\ + }\ + .ace_dragging .ace_scroller:before{\ + position: absolute;\ + top: 0;\ + left: 0;\ + right: 0;\ + bottom: 0;\ + content: '';\ + background: rgba(250, 250, 250, 0.01);\ + z-index: 1000;\ + }\ + .ace_dragging.ace_dark .ace_scroller:before{\ + background: rgba(0, 0, 0, 0.01);\ + }\ + .ace_selecting, .ace_selecting * {\ + cursor: text !important;\ + }\ + .ace_gutter {\ + position: absolute;\ + overflow : hidden;\ + width: auto;\ + top: 0;\ + bottom: 0;\ + left: 0;\ + cursor: default;\ + z-index: 4;\ + -ms-user-select: none;\ + -moz-user-select: none;\ + -webkit-user-select: none;\ + user-select: none;\ + }\ + .ace_gutter-active-line {\ + position: absolute;\ + left: 0;\ + right: 0;\ + }\ + .ace_scroller.ace_scroll-left {\ + box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\ + }\ + .ace_gutter-cell {\ + padding-left: 19px;\ + padding-right: 6px;\ + background-repeat: no-repeat;\ + }\ + .ace_gutter-cell.ace_error {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\ + background-repeat: no-repeat;\ + background-position: 2px center;\ + }\ + .ace_gutter-cell.ace_warning {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\ + background-position: 2px center;\ + }\ + .ace_gutter-cell.ace_info {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\ + background-position: 2px center;\ + }\ + .ace_dark .ace_gutter-cell.ace_info {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\ + }\ + .ace_scrollbar {\ + position: absolute;\ + right: 0;\ + bottom: 0;\ + z-index: 6;\ + }\ + .ace_scrollbar-inner {\ + position: absolute;\ + cursor: text;\ + left: 0;\ + top: 0;\ + }\ + .ace_scrollbar-v{\ + overflow-x: hidden;\ + overflow-y: scroll;\ + top: 0;\ + }\ + .ace_scrollbar-h {\ + overflow-x: scroll;\ + overflow-y: hidden;\ + left: 0;\ + }\ + .ace_print-margin {\ + position: absolute;\ + height: 100%;\ + }\ + .ace_text-input {\ + position: absolute;\ + z-index: 0;\ + width: 0.5em;\ + height: 1em;\ + opacity: 0;\ + background: transparent;\ + -moz-appearance: none;\ + appearance: none;\ + border: none;\ + resize: none;\ + outline: none;\ + overflow: hidden;\ + font: inherit;\ + padding: 0 1px;\ + margin: 0 -1px;\ + text-indent: -1em;\ + -ms-user-select: text;\ + -moz-user-select: text;\ + -webkit-user-select: text;\ + user-select: text;\ + }\ + .ace_text-input.ace_composition {\ + background: inherit;\ + color: inherit;\ + z-index: 1000;\ + opacity: 1;\ + text-indent: 0;\ + }\ + .ace_layer {\ + z-index: 1;\ + position: absolute;\ + overflow: hidden;\ + word-wrap: normal;\ + white-space: pre;\ + height: 100%;\ + width: 100%;\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ + pointer-events: none;\ + }\ + .ace_gutter-layer {\ + position: relative;\ + width: auto;\ + text-align: right;\ + pointer-events: auto;\ + }\ + .ace_text-layer {\ + font: inherit !important;\ + }\ + .ace_cjk {\ + display: inline-block;\ + text-align: center;\ + }\ + .ace_cursor-layer {\ + z-index: 4;\ + }\ + .ace_cursor {\ + z-index: 4;\ + position: absolute;\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ + border-left: 2px solid\ + }\ + .ace_slim-cursors .ace_cursor {\ + border-left-width: 1px;\ + }\ + .ace_overwrite-cursors .ace_cursor {\ + border-left-width: 0;\ + border-bottom: 1px solid;\ + }\ + .ace_hidden-cursors .ace_cursor {\ + opacity: 0.2;\ + }\ + .ace_smooth-blinking .ace_cursor {\ + -webkit-transition: opacity 0.18s;\ + transition: opacity 0.18s;\ + }\ + .ace_editor.ace_multiselect .ace_cursor {\ + border-left-width: 1px;\ + }\ + .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\ + position: absolute;\ + z-index: 3;\ + }\ + .ace_marker-layer .ace_selection {\ + position: absolute;\ + z-index: 5;\ + }\ + .ace_marker-layer .ace_bracket {\ + position: absolute;\ + z-index: 6;\ + }\ + .ace_marker-layer .ace_active-line {\ + position: absolute;\ + z-index: 2;\ + }\ + .ace_marker-layer .ace_selected-word {\ + position: absolute;\ + z-index: 4;\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ + }\ + .ace_line .ace_fold {\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ + display: inline-block;\ + height: 11px;\ + margin-top: -2px;\ + vertical-align: middle;\ + background-image:\ + url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ + url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\ + background-repeat: no-repeat, repeat-x;\ + background-position: center center, top left;\ + color: transparent;\ + border: 1px solid black;\ + border-radius: 2px;\ + cursor: pointer;\ + pointer-events: auto;\ + }\ + .ace_dark .ace_fold {\ + }\ + .ace_fold:hover{\ + background-image:\ + url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ + url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\ + }\ + .ace_tooltip {\ + background-color: #FFF;\ + background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));\ + background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));\ + border: 1px solid gray;\ + border-radius: 1px;\ + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\ + color: black;\ + max-width: 100%;\ + padding: 3px 4px;\ + position: fixed;\ + z-index: 999999;\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ + cursor: default;\ + white-space: pre;\ + word-wrap: break-word;\ + line-height: normal;\ + font-style: normal;\ + font-weight: normal;\ + letter-spacing: normal;\ + pointer-events: none;\ + }\ + .ace_folding-enabled > .ace_gutter-cell {\ + padding-right: 13px;\ + }\ + .ace_fold-widget {\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ + margin: 0 -12px 0 1px;\ + display: none;\ + width: 11px;\ + vertical-align: top;\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\ + background-repeat: no-repeat;\ + background-position: center;\ + border-radius: 3px;\ + border: 1px solid transparent;\ + cursor: pointer;\ + }\ + .ace_folding-enabled .ace_fold-widget {\ + display: inline-block; \ + }\ + .ace_fold-widget.ace_end {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\ + }\ + .ace_fold-widget.ace_closed {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\ + }\ + .ace_fold-widget:hover {\ + border: 1px solid rgba(0, 0, 0, 0.3);\ + background-color: rgba(255, 255, 255, 0.2);\ + box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ + }\ + .ace_fold-widget:active {\ + border: 1px solid rgba(0, 0, 0, 0.4);\ + background-color: rgba(0, 0, 0, 0.05);\ + box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ + }\ + .ace_dark .ace_fold-widget {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\ + }\ + .ace_dark .ace_fold-widget.ace_end {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\ + }\ + .ace_dark .ace_fold-widget.ace_closed {\ + background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\ + }\ + .ace_dark .ace_fold-widget:hover {\ + box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ + background-color: rgba(255, 255, 255, 0.1);\ + }\ + .ace_dark .ace_fold-widget:active {\ + box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ + }\ + .ace_fold-widget.ace_invalid {\ + background-color: #FFB4B4;\ + border-color: #DE5555;\ + }\ + .ace_fade-fold-widgets .ace_fold-widget {\ + -webkit-transition: opacity 0.4s ease 0.05s;\ + transition: opacity 0.4s ease 0.05s;\ + opacity: 0;\ + }\ + .ace_fade-fold-widgets:hover .ace_fold-widget {\ + -webkit-transition: opacity 0.05s ease 0.05s;\ + transition: opacity 0.05s ease 0.05s;\ + opacity:1;\ + }\ + .ace_underline {\ + text-decoration: underline;\ + }\ + .ace_bold {\ + font-weight: bold;\ + }\ + .ace_nobold .ace_bold {\ + font-weight: normal;\ + }\ + .ace_italic {\ + font-style: italic;\ + }\ + .ace_error-marker {\ + background-color: rgba(255, 0, 0,0.2);\ + position: absolute;\ + z-index: 9;\ + }\ + .ace_highlight-marker {\ + background-color: rgba(255, 255, 0,0.2);\ + position: absolute;\ + z-index: 8;\ + }\ + "; + + dom.importCssString(editorCss, "ace_editor.css"); + + var VirtualRenderer = function(container, theme) { + var _self = this; + + this.container = container || dom.createElement("div"); + this.$keepTextAreaAtCursor = !useragent.isOldIE; + + dom.addCssClass(this.container, "ace_editor"); + + this.setTheme(theme); + + this.$gutter = dom.createElement("div"); + this.$gutter.className = "ace_gutter"; + this.container.appendChild(this.$gutter); + + this.scroller = dom.createElement("div"); + this.scroller.className = "ace_scroller"; + this.container.appendChild(this.scroller); + + this.content = dom.createElement("div"); + this.content.className = "ace_content"; + this.scroller.appendChild(this.content); + + this.$gutterLayer = new GutterLayer(this.$gutter); + this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); + + this.$markerBack = new MarkerLayer(this.content); + + var textLayer = this.$textLayer = new TextLayer(this.content); + this.canvas = textLayer.element; + + this.$markerFront = new MarkerLayer(this.content); + + this.$cursorLayer = new CursorLayer(this.content); + this.$horizScroll = false; + this.$vScroll = false; + + this.scrollBar = + this.scrollBarV = new VScrollBar(this.container, this); + this.scrollBarH = new HScrollBar(this.container, this); + this.scrollBarV.addEventListener("scroll", function(e) { + if (!_self.$scrollAnimation) + _self.session.setScrollTop(e.data - _self.scrollMargin.top); + }); + this.scrollBarH.addEventListener("scroll", function(e) { + if (!_self.$scrollAnimation) + _self.session.setScrollLeft(e.data - _self.scrollMargin.left); + }); + + this.scrollTop = 0; + this.scrollLeft = 0; + + this.cursorPos = { + row : 0, + column : 0 + }; + + this.$fontMetrics = new FontMetrics(this.container, 500); + this.$textLayer.$setFontMetrics(this.$fontMetrics); + this.$textLayer.addEventListener("changeCharacterSize", function(e) { + _self.updateCharacterSize(); + _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); + _self._signal("changeCharacterSize", e); + }); + + this.$size = { + width: 0, + height: 0, + scrollerHeight: 0, + scrollerWidth: 0, + $dirty: true + }; + + this.layerConfig = { + width : 1, + padding : 0, + firstRow : 0, + firstRowScreen: 0, + lastRow : 0, + lineHeight : 0, + characterWidth : 0, + minHeight : 1, + maxHeight : 1, + offset : 0, + height : 1, + gutterOffset: 1 + }; + + this.scrollMargin = { + left: 0, + right: 0, + top: 0, + bottom: 0, + v: 0, + h: 0 + }; + + this.$loop = new RenderLoop( + this.$renderChanges.bind(this), + this.container.ownerDocument.defaultView + ); + this.$loop.schedule(this.CHANGE_FULL); + + this.updateCharacterSize(); + this.setPadding(4); + config.resetOptions(this); + config._emit("renderer", this); + }; + + (function() { + + this.CHANGE_CURSOR = 1; + this.CHANGE_MARKER = 2; + this.CHANGE_GUTTER = 4; + this.CHANGE_SCROLL = 8; + this.CHANGE_LINES = 16; + this.CHANGE_TEXT = 32; + this.CHANGE_SIZE = 64; + this.CHANGE_MARKER_BACK = 128; + this.CHANGE_MARKER_FRONT = 256; + this.CHANGE_FULL = 512; + this.CHANGE_H_SCROLL = 1024; + + oop.implement(this, EventEmitter); + + this.updateCharacterSize = function() { + if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) { + this.$allowBoldFonts = this.$textLayer.allowBoldFonts; + this.setStyle("ace_nobold", !this.$allowBoldFonts); + } + + this.layerConfig.characterWidth = + this.characterWidth = this.$textLayer.getCharacterWidth(); + this.layerConfig.lineHeight = + this.lineHeight = this.$textLayer.getLineHeight(); + this.$updatePrintMargin(); + }; + this.setSession = function(session) { + if (this.session) + this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode); + + this.session = session; + if (session && this.scrollMargin.top && session.getScrollTop() <= 0) + session.setScrollTop(-this.scrollMargin.top); + + this.$cursorLayer.setSession(session); + this.$markerBack.setSession(session); + this.$markerFront.setSession(session); + this.$gutterLayer.setSession(session); + this.$textLayer.setSession(session); + if (!session) + return; + + this.$loop.schedule(this.CHANGE_FULL); + this.session.$setFontMetrics(this.$fontMetrics); + + this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this); + this.onChangeNewLineMode() + this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode); + }; + this.updateLines = function(firstRow, lastRow, force) { + if (lastRow === undefined) + lastRow = Infinity; + + if (!this.$changedLines) { + this.$changedLines = { + firstRow: firstRow, + lastRow: lastRow + }; + } + else { + if (this.$changedLines.firstRow > firstRow) + this.$changedLines.firstRow = firstRow; + + if (this.$changedLines.lastRow < lastRow) + this.$changedLines.lastRow = lastRow; + } + if (this.$changedLines.lastRow < this.layerConfig.firstRow) { + if (force) + this.$changedLines.lastRow = this.layerConfig.lastRow; + else + return; + } + if (this.$changedLines.firstRow > this.layerConfig.lastRow) + return; + this.$loop.schedule(this.CHANGE_LINES); + }; + + this.onChangeNewLineMode = function() { + this.$loop.schedule(this.CHANGE_TEXT); + this.$textLayer.$updateEolChar(); + }; + + this.onChangeTabSize = function() { + this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); + this.$textLayer.onChangeTabSize(); + }; + this.updateText = function() { + this.$loop.schedule(this.CHANGE_TEXT); + }; + this.updateFull = function(force) { + if (force) + this.$renderChanges(this.CHANGE_FULL, true); + else + this.$loop.schedule(this.CHANGE_FULL); + }; + this.updateFontSize = function() { + this.$textLayer.checkForSizeChanges(); + }; + + this.$changes = 0; + this.$updateSizeAsync = function() { + if (this.$loop.pending) + this.$size.$dirty = true; + else + this.onResize(); + }; + this.onResize = function(force, gutterWidth, width, height) { + if (this.resizing > 2) + return; + else if (this.resizing > 0) + this.resizing++; + else + this.resizing = force ? 1 : 0; + var el = this.container; + if (!height) + height = el.clientHeight || el.scrollHeight; + if (!width) + width = el.clientWidth || el.scrollWidth; + var changes = this.$updateCachedSize(force, gutterWidth, width, height); + + + if (!this.$size.scrollerHeight || (!width && !height)) + return this.resizing = 0; + + if (force) + this.$gutterLayer.$padding = null; + + if (force) + this.$renderChanges(changes | this.$changes, true); + else + this.$loop.schedule(changes | this.$changes); + + if (this.resizing) + this.resizing = 0; + this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null; + }; + + this.$updateCachedSize = function(force, gutterWidth, width, height) { + height -= (this.$extraHeight || 0); + var changes = 0; + var size = this.$size; + var oldSize = { + width: size.width, + height: size.height, + scrollerHeight: size.scrollerHeight, + scrollerWidth: size.scrollerWidth + }; + if (height && (force || size.height != height)) { + size.height = height; + changes |= this.CHANGE_SIZE; + + size.scrollerHeight = size.height; + if (this.$horizScroll) + size.scrollerHeight -= this.scrollBarH.getHeight(); + this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px"; + + changes = changes | this.CHANGE_SCROLL; + } + + if (width && (force || size.width != width)) { + changes |= this.CHANGE_SIZE; + size.width = width; + + if (gutterWidth == null) + gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; + + this.gutterWidth = gutterWidth; + + this.scrollBarH.element.style.left = + this.scroller.style.left = gutterWidth + "px"; + size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth()); + + this.scrollBarH.element.style.right = + this.scroller.style.right = this.scrollBarV.getWidth() + "px"; + this.scroller.style.bottom = this.scrollBarH.getHeight() + "px"; + + if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) + changes |= this.CHANGE_FULL; + } + + size.$dirty = !width || !height; + + if (changes) + this._signal("resize", oldSize); + + return changes; + }; + + this.onGutterResize = function() { + var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; + if (gutterWidth != this.gutterWidth) + this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height); + + if (this.session.getUseWrapMode() && this.adjustWrapLimit()) { + this.$loop.schedule(this.CHANGE_FULL); + } else if (this.$size.$dirty) { + this.$loop.schedule(this.CHANGE_FULL); + } else { + this.$computeLayerConfig(); + this.$loop.schedule(this.CHANGE_MARKER); + } + }; + this.adjustWrapLimit = function() { + var availableWidth = this.$size.scrollerWidth - this.$padding * 2; + var limit = Math.floor(availableWidth / this.characterWidth); + return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn); + }; + this.setAnimatedScroll = function(shouldAnimate){ + this.setOption("animatedScroll", shouldAnimate); + }; + this.getAnimatedScroll = function() { + return this.$animatedScroll; + }; + this.setShowInvisibles = function(showInvisibles) { + this.setOption("showInvisibles", showInvisibles); + }; + this.getShowInvisibles = function() { + return this.getOption("showInvisibles"); + }; + this.getDisplayIndentGuides = function() { + return this.getOption("displayIndentGuides"); + }; + + this.setDisplayIndentGuides = function(display) { + this.setOption("displayIndentGuides", display); + }; + this.setShowPrintMargin = function(showPrintMargin) { + this.setOption("showPrintMargin", showPrintMargin); + }; + this.getShowPrintMargin = function() { + return this.getOption("showPrintMargin"); + }; + this.setPrintMarginColumn = function(showPrintMargin) { + this.setOption("printMarginColumn", showPrintMargin); + }; + this.getPrintMarginColumn = function() { + return this.getOption("printMarginColumn"); + }; + this.getShowGutter = function(){ + return this.getOption("showGutter"); + }; + this.setShowGutter = function(show){ + return this.setOption("showGutter", show); + }; + + this.getFadeFoldWidgets = function(){ + return this.getOption("fadeFoldWidgets") + }; + + this.setFadeFoldWidgets = function(show) { + this.setOption("fadeFoldWidgets", show); + }; + + this.setHighlightGutterLine = function(shouldHighlight) { + this.setOption("highlightGutterLine", shouldHighlight); + }; + + this.getHighlightGutterLine = function() { + return this.getOption("highlightGutterLine"); + }; + + this.$updateGutterLineHighlight = function() { + var pos = this.$cursorLayer.$pixelPos; + var height = this.layerConfig.lineHeight; + if (this.session.getUseWrapMode()) { + var cursor = this.session.selection.getCursor(); + cursor.column = 0; + pos = this.$cursorLayer.getPixelPosition(cursor, true); + height *= this.session.getRowLength(cursor.row); + } + this.$gutterLineHighlight.style.top = pos.top - this.layerConfig.offset + "px"; + this.$gutterLineHighlight.style.height = height + "px"; + }; + + this.$updatePrintMargin = function() { + if (!this.$showPrintMargin && !this.$printMarginEl) + return; + + if (!this.$printMarginEl) { + var containerEl = dom.createElement("div"); + containerEl.className = "ace_layer ace_print-margin-layer"; + this.$printMarginEl = dom.createElement("div"); + this.$printMarginEl.className = "ace_print-margin"; + containerEl.appendChild(this.$printMarginEl); + this.content.insertBefore(containerEl, this.content.firstChild); + } + + var style = this.$printMarginEl.style; + style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px"; + style.visibility = this.$showPrintMargin ? "visible" : "hidden"; + + if (this.session && this.session.$wrap == -1) + this.adjustWrapLimit(); + }; + this.getContainerElement = function() { + return this.container; + }; + this.getMouseEventTarget = function() { + return this.content; + }; + this.getTextAreaContainer = function() { + return this.container; + }; + this.$moveTextAreaToCursor = function() { + if (!this.$keepTextAreaAtCursor) + return; + var config = this.layerConfig; + var posTop = this.$cursorLayer.$pixelPos.top; + var posLeft = this.$cursorLayer.$pixelPos.left; + posTop -= config.offset; + + var style = this.textarea.style; + var h = this.lineHeight; + if (posTop < 0 || posTop > config.height - h) { + style.top = style.left = "0"; + return; + } + + var w = this.characterWidth; + if (this.$composition) { + var val = this.textarea.value.replace(/^\x01+/, ""); + w *= (this.session.$getStringScreenWidth(val)[0]+2); + h += 2; + } + posLeft -= this.scrollLeft; + if (posLeft > this.$size.scrollerWidth - w) + posLeft = this.$size.scrollerWidth - w; + + posLeft += this.gutterWidth; + style.height = h + "px"; + style.width = w + "px"; + style.left = Math.min(posLeft, this.$size.scrollerWidth - w) + "px"; + style.top = Math.min(posTop, this.$size.height - h) + "px"; + }; + this.getFirstVisibleRow = function() { + return this.layerConfig.firstRow; + }; + this.getFirstFullyVisibleRow = function() { + return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); + }; + this.getLastFullyVisibleRow = function() { + var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight); + return this.layerConfig.firstRow - 1 + flint; + }; + this.getLastVisibleRow = function() { + return this.layerConfig.lastRow; + }; + + this.$padding = null; + this.setPadding = function(padding) { + this.$padding = padding; + this.$textLayer.setPadding(padding); + this.$cursorLayer.setPadding(padding); + this.$markerFront.setPadding(padding); + this.$markerBack.setPadding(padding); + this.$loop.schedule(this.CHANGE_FULL); + this.$updatePrintMargin(); + }; + + this.setScrollMargin = function(top, bottom, left, right) { + var sm = this.scrollMargin; + sm.top = top|0; + sm.bottom = bottom|0; + sm.right = right|0; + sm.left = left|0; + sm.v = sm.top + sm.bottom; + sm.h = sm.left + sm.right; + if (sm.top && this.scrollTop <= 0 && this.session) + this.session.setScrollTop(-sm.top); + this.updateFull(); + }; + this.getHScrollBarAlwaysVisible = function() { + return this.$hScrollBarAlwaysVisible; + }; + this.setHScrollBarAlwaysVisible = function(alwaysVisible) { + this.setOption("hScrollBarAlwaysVisible", alwaysVisible); + }; + this.getVScrollBarAlwaysVisible = function() { + return this.$vScrollBarAlwaysVisible; + }; + this.setVScrollBarAlwaysVisible = function(alwaysVisible) { + this.setOption("vScrollBarAlwaysVisible", alwaysVisible); + }; + + this.$updateScrollBarV = function() { + var scrollHeight = this.layerConfig.maxHeight; + var scrollerHeight = this.$size.scrollerHeight; + if (!this.$maxLines && this.$scrollPastEnd) { + scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd; + if (this.scrollTop > scrollHeight - scrollerHeight) { + scrollHeight = this.scrollTop + scrollerHeight; + this.scrollBarV.scrollTop = null; + } + } + this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v); + this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top); + }; + this.$updateScrollBarH = function() { + this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h); + this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left); + }; + + this.$frozen = false; + this.freeze = function() { + this.$frozen = true; + }; + + this.unfreeze = function() { + this.$frozen = false; + }; + + this.$renderChanges = function(changes, force) { + if (this.$changes) { + changes |= this.$changes; + this.$changes = 0; + } + if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) { + this.$changes |= changes; + return; + } + if (this.$size.$dirty) { + this.$changes |= changes; + return this.onResize(true); + } + if (!this.lineHeight) { + this.$textLayer.checkForSizeChanges(); + } + + this._signal("beforeRender"); + var config = this.layerConfig; + if (changes & this.CHANGE_FULL || + changes & this.CHANGE_SIZE || + changes & this.CHANGE_TEXT || + changes & this.CHANGE_LINES || + changes & this.CHANGE_SCROLL || + changes & this.CHANGE_H_SCROLL + ) { + changes |= this.$computeLayerConfig(); + if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) { + var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight; + if (st > 0) { + this.scrollTop = st; + changes = changes | this.CHANGE_SCROLL; + changes |= this.$computeLayerConfig(); + } + } + config = this.layerConfig; + this.$updateScrollBarV(); + if (changes & this.CHANGE_H_SCROLL) + this.$updateScrollBarH(); + this.$gutterLayer.element.style.marginTop = (-config.offset) + "px"; + this.content.style.marginTop = (-config.offset) + "px"; + this.content.style.width = config.width + 2 * this.$padding + "px"; + this.content.style.height = config.minHeight + "px"; + } + if (changes & this.CHANGE_H_SCROLL) { + this.content.style.marginLeft = -this.scrollLeft + "px"; + this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"; + } + if (changes & this.CHANGE_FULL) { + this.$textLayer.update(config); + if (this.$showGutter) + this.$gutterLayer.update(config); + this.$markerBack.update(config); + this.$markerFront.update(config); + this.$cursorLayer.update(config); + this.$moveTextAreaToCursor(); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + this._signal("afterRender"); + return; + } + if (changes & this.CHANGE_SCROLL) { + if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) + this.$textLayer.update(config); + else + this.$textLayer.scrollLines(config); + + if (this.$showGutter) + this.$gutterLayer.update(config); + this.$markerBack.update(config); + this.$markerFront.update(config); + this.$cursorLayer.update(config); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + this.$moveTextAreaToCursor(); + this._signal("afterRender"); + return; + } + + if (changes & this.CHANGE_TEXT) { + this.$textLayer.update(config); + if (this.$showGutter) + this.$gutterLayer.update(config); + } + else if (changes & this.CHANGE_LINES) { + if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter) + this.$gutterLayer.update(config); + } + else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) { + if (this.$showGutter) + this.$gutterLayer.update(config); + } + + if (changes & this.CHANGE_CURSOR) { + this.$cursorLayer.update(config); + this.$moveTextAreaToCursor(); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + } + + if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { + this.$markerFront.update(config); + } + + if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { + this.$markerBack.update(config); + } + + this._signal("afterRender"); + }; + + + this.$autosize = function() { + var height = this.session.getScreenLength() * this.lineHeight; + var maxHeight = this.$maxLines * this.lineHeight; + var desiredHeight = Math.max( + (this.$minLines||1) * this.lineHeight, + Math.min(maxHeight, height) + ) + this.scrollMargin.v + (this.$extraHeight || 0); + var vScroll = height > maxHeight; + + if (desiredHeight != this.desiredHeight || + this.$size.height != this.desiredHeight || vScroll != this.$vScroll) { + if (vScroll != this.$vScroll) { + this.$vScroll = vScroll; + this.scrollBarV.setVisible(vScroll); + } + + var w = this.container.clientWidth; + this.container.style.height = desiredHeight + "px"; + this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight); + this.desiredHeight = desiredHeight; + + this._signal("autosize"); + } + }; + + this.$computeLayerConfig = function() { + if (this.$maxLines && this.lineHeight > 1) + this.$autosize(); + + var session = this.session; + var size = this.$size; + + var hideScrollbars = size.height <= 2 * this.lineHeight; + var screenLines = this.session.getScreenLength(); + var maxHeight = screenLines * this.lineHeight; + + var offset = this.scrollTop % this.lineHeight; + var minHeight = size.scrollerHeight + this.lineHeight; + + var longestLine = this.$getLongestLine(); + + var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || + size.scrollerWidth - longestLine - 2 * this.$padding < 0); + + var hScrollChanged = this.$horizScroll !== horizScroll; + if (hScrollChanged) { + this.$horizScroll = horizScroll; + this.scrollBarH.setVisible(horizScroll); + } + + var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd + ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd + : 0; + maxHeight += scrollPastEnd; + + this.session.setScrollTop(Math.max(-this.scrollMargin.top, + Math.min(this.scrollTop, maxHeight - size.scrollerHeight + this.scrollMargin.bottom))); + + this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft, + longestLine + 2 * this.$padding - size.scrollerWidth + this.scrollMargin.right))); + + var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || + size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop); + var vScrollChanged = this.$vScroll !== vScroll; + if (vScrollChanged) { + this.$vScroll = vScroll; + this.scrollBarV.setVisible(vScroll); + } + + var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; + var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); + var lastRow = firstRow + lineCount; + var firstRowScreen, firstRowHeight; + var lineHeight = this.lineHeight; + firstRow = session.screenToDocumentRow(firstRow, 0); + var foldLine = session.getFoldLine(firstRow); + if (foldLine) { + firstRow = foldLine.start.row; + } + + firstRowScreen = session.documentToScreenRow(firstRow, 0); + firstRowHeight = session.getRowLength(firstRow) * lineHeight; + + lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); + minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + + firstRowHeight; + + offset = this.scrollTop - firstRowScreen * lineHeight; + + var changes = 0; + if (this.layerConfig.width != longestLine) + changes = this.CHANGE_H_SCROLL; + if (hScrollChanged || vScrollChanged) { + changes = this.$updateCachedSize(true, this.gutterWidth, size.width, size.height); + this._signal("scrollbarVisibilityChanged"); + if (vScrollChanged) + longestLine = this.$getLongestLine(); + } + + this.layerConfig = { + width : longestLine, + padding : this.$padding, + firstRow : firstRow, + firstRowScreen: firstRowScreen, + lastRow : lastRow, + lineHeight : lineHeight, + characterWidth : this.characterWidth, + minHeight : minHeight, + maxHeight : maxHeight, + offset : offset, + gutterOffset : Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)), + height : this.$size.scrollerHeight + }; + + return changes; + }; + + this.$updateLines = function() { + var firstRow = this.$changedLines.firstRow; + var lastRow = this.$changedLines.lastRow; + this.$changedLines = null; + + var layerConfig = this.layerConfig; + + if (firstRow > layerConfig.lastRow + 1) { return; } + if (lastRow < layerConfig.firstRow) { return; } + if (lastRow === Infinity) { + if (this.$showGutter) + this.$gutterLayer.update(layerConfig); + this.$textLayer.update(layerConfig); + return; + } + this.$textLayer.updateLines(layerConfig, firstRow, lastRow); + return true; + }; + + this.$getLongestLine = function() { + var charCount = this.session.getScreenWidth(); + if (this.showInvisibles && !this.session.$useWrapMode) + charCount += 1; + + return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth)); + }; + this.updateFrontMarkers = function() { + this.$markerFront.setMarkers(this.session.getMarkers(true)); + this.$loop.schedule(this.CHANGE_MARKER_FRONT); + }; + this.updateBackMarkers = function() { + this.$markerBack.setMarkers(this.session.getMarkers()); + this.$loop.schedule(this.CHANGE_MARKER_BACK); + }; + this.addGutterDecoration = function(row, className){ + this.$gutterLayer.addGutterDecoration(row, className); + }; + this.removeGutterDecoration = function(row, className){ + this.$gutterLayer.removeGutterDecoration(row, className); + }; + this.updateBreakpoints = function(rows) { + this.$loop.schedule(this.CHANGE_GUTTER); + }; + this.setAnnotations = function(annotations) { + this.$gutterLayer.setAnnotations(annotations); + this.$loop.schedule(this.CHANGE_GUTTER); + }; + this.updateCursor = function() { + this.$loop.schedule(this.CHANGE_CURSOR); + }; + this.hideCursor = function() { + this.$cursorLayer.hideCursor(); + }; + this.showCursor = function() { + this.$cursorLayer.showCursor(); + }; + + this.scrollSelectionIntoView = function(anchor, lead, offset) { + this.scrollCursorIntoView(anchor, offset); + this.scrollCursorIntoView(lead, offset); + }; + this.scrollCursorIntoView = function(cursor, offset, $viewMargin) { + if (this.$size.scrollerHeight === 0) + return; + + var pos = this.$cursorLayer.getPixelPosition(cursor); + + var left = pos.left; + var top = pos.top; + + var topMargin = $viewMargin && $viewMargin.top || 0; + var bottomMargin = $viewMargin && $viewMargin.bottom || 0; + + var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; + + if (scrollTop + topMargin > top) { + if (offset) + top -= offset * this.$size.scrollerHeight; + if (top === 0) + top = -this.scrollMargin.top; + this.session.setScrollTop(top); + } else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) { + if (offset) + top += offset * this.$size.scrollerHeight; + this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); + } + + var scrollLeft = this.scrollLeft; + + if (scrollLeft > left) { + if (left < this.$padding + 2 * this.layerConfig.characterWidth) + left = -this.scrollMargin.left; + this.session.setScrollLeft(left); + } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { + this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); + } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) { + this.session.setScrollLeft(0); + } + }; + this.getScrollTop = function() { + return this.session.getScrollTop(); + }; + this.getScrollLeft = function() { + return this.session.getScrollLeft(); + }; + this.getScrollTopRow = function() { + return this.scrollTop / this.lineHeight; + }; + this.getScrollBottomRow = function() { + return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); + }; + this.scrollToRow = function(row) { + this.session.setScrollTop(row * this.lineHeight); + }; + + this.alignCursor = function(cursor, alignment) { + if (typeof cursor == "number") + cursor = {row: cursor, column: 0}; + + var pos = this.$cursorLayer.getPixelPosition(cursor); + var h = this.$size.scrollerHeight - this.lineHeight; + var offset = pos.top - h * (alignment || 0); + + this.session.setScrollTop(offset); + return offset; + }; + + this.STEPS = 8; + this.$calcSteps = function(fromValue, toValue){ + var i = 0; + var l = this.STEPS; + var steps = []; + + var func = function(t, x_min, dx) { + return dx * (Math.pow(t - 1, 3) + 1) + x_min; + }; + + for (i = 0; i < l; ++i) + steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); + + return steps; + }; + this.scrollToLine = function(line, center, animate, callback) { + var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); + var offset = pos.top; + if (center) + offset -= this.$size.scrollerHeight / 2; + + var initialScroll = this.scrollTop; + this.session.setScrollTop(offset); + if (animate !== false) + this.animateScrolling(initialScroll, callback); + }; + + this.animateScrolling = function(fromValue, callback) { + var toValue = this.scrollTop; + if (!this.$animatedScroll) + return; + var _self = this; + + if (fromValue == toValue) + return; + + if (this.$scrollAnimation) { + var oldSteps = this.$scrollAnimation.steps; + if (oldSteps.length) { + fromValue = oldSteps[0]; + if (fromValue == toValue) + return; + } + } + + var steps = _self.$calcSteps(fromValue, toValue); + this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; + + clearInterval(this.$timer); + + _self.session.setScrollTop(steps.shift()); + _self.session.$scrollTop = toValue; + this.$timer = setInterval(function() { + if (steps.length) { + _self.session.setScrollTop(steps.shift()); + _self.session.$scrollTop = toValue; + } else if (toValue != null) { + _self.session.$scrollTop = -1; + _self.session.setScrollTop(toValue); + toValue = null; + } else { + _self.$timer = clearInterval(_self.$timer); + _self.$scrollAnimation = null; + callback && callback(); + } + }, 10); + }; + this.scrollToY = function(scrollTop) { + if (this.scrollTop !== scrollTop) { + this.$loop.schedule(this.CHANGE_SCROLL); + this.scrollTop = scrollTop; + } + }; + this.scrollToX = function(scrollLeft) { + if (this.scrollLeft !== scrollLeft) + this.scrollLeft = scrollLeft; + this.$loop.schedule(this.CHANGE_H_SCROLL); + }; + this.scrollTo = function(x, y) { + this.session.setScrollTop(y); + this.session.setScrollLeft(y); + }; + this.scrollBy = function(deltaX, deltaY) { + deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY); + deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX); + }; + this.isScrollableBy = function(deltaX, deltaY) { + if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) + return true; + if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight + - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) + return true; + if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) + return true; + if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth + - this.layerConfig.width < -1 + this.scrollMargin.right) + return true; + }; + + this.pixelToScreenCoordinates = function(x, y) { + var canvasPos = this.scroller.getBoundingClientRect(); + + var offset = (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth; + var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight); + var col = Math.round(offset); + + return {row: row, column: col, side: offset - col > 0 ? 1 : -1}; + }; + + this.screenToTextCoordinates = function(x, y) { + var canvasPos = this.scroller.getBoundingClientRect(); + + var col = Math.round( + (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth + ); + + var row = (y + this.scrollTop - canvasPos.top) / this.lineHeight; + + return this.session.screenToDocumentPosition(row, Math.max(col, 0)); + }; + this.textToScreenCoordinates = function(row, column) { + var canvasPos = this.scroller.getBoundingClientRect(); + var pos = this.session.documentToScreenPosition(row, column); + + var x = this.$padding + Math.round(pos.column * this.characterWidth); + var y = pos.row * this.lineHeight; + + return { + pageX: canvasPos.left + x - this.scrollLeft, + pageY: canvasPos.top + y - this.scrollTop + }; + }; + this.visualizeFocus = function() { + dom.addCssClass(this.container, "ace_focus"); + }; + this.visualizeBlur = function() { + dom.removeCssClass(this.container, "ace_focus"); + }; + this.showComposition = function(position) { + if (!this.$composition) + this.$composition = { + keepTextAreaAtCursor: this.$keepTextAreaAtCursor, + cssText: this.textarea.style.cssText + }; + + this.$keepTextAreaAtCursor = true; + dom.addCssClass(this.textarea, "ace_composition"); + this.textarea.style.cssText = ""; + this.$moveTextAreaToCursor(); + }; + this.setCompositionText = function(text) { + this.$moveTextAreaToCursor(); + }; + this.hideComposition = function() { + if (!this.$composition) + return; + + dom.removeCssClass(this.textarea, "ace_composition"); + this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor; + this.textarea.style.cssText = this.$composition.cssText; + this.$composition = null; + }; + this.setTheme = function(theme, cb) { + var _self = this; + this.$themeId = theme; + _self._dispatchEvent('themeChange',{theme:theme}); + + if (!theme || typeof theme == "string") { + var moduleName = theme || this.$options.theme.initialValue; + config.loadModule(["theme", moduleName], afterLoad); + } else { + afterLoad(theme); + } + + function afterLoad(module) { + if (_self.$themeId != theme) + return cb && cb(); + if (!module.cssClass) + return; + dom.importCssString( + module.cssText, + module.cssClass, + _self.container.ownerDocument + ); + + if (_self.theme) + dom.removeCssClass(_self.container, _self.theme.cssClass); + + var padding = "padding" in module ? module.padding + : "padding" in (_self.theme || {}) ? 4 : _self.$padding; + if (_self.$padding && padding != _self.$padding) + _self.setPadding(padding); + _self.$theme = module.cssClass; + + _self.theme = module; + dom.addCssClass(_self.container, module.cssClass); + dom.setCssClass(_self.container, "ace_dark", module.isDark); + if (_self.$size) { + _self.$size.width = 0; + _self.$updateSizeAsync(); + } + + _self._dispatchEvent('themeLoaded', {theme:module}); + cb && cb(); + } + }; + this.getTheme = function() { + return this.$themeId; + }; + this.setStyle = function(style, include) { + dom.setCssClass(this.container, style, include !== false); + }; + this.unsetStyle = function(style) { + dom.removeCssClass(this.container, style); + }; + + this.setCursorStyle = function(style) { + if (this.scroller.style.cursor != style) + this.scroller.style.cursor = style; + }; + this.setMouseCursor = function(cursorStyle) { + this.scroller.style.cursor = cursorStyle; + }; + this.destroy = function() { + this.$textLayer.destroy(); + this.$cursorLayer.destroy(); + }; + + }).call(VirtualRenderer.prototype); + + + config.defineOptions(VirtualRenderer.prototype, "renderer", { + animatedScroll: {initialValue: false}, + showInvisibles: { + set: function(value) { + if (this.$textLayer.setShowInvisibles(value)) + this.$loop.schedule(this.CHANGE_TEXT); + }, + initialValue: false + }, + showPrintMargin: { + set: function() { this.$updatePrintMargin(); }, + initialValue: true + }, + printMarginColumn: { + set: function() { this.$updatePrintMargin(); }, + initialValue: 80 + }, + printMargin: { + set: function(val) { + if (typeof val == "number") + this.$printMarginColumn = val; + this.$showPrintMargin = !!val; + this.$updatePrintMargin(); + }, + get: function() { + return this.$showPrintMargin && this.$printMarginColumn; + } + }, + showGutter: { + set: function(show){ + this.$gutter.style.display = show ? "block" : "none"; + this.$loop.schedule(this.CHANGE_FULL); + this.onGutterResize(); + }, + initialValue: true + }, + fadeFoldWidgets: { + set: function(show) { + dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show); + }, + initialValue: false + }, + showFoldWidgets: { + set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)}, + initialValue: true + }, + showLineNumbers: { + set: function(show) { + this.$gutterLayer.setShowLineNumbers(show); + this.$loop.schedule(this.CHANGE_GUTTER); + }, + initialValue: true + }, + displayIndentGuides: { + set: function(show) { + if (this.$textLayer.setDisplayIndentGuides(show)) + this.$loop.schedule(this.CHANGE_TEXT); + }, + initialValue: true + }, + highlightGutterLine: { + set: function(shouldHighlight) { + if (!this.$gutterLineHighlight) { + this.$gutterLineHighlight = dom.createElement("div"); + this.$gutterLineHighlight.className = "ace_gutter-active-line"; + this.$gutter.appendChild(this.$gutterLineHighlight); + return; + } + + this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none"; + if (this.$cursorLayer.$pixelPos) + this.$updateGutterLineHighlight(); + }, + initialValue: false, + value: true + }, + hScrollBarAlwaysVisible: { + set: function(val) { + if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: false + }, + vScrollBarAlwaysVisible: { + set: function(val) { + if (!this.$vScrollBarAlwaysVisible || !this.$vScroll) + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: false + }, + fontSize: { + set: function(size) { + if (typeof size == "number") + size = size + "px"; + this.container.style.fontSize = size; + this.updateFontSize(); + }, + initialValue: 12 + }, + fontFamily: { + set: function(name) { + this.container.style.fontFamily = name; + this.updateFontSize(); + } + }, + maxLines: { + set: function(val) { + this.updateFull(); + } + }, + minLines: { + set: function(val) { + this.updateFull(); + } + }, + scrollPastEnd: { + set: function(val) { + val = +val || 0; + if (this.$scrollPastEnd == val) + return; + this.$scrollPastEnd = val; + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: 0, + handlesSet: true + }, + fixedWidthGutter: { + set: function(val) { + this.$gutterLayer.$fixedWidth = !!val; + this.$loop.schedule(this.CHANGE_GUTTER); + } + }, + theme: { + set: function(val) { this.setTheme(val) }, + get: function() { return this.$themeId || this.theme; }, + initialValue: "./theme/textmate", + handlesSet: true + } + }); + + exports.VirtualRenderer = VirtualRenderer; + }); + + ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("../lib/oop"); + var net = acequire("../lib/net"); + var EventEmitter = acequire("../lib/event_emitter").EventEmitter; + var config = acequire("../config"); + + var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { + this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); + this.changeListener = this.changeListener.bind(this); + this.onMessage = this.onMessage.bind(this); + if (acequire.nameToUrl && !acequire.toUrl) + acequire.toUrl = acequire.nameToUrl; + + if (config.get("packaged") || !acequire.toUrl) { + workerUrl = workerUrl || config.moduleUrl(mod.id, "worker") + } else { + var normalizePath = this.$normalizePath; + workerUrl = workerUrl || normalizePath(acequire.toUrl("ace/worker/worker.js", null, "_")); + + var tlns = {}; + topLevelNamespaces.forEach(function(ns) { + tlns[ns] = normalizePath(acequire.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, "")); + }); + } + + try { + var workerSrc = mod.src; + var Blob = __webpack_require__(488); + var blob = new Blob([ workerSrc ], { type: 'application/javascript' }); + var blobUrl = (window.URL || window.webkitURL).createObjectURL(blob); + + this.$worker = new Worker(blobUrl); + + } catch(e) { + if (e instanceof window.DOMException) { + var blob = this.$workerBlob(workerUrl); + var URL = window.URL || window.webkitURL; + var blobURL = URL.createObjectURL(blob); + + this.$worker = new Worker(blobURL); + URL.revokeObjectURL(blobURL); + } else { + throw e; + } + } + this.$worker.postMessage({ + init : true, + tlns : tlns, + module : mod.id, + classname : classname + }); + + this.callbackId = 1; + this.callbacks = {}; + + this.$worker.onmessage = this.onMessage; + }; + + (function(){ + + oop.implement(this, EventEmitter); + + this.onMessage = function(e) { + var msg = e.data; + switch(msg.type) { + case "event": + this._signal(msg.name, {data: msg.data}); + break; + case "call": + var callback = this.callbacks[msg.id]; + if (callback) { + callback(msg.data); + delete this.callbacks[msg.id]; + } + break; + case "error": + this.reportError(msg.data); + break; + case "log": + window.console && console.log && console.log.apply(console, msg.data); + break; + } + }; + + this.reportError = function(err) { + window.console && console.error && console.error(err); + }; + + this.$normalizePath = function(path) { + return net.qualifyURL(path); + }; + + this.terminate = function() { + this._signal("terminate", {}); + this.deltaQueue = null; + this.$worker.terminate(); + this.$worker = null; + if (this.$doc) + this.$doc.off("change", this.changeListener); + this.$doc = null; + }; + + this.send = function(cmd, args) { + this.$worker.postMessage({command: cmd, args: args}); + }; + + this.call = function(cmd, args, callback) { + if (callback) { + var id = this.callbackId++; + this.callbacks[id] = callback; + args.push(id); + } + this.send(cmd, args); + }; + + this.emit = function(event, data) { + try { + this.$worker.postMessage({event: event, data: {data: data.data}}); + } + catch(ex) { + console.error(ex.stack); + } + }; + + this.attachToDocument = function(doc) { + if(this.$doc) + this.terminate(); + + this.$doc = doc; + this.call("setValue", [doc.getValue()]); + doc.on("change", this.changeListener); + }; + + this.changeListener = function(e) { + if (!this.deltaQueue) { + this.deltaQueue = [e.data]; + setTimeout(this.$sendDeltaQueue, 0); + } else + this.deltaQueue.push(e.data); + }; + + this.$sendDeltaQueue = function() { + var q = this.deltaQueue; + if (!q) return; + this.deltaQueue = null; + if (q.length > 20 && q.length > this.$doc.getLength() >> 1) { + this.call("setValue", [this.$doc.getValue()]); + } else + this.emit("change", {data: q}); + }; + + this.$workerBlob = function(workerUrl) { + var script = "importScripts('" + net.qualifyURL(workerUrl) + "');"; + try { + return new Blob([script], {"type": "application/javascript"}); + } catch (e) { // Backwards-compatibility + var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; + var blobBuilder = new BlobBuilder(); + blobBuilder.append(script); + return blobBuilder.getBlob("application/javascript"); + } + }; + + }).call(WorkerClient.prototype); + + + var UIWorkerClient = function(topLevelNamespaces, mod, classname) { + this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); + this.changeListener = this.changeListener.bind(this); + this.callbackId = 1; + this.callbacks = {}; + this.messageBuffer = []; + + var main = null; + var emitSync = false; + var sender = Object.create(EventEmitter); + var _self = this; + + this.$worker = {}; + this.$worker.terminate = function() {}; + this.$worker.postMessage = function(e) { + _self.messageBuffer.push(e); + if (main) { + if (emitSync) + setTimeout(processNext); + else + processNext(); + } + }; + this.setEmitSync = function(val) { emitSync = val }; + + var processNext = function() { + var msg = _self.messageBuffer.shift(); + if (msg.command) + main[msg.command].apply(main, msg.args); + else if (msg.event) + sender._signal(msg.event, msg.data); + }; + + sender.postMessage = function(msg) { + _self.onMessage({data: msg}); + }; + sender.callback = function(data, callbackId) { + this.postMessage({type: "call", id: callbackId, data: data}); + }; + sender.emit = function(name, data) { + this.postMessage({type: "event", name: name, data: data}); + }; + + config.loadModule(["worker", mod], function(Main) { + main = new Main[classname](sender); + while (_self.messageBuffer.length) + processNext(); + }); + }; + + UIWorkerClient.prototype = WorkerClient.prototype; + + exports.UIWorkerClient = UIWorkerClient; + exports.WorkerClient = WorkerClient; + + }); + + ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"], function(acequire, exports, module) { + "use strict"; + + var Range = acequire("./range").Range; + var EventEmitter = acequire("./lib/event_emitter").EventEmitter; + var oop = acequire("./lib/oop"); + + var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) { + var _self = this; + this.length = length; + this.session = session; + this.doc = session.getDocument(); + this.mainClass = mainClass; + this.othersClass = othersClass; + this.$onUpdate = this.onUpdate.bind(this); + this.doc.on("change", this.$onUpdate); + this.$others = others; + + this.$onCursorChange = function() { + setTimeout(function() { + _self.onCursorChange(); + }); + }; + + this.$pos = pos; + var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1}; + this.$undoStackDepth = undoStack.length; + this.setup(); + + session.selection.on("changeCursor", this.$onCursorChange); + }; + + (function() { + + oop.implement(this, EventEmitter); + this.setup = function() { + var _self = this; + var doc = this.doc; + var session = this.session; + var pos = this.$pos; + + this.selectionBefore = session.selection.toJSON(); + if (session.selection.inMultiSelectMode) + session.selection.toSingleRange(); + + this.pos = doc.createAnchor(pos.row, pos.column); + this.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false); + this.pos.on("change", function(event) { + session.removeMarker(_self.markerId); + _self.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.mainClass, null, false); + }); + this.others = []; + this.$others.forEach(function(other) { + var anchor = doc.createAnchor(other.row, other.column); + _self.others.push(anchor); + }); + session.setUndoSelect(false); + }; + this.showOtherMarkers = function() { + if(this.othersActive) return; + var session = this.session; + var _self = this; + this.othersActive = true; + this.others.forEach(function(anchor) { + anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false); + anchor.on("change", function(event) { + session.removeMarker(anchor.markerId); + anchor.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.othersClass, null, false); + }); + }); + }; + this.hideOtherMarkers = function() { + if(!this.othersActive) return; + this.othersActive = false; + for (var i = 0; i < this.others.length; i++) { + this.session.removeMarker(this.others[i].markerId); + } + }; + this.onUpdate = function(event) { + var delta = event.data; + var range = delta.range; + if(range.start.row !== range.end.row) return; + if(range.start.row !== this.pos.row) return; + if (this.$updating) return; + this.$updating = true; + var lengthDiff = delta.action === "insertText" ? range.end.column - range.start.column : range.start.column - range.end.column; + + if(range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1) { + var distanceFromStart = range.start.column - this.pos.column; + this.length += lengthDiff; + if(!this.session.$fromUndo) { + if(delta.action === "insertText") { + for (var i = this.others.length - 1; i >= 0; i--) { + var otherPos = this.others[i]; + var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + if(otherPos.row === range.start.row && range.start.column < otherPos.column) + newPos.column += lengthDiff; + this.doc.insert(newPos, delta.text); + } + } else if(delta.action === "removeText") { + for (var i = this.others.length - 1; i >= 0; i--) { + var otherPos = this.others[i]; + var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + if(otherPos.row === range.start.row && range.start.column < otherPos.column) + newPos.column += lengthDiff; + this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff)); + } + } + if(range.start.column === this.pos.column && delta.action === "insertText") { + setTimeout(function() { + this.pos.setPosition(this.pos.row, this.pos.column - lengthDiff); + for (var i = 0; i < this.others.length; i++) { + var other = this.others[i]; + var newPos = {row: other.row, column: other.column - lengthDiff}; + if(other.row === range.start.row && range.start.column < other.column) + newPos.column += lengthDiff; + other.setPosition(newPos.row, newPos.column); + } + }.bind(this), 0); + } + else if(range.start.column === this.pos.column && delta.action === "removeText") { + setTimeout(function() { + for (var i = 0; i < this.others.length; i++) { + var other = this.others[i]; + if(other.row === range.start.row && range.start.column < other.column) { + other.setPosition(other.row, other.column - lengthDiff); + } + } + }.bind(this), 0); + } + } + this.pos._emit("change", {value: this.pos}); + for (var i = 0; i < this.others.length; i++) { + this.others[i]._emit("change", {value: this.others[i]}); + } + } + this.$updating = false; + }; + + this.onCursorChange = function(event) { + if (this.$updating || !this.session) return; + var pos = this.session.selection.getCursor(); + if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) { + this.showOtherMarkers(); + this._emit("cursorEnter", event); + } else { + this.hideOtherMarkers(); + this._emit("cursorLeave", event); + } + }; + this.detach = function() { + this.session.removeMarker(this.markerId); + this.hideOtherMarkers(); + this.doc.removeEventListener("change", this.$onUpdate); + this.session.selection.removeEventListener("changeCursor", this.$onCursorChange); + this.pos.detach(); + for (var i = 0; i < this.others.length; i++) { + this.others[i].detach(); + } + this.session.setUndoSelect(true); + this.session = null; + }; + this.cancel = function() { + if(this.$undoStackDepth === -1) + throw Error("Canceling placeholders only supported with undo manager attached to session."); + var undoManager = this.session.getUndoManager(); + var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth; + for (var i = 0; i < undosRequired; i++) { + undoManager.undo(true); + } + if (this.selectionBefore) + this.session.selection.fromJSON(this.selectionBefore); + }; + }).call(PlaceHolder.prototype); + + + exports.PlaceHolder = PlaceHolder; + }); + + ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(acequire, exports, module) { + + var event = acequire("../lib/event"); + var useragent = acequire("../lib/useragent"); + function isSamePoint(p1, p2) { + return p1.row == p2.row && p1.column == p2.column; + } + + function onMouseDown(e) { + var ev = e.domEvent; + var alt = ev.altKey; + var shift = ev.shiftKey; + var ctrl = ev.ctrlKey; + var accel = e.getAccelKey(); + var button = e.getButton(); + + if (ctrl && useragent.isMac) + button = ev.button; + + if (e.editor.inMultiSelectMode && button == 2) { + e.editor.textInput.onContextMenu(e.domEvent); + return; + } + + if (!ctrl && !alt && !accel) { + if (button === 0 && e.editor.inMultiSelectMode) + e.editor.exitMultiSelectMode(); + return; + } + + if (button !== 0) + return; + + var editor = e.editor; + var selection = editor.selection; + var isMultiSelect = editor.inMultiSelectMode; + var pos = e.getDocumentPosition(); + var cursor = selection.getCursor(); + var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor)); + + var mouseX = e.x, mouseY = e.y; + var onMouseSelection = function(e) { + mouseX = e.clientX; + mouseY = e.clientY; + }; + + var session = editor.session; + var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); + var screenCursor = screenAnchor; + + var selectionMode; + if (editor.$mouseHandler.$enableJumpToDef) { + if (ctrl && alt || accel && alt) + selectionMode = "add"; + else if (alt) + selectionMode = "block"; + } else { + if (accel && !alt) { + selectionMode = "add"; + if (!isMultiSelect && shift) + return; + } else if (alt) { + selectionMode = "block"; + } + } + + if (selectionMode && useragent.isMac && ev.ctrlKey) { + editor.$mouseHandler.cancelContextMenu(); + } + + if (selectionMode == "add") { + if (!isMultiSelect && inSelection) + return; // dragging + + if (!isMultiSelect) { + var range = selection.toOrientedRange(); + editor.addSelectionMarker(range); + } + + var oldRange = selection.rangeList.rangeAtPoint(pos); + + + editor.$blockScrolling++; + editor.inVirtualSelectionMode = true; + + if (shift) { + oldRange = null; + range = selection.ranges[0]; + editor.removeSelectionMarker(range); + } + editor.once("mouseup", function() { + var tmpSel = selection.toOrientedRange(); + + if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor)) + selection.substractPoint(tmpSel.cursor); + else { + if (shift) { + selection.substractPoint(range.cursor); + } else if (range) { + editor.removeSelectionMarker(range); + selection.addRange(range); + } + selection.addRange(tmpSel); + } + editor.$blockScrolling--; + editor.inVirtualSelectionMode = false; + }); + + } else if (selectionMode == "block") { + e.stop(); + editor.inVirtualSelectionMode = true; + var initialRange; + var rectSel = []; + var blockSelect = function() { + var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); + var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column); + + if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead)) + return; + screenCursor = newCursor; + + editor.$blockScrolling++; + editor.selection.moveToPosition(cursor); + editor.renderer.scrollCursorIntoView(); + + editor.removeSelectionMarkers(rectSel); + rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor); + if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty()) + rectSel[0] = editor.$mouseHandler.$clickSelection.clone(); + rectSel.forEach(editor.addSelectionMarker, editor); + editor.updateSelectionMarkers(); + editor.$blockScrolling--; + }; + editor.$blockScrolling++; + if (isMultiSelect && !accel) { + selection.toSingleRange(); + } else if (!isMultiSelect && accel) { + initialRange = selection.toOrientedRange(); + editor.addSelectionMarker(initialRange); + } + + if (shift) + screenAnchor = session.documentToScreenPosition(selection.lead); + else + selection.moveToPosition(pos); + editor.$blockScrolling--; + + screenCursor = {row: -1, column: -1}; + + var onMouseSelectionEnd = function(e) { + clearInterval(timerId); + editor.removeSelectionMarkers(rectSel); + if (!rectSel.length) + rectSel = [selection.toOrientedRange()]; + editor.$blockScrolling++; + if (initialRange) { + editor.removeSelectionMarker(initialRange); + selection.toSingleRange(initialRange); + } + for (var i = 0; i < rectSel.length; i++) + selection.addRange(rectSel[i]); + editor.inVirtualSelectionMode = false; + editor.$mouseHandler.$clickSelection = null; + editor.$blockScrolling--; + }; + + var onSelectionInterval = blockSelect; + + event.capture(editor.container, onMouseSelection, onMouseSelectionEnd); + var timerId = setInterval(function() {onSelectionInterval();}, 20); + + return e.preventDefault(); + } + } + + + exports.onMouseDown = onMouseDown; + + }); + + ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"], function(acequire, exports, module) { + exports.defaultCommands = [{ + name: "addCursorAbove", + exec: function(editor) { editor.selectMoreLines(-1); }, + bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "addCursorBelow", + exec: function(editor) { editor.selectMoreLines(1); }, + bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "addCursorAboveSkipCurrent", + exec: function(editor) { editor.selectMoreLines(-1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "addCursorBelowSkipCurrent", + exec: function(editor) { editor.selectMoreLines(1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "selectMoreBefore", + exec: function(editor) { editor.selectMore(-1); }, + bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "selectMoreAfter", + exec: function(editor) { editor.selectMore(1); }, + bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "selectNextBefore", + exec: function(editor) { editor.selectMore(-1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "selectNextAfter", + exec: function(editor) { editor.selectMore(1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"}, + scrollIntoView: "cursor", + readonly: true + }, { + name: "splitIntoLines", + exec: function(editor) { editor.multiSelect.splitIntoLines(); }, + bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"}, + readonly: true + }, { + name: "alignCursors", + exec: function(editor) { editor.alignCursors(); }, + bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"}, + scrollIntoView: "cursor" + }, { + name: "findAll", + exec: function(editor) { editor.findAll(); }, + bindKey: {win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G"}, + scrollIntoView: "cursor", + readonly: true + }]; + exports.multiSelectCommands = [{ + name: "singleSelection", + bindKey: "esc", + exec: function(editor) { editor.exitMultiSelectMode(); }, + scrollIntoView: "cursor", + readonly: true, + isAvailable: function(editor) {return editor && editor.inMultiSelectMode} + }]; + + var HashHandler = acequire("../keyboard/hash_handler").HashHandler; + exports.keyboardHandler = new HashHandler(exports.multiSelectCommands); + + }); + + ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"], function(acequire, exports, module) { + + var RangeList = acequire("./range_list").RangeList; + var Range = acequire("./range").Range; + var Selection = acequire("./selection").Selection; + var onMouseDown = acequire("./mouse/multi_select_handler").onMouseDown; + var event = acequire("./lib/event"); + var lang = acequire("./lib/lang"); + var commands = acequire("./commands/multi_select_commands"); + exports.commands = commands.defaultCommands.concat(commands.multiSelectCommands); + var Search = acequire("./search").Search; + var search = new Search(); + + function find(session, needle, dir) { + search.$options.wrap = true; + search.$options.needle = needle; + search.$options.backwards = dir == -1; + return search.find(session); + } + var EditSession = acequire("./edit_session").EditSession; + (function() { + this.getSelectionMarkers = function() { + return this.$selectionMarkers; + }; + }).call(EditSession.prototype); + (function() { + this.ranges = null; + this.rangeList = null; + this.addRange = function(range, $blockChangeEvents) { + if (!range) + return; + + if (!this.inMultiSelectMode && this.rangeCount === 0) { + var oldRange = this.toOrientedRange(); + this.rangeList.add(oldRange); + this.rangeList.add(range); + if (this.rangeList.ranges.length != 2) { + this.rangeList.removeAll(); + return $blockChangeEvents || this.fromOrientedRange(range); + } + this.rangeList.removeAll(); + this.rangeList.add(oldRange); + this.$onAddRange(oldRange); + } + + if (!range.cursor) + range.cursor = range.end; + + var removed = this.rangeList.add(range); + + this.$onAddRange(range); + + if (removed.length) + this.$onRemoveRange(removed); + + if (this.rangeCount > 1 && !this.inMultiSelectMode) { + this._signal("multiSelect"); + this.inMultiSelectMode = true; + this.session.$undoSelect = false; + this.rangeList.attach(this.session); + } + + return $blockChangeEvents || this.fromOrientedRange(range); + }; + + this.toSingleRange = function(range) { + range = range || this.ranges[0]; + var removed = this.rangeList.removeAll(); + if (removed.length) + this.$onRemoveRange(removed); + + range && this.fromOrientedRange(range); + }; + this.substractPoint = function(pos) { + var removed = this.rangeList.substractPoint(pos); + if (removed) { + this.$onRemoveRange(removed); + return removed[0]; + } + }; + this.mergeOverlappingRanges = function() { + var removed = this.rangeList.merge(); + if (removed.length) + this.$onRemoveRange(removed); + else if(this.ranges[0]) + this.fromOrientedRange(this.ranges[0]); + }; + + this.$onAddRange = function(range) { + this.rangeCount = this.rangeList.ranges.length; + this.ranges.unshift(range); + this._signal("addRange", {range: range}); + }; + + this.$onRemoveRange = function(removed) { + this.rangeCount = this.rangeList.ranges.length; + if (this.rangeCount == 1 && this.inMultiSelectMode) { + var lastRange = this.rangeList.ranges.pop(); + removed.push(lastRange); + this.rangeCount = 0; + } + + for (var i = removed.length; i--; ) { + var index = this.ranges.indexOf(removed[i]); + this.ranges.splice(index, 1); + } + + this._signal("removeRange", {ranges: removed}); + + if (this.rangeCount === 0 && this.inMultiSelectMode) { + this.inMultiSelectMode = false; + this._signal("singleSelect"); + this.session.$undoSelect = true; + this.rangeList.detach(this.session); + } + + lastRange = lastRange || this.ranges[0]; + if (lastRange && !lastRange.isEqual(this.getRange())) + this.fromOrientedRange(lastRange); + }; + this.$initRangeList = function() { + if (this.rangeList) + return; + + this.rangeList = new RangeList(); + this.ranges = []; + this.rangeCount = 0; + }; + this.getAllRanges = function() { + return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()]; + }; + + this.splitIntoLines = function () { + if (this.rangeCount > 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var range = this.getRange(); + var isBackwards = this.isBackwards(); + var startRow = range.start.row; + var endRow = range.end.row; + if (startRow == endRow) { + if (isBackwards) + var start = range.end, end = range.start; + else + var start = range.start, end = range.end; + + this.addRange(Range.fromPoints(end, end)); + this.addRange(Range.fromPoints(start, start)); + return; + } + + var rectSel = []; + var r = this.getLineRange(startRow, true); + r.start.column = range.start.column; + rectSel.push(r); + + for (var i = startRow + 1; i < endRow; i++) + rectSel.push(this.getLineRange(i, true)); + + r = this.getLineRange(endRow, true); + r.end.column = range.end.column; + rectSel.push(r); + + rectSel.forEach(this.addRange, this); + } + }; + this.toggleBlockSelection = function () { + if (this.rangeCount > 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var cursor = this.session.documentToScreenPosition(this.selectionLead); + var anchor = this.session.documentToScreenPosition(this.selectionAnchor); + + var rectSel = this.rectangularRangeBlock(cursor, anchor); + rectSel.forEach(this.addRange, this); + } + }; + this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) { + var rectSel = []; + + var xBackwards = screenCursor.column < screenAnchor.column; + if (xBackwards) { + var startColumn = screenCursor.column; + var endColumn = screenAnchor.column; + } else { + var startColumn = screenAnchor.column; + var endColumn = screenCursor.column; + } + + var yBackwards = screenCursor.row < screenAnchor.row; + if (yBackwards) { + var startRow = screenCursor.row; + var endRow = screenAnchor.row; + } else { + var startRow = screenAnchor.row; + var endRow = screenCursor.row; + } + + if (startColumn < 0) + startColumn = 0; + if (startRow < 0) + startRow = 0; + + if (startRow == endRow) + includeEmptyLines = true; + + for (var row = startRow; row <= endRow; row++) { + var range = Range.fromPoints( + this.session.screenToDocumentPosition(row, startColumn), + this.session.screenToDocumentPosition(row, endColumn) + ); + if (range.isEmpty()) { + if (docEnd && isSamePoint(range.end, docEnd)) + break; + var docEnd = range.end; + } + range.cursor = xBackwards ? range.start : range.end; + rectSel.push(range); + } + + if (yBackwards) + rectSel.reverse(); + + if (!includeEmptyLines) { + var end = rectSel.length - 1; + while (rectSel[end].isEmpty() && end > 0) + end--; + if (end > 0) { + var start = 0; + while (rectSel[start].isEmpty()) + start++; + } + for (var i = end; i >= start; i--) { + if (rectSel[i].isEmpty()) + rectSel.splice(i, 1); + } + } + + return rectSel; + }; + }).call(Selection.prototype); + var Editor = acequire("./editor").Editor; + (function() { + this.updateSelectionMarkers = function() { + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + this.addSelectionMarker = function(orientedRange) { + if (!orientedRange.cursor) + orientedRange.cursor = orientedRange.end; + + var style = this.getSelectionStyle(); + orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style); + + this.session.$selectionMarkers.push(orientedRange); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + return orientedRange; + }; + this.removeSelectionMarker = function(range) { + if (!range.marker) + return; + this.session.removeMarker(range.marker); + var index = this.session.$selectionMarkers.indexOf(range); + if (index != -1) + this.session.$selectionMarkers.splice(index, 1); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + }; + + this.removeSelectionMarkers = function(ranges) { + var markerList = this.session.$selectionMarkers; + for (var i = ranges.length; i--; ) { + var range = ranges[i]; + if (!range.marker) + continue; + this.session.removeMarker(range.marker); + var index = markerList.indexOf(range); + if (index != -1) + markerList.splice(index, 1); + } + this.session.selectionMarkerCount = markerList.length; + }; + + this.$onAddRange = function(e) { + this.addSelectionMarker(e.range); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onRemoveRange = function(e) { + this.removeSelectionMarkers(e.ranges); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onMultiSelect = function(e) { + if (this.inMultiSelectMode) + return; + this.inMultiSelectMode = true; + + this.setStyle("ace_multiselect"); + this.keyBinding.addKeyboardHandler(commands.keyboardHandler); + this.commands.setDefaultHandler("exec", this.$onMultiSelectExec); + + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onSingleSelect = function(e) { + if (this.session.multiSelect.inVirtualMode) + return; + this.inMultiSelectMode = false; + + this.unsetStyle("ace_multiselect"); + this.keyBinding.removeKeyboardHandler(commands.keyboardHandler); + + this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + this._emit("changeSelection"); + }; + + this.$onMultiSelectExec = function(e) { + var command = e.command; + var editor = e.editor; + if (!editor.multiSelect) + return; + if (!command.multiSelectAction) { + var result = command.exec(editor, e.args || {}); + editor.multiSelect.addRange(editor.multiSelect.toOrientedRange()); + editor.multiSelect.mergeOverlappingRanges(); + } else if (command.multiSelectAction == "forEach") { + result = editor.forEachSelection(command, e.args); + } else if (command.multiSelectAction == "forEachLine") { + result = editor.forEachSelection(command, e.args, true); + } else if (command.multiSelectAction == "single") { + editor.exitMultiSelectMode(); + result = command.exec(editor, e.args || {}); + } else { + result = command.multiSelectAction(editor, e.args || {}); + } + return result; + }; + this.forEachSelection = function(cmd, args, options) { + if (this.inVirtualSelectionMode) + return; + var keepOrder = options && options.keepOrder; + var $byLines = options == true || options && options.$byLines + var session = this.session; + var selection = this.selection; + var rangeList = selection.rangeList; + var ranges = (keepOrder ? selection : rangeList).ranges; + var result; + + if (!ranges.length) + return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); + + var reg = selection._eventRegistry; + selection._eventRegistry = {}; + + var tmpSel = new Selection(session); + this.inVirtualSelectionMode = true; + for (var i = ranges.length; i--;) { + if ($byLines) { + while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row) + i--; + } + tmpSel.fromOrientedRange(ranges[i]); + tmpSel.index = i; + this.selection = session.selection = tmpSel; + var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); + if (!result && cmdResult !== undefined) + result = cmdResult; + tmpSel.toOrientedRange(ranges[i]); + } + tmpSel.detach(); + + this.selection = session.selection = selection; + this.inVirtualSelectionMode = false; + selection._eventRegistry = reg; + selection.mergeOverlappingRanges(); + + var anim = this.renderer.$scrollAnimation; + this.onCursorChange(); + this.onSelectionChange(); + if (anim && anim.from == anim.to) + this.renderer.animateScrolling(anim.from); + + return result; + }; + this.exitMultiSelectMode = function() { + if (!this.inMultiSelectMode || this.inVirtualSelectionMode) + return; + this.multiSelect.toSingleRange(); + }; + + this.getSelectedText = function() { + var text = ""; + if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { + var ranges = this.multiSelect.rangeList.ranges; + var buf = []; + for (var i = 0; i < ranges.length; i++) { + buf.push(this.session.getTextRange(ranges[i])); + } + var nl = this.session.getDocument().getNewLineCharacter(); + text = buf.join(nl); + if (text.length == (buf.length - 1) * nl.length) + text = ""; + } else if (!this.selection.isEmpty()) { + text = this.session.getTextRange(this.getSelectionRange()); + } + return text; + }; + + this.$checkMultiselectChange = function(e, anchor) { + if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { + var range = this.multiSelect.ranges[0]; + if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor) + return; + var pos = anchor == this.multiSelect.anchor + ? range.cursor == range.start ? range.end : range.start + : range.cursor; + if (pos.row != anchor.row + || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column) + this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()); + } + }; + this.findAll = function(needle, options, additive) { + options = options || {}; + options.needle = needle || options.needle; + if (options.needle == undefined) { + var range = this.selection.isEmpty() + ? this.selection.getWordRange() + : this.selection.getRange(); + options.needle = this.session.getTextRange(range); + } + this.$search.set(options); + + var ranges = this.$search.findAll(this.session); + if (!ranges.length) + return 0; + + this.$blockScrolling += 1; + var selection = this.multiSelect; + + if (!additive) + selection.toSingleRange(ranges[0]); + + for (var i = ranges.length; i--; ) + selection.addRange(ranges[i], true); + if (range && selection.rangeList.rangeAtPoint(range.start)) + selection.addRange(range, true); + + this.$blockScrolling -= 1; + + return ranges.length; + }; + this.selectMoreLines = function(dir, skip) { + var range = this.selection.toOrientedRange(); + var isBackwards = range.cursor == range.end; + + var screenLead = this.session.documentToScreenPosition(range.cursor); + if (this.selection.$desiredColumn) + screenLead.column = this.selection.$desiredColumn; + + var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column); + + if (!range.isEmpty()) { + var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start); + var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column); + } else { + var anchor = lead; + } + + if (isBackwards) { + var newRange = Range.fromPoints(lead, anchor); + newRange.cursor = newRange.start; + } else { + var newRange = Range.fromPoints(anchor, lead); + newRange.cursor = newRange.end; + } + + newRange.desiredColumn = screenLead.column; + if (!this.selection.inMultiSelectMode) { + this.selection.addRange(range); + } else { + if (skip) + var toRemove = range.cursor; + } + + this.selection.addRange(newRange); + if (toRemove) + this.selection.substractPoint(toRemove); + }; + this.transposeSelections = function(dir) { + var session = this.session; + var sel = session.multiSelect; + var all = sel.ranges; + + for (var i = all.length; i--; ) { + var range = all[i]; + if (range.isEmpty()) { + var tmp = session.getWordRange(range.start.row, range.start.column); + range.start.row = tmp.start.row; + range.start.column = tmp.start.column; + range.end.row = tmp.end.row; + range.end.column = tmp.end.column; + } + } + sel.mergeOverlappingRanges(); + + var words = []; + for (var i = all.length; i--; ) { + var range = all[i]; + words.unshift(session.getTextRange(range)); + } + + if (dir < 0) + words.unshift(words.pop()); + else + words.push(words.shift()); + + for (var i = all.length; i--; ) { + var range = all[i]; + var tmp = range.clone(); + session.replace(range, words[i]); + range.start.row = tmp.start.row; + range.start.column = tmp.start.column; + } + }; + this.selectMore = function(dir, skip, stopAtFirst) { + var session = this.session; + var sel = session.multiSelect; + + var range = sel.toOrientedRange(); + if (range.isEmpty()) { + range = session.getWordRange(range.start.row, range.start.column); + range.cursor = dir == -1 ? range.start : range.end; + this.multiSelect.addRange(range); + if (stopAtFirst) + return; + } + var needle = session.getTextRange(range); + + var newRange = find(session, needle, dir); + if (newRange) { + newRange.cursor = dir == -1 ? newRange.start : newRange.end; + this.$blockScrolling += 1; + this.session.unfold(newRange); + this.multiSelect.addRange(newRange); + this.$blockScrolling -= 1; + this.renderer.scrollCursorIntoView(null, 0.5); + } + if (skip) + this.multiSelect.substractPoint(range.cursor); + }; + this.alignCursors = function() { + var session = this.session; + var sel = session.multiSelect; + var ranges = sel.ranges; + var row = -1; + var sameRowRanges = ranges.filter(function(r) { + if (r.cursor.row == row) + return true; + row = r.cursor.row; + }); + + if (!ranges.length || sameRowRanges.length == ranges.length - 1) { + var range = this.selection.getRange(); + var fr = range.start.row, lr = range.end.row; + var guessRange = fr == lr; + if (guessRange) { + var max = this.session.getLength(); + var line; + do { + line = this.session.getLine(lr); + } while (/[=:]/.test(line) && ++lr < max); + do { + line = this.session.getLine(fr); + } while (/[=:]/.test(line) && --fr > 0); + + if (fr < 0) fr = 0; + if (lr >= max) lr = max - 1; + } + var lines = this.session.doc.removeLines(fr, lr); + lines = this.$reAlignText(lines, guessRange); + this.session.doc.insert({row: fr, column: 0}, lines.join("\n") + "\n"); + if (!guessRange) { + range.start.column = 0; + range.end.column = lines[lines.length - 1].length; + } + this.selection.setRange(range); + } else { + sameRowRanges.forEach(function(r) { + sel.substractPoint(r.cursor); + }); + + var maxCol = 0; + var minSpace = Infinity; + var spaceOffsets = ranges.map(function(r) { + var p = r.cursor; + var line = session.getLine(p.row); + var spaceOffset = line.substr(p.column).search(/\S/g); + if (spaceOffset == -1) + spaceOffset = 0; + + if (p.column > maxCol) + maxCol = p.column; + if (spaceOffset < minSpace) + minSpace = spaceOffset; + return spaceOffset; + }); + ranges.forEach(function(r, i) { + var p = r.cursor; + var l = maxCol - p.column; + var d = spaceOffsets[i] - minSpace; + if (l > d) + session.insert(p, lang.stringRepeat(" ", l - d)); + else + session.remove(new Range(p.row, p.column, p.row, p.column - l + d)); + + r.start.column = r.end.column = maxCol; + r.start.row = r.end.row = p.row; + r.cursor = r.end; + }); + sel.fromOrientedRange(ranges[0]); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + } + }; + + this.$reAlignText = function(lines, forceLeft) { + var isLeftAligned = true, isRightAligned = true; + var startW, textW, endW; + + return lines.map(function(line) { + var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/); + if (!m) + return [line]; + + if (startW == null) { + startW = m[1].length; + textW = m[2].length; + endW = m[3].length; + return m; + } + + if (startW + textW + endW != m[1].length + m[2].length + m[3].length) + isRightAligned = false; + if (startW != m[1].length) + isLeftAligned = false; + + if (startW > m[1].length) + startW = m[1].length; + if (textW < m[2].length) + textW = m[2].length; + if (endW > m[3].length) + endW = m[3].length; + + return m; + }).map(forceLeft ? alignLeft : + isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign); + + function spaces(n) { + return lang.stringRepeat(" ", n); + } + + function alignLeft(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(textW - m[2].length + endW) + + m[4].replace(/^([=:])\s+/, "$1 "); + } + function alignRight(m) { + return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2] + + spaces(endW, " ") + + m[4].replace(/^([=:])\s+/, "$1 "); + } + function unAlign(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(endW) + + m[4].replace(/^([=:])\s+/, "$1 "); + } + }; + }).call(Editor.prototype); + + + function isSamePoint(p1, p2) { + return p1.row == p2.row && p1.column == p2.column; + } + exports.onSessionChange = function(e) { + var session = e.session; + if (session && !session.multiSelect) { + session.$selectionMarkers = []; + session.selection.$initRangeList(); + session.multiSelect = session.selection; + } + this.multiSelect = session && session.multiSelect; + + var oldSession = e.oldSession; + if (oldSession) { + oldSession.multiSelect.off("addRange", this.$onAddRange); + oldSession.multiSelect.off("removeRange", this.$onRemoveRange); + oldSession.multiSelect.off("multiSelect", this.$onMultiSelect); + oldSession.multiSelect.off("singleSelect", this.$onSingleSelect); + oldSession.multiSelect.lead.off("change", this.$checkMultiselectChange); + oldSession.multiSelect.anchor.off("change", this.$checkMultiselectChange); + } + + if (session) { + session.multiSelect.on("addRange", this.$onAddRange); + session.multiSelect.on("removeRange", this.$onRemoveRange); + session.multiSelect.on("multiSelect", this.$onMultiSelect); + session.multiSelect.on("singleSelect", this.$onSingleSelect); + session.multiSelect.lead.on("change", this.$checkMultiselectChange); + session.multiSelect.anchor.on("change", this.$checkMultiselectChange); + } + + if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) { + if (session.selection.inMultiSelectMode) + this.$onMultiSelect(); + else + this.$onSingleSelect(); + } + }; + function MultiSelect(editor) { + if (editor.$multiselectOnSessionChange) + return; + editor.$onAddRange = editor.$onAddRange.bind(editor); + editor.$onRemoveRange = editor.$onRemoveRange.bind(editor); + editor.$onMultiSelect = editor.$onMultiSelect.bind(editor); + editor.$onSingleSelect = editor.$onSingleSelect.bind(editor); + editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor); + editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor); + + editor.$multiselectOnSessionChange(editor); + editor.on("changeSession", editor.$multiselectOnSessionChange); + + editor.on("mousedown", onMouseDown); + editor.commands.addCommands(commands.defaultCommands); + + addAltCursorListeners(editor); + } + + function addAltCursorListeners(editor){ + var el = editor.textInput.getElement(); + var altCursor = false; + event.addListener(el, "keydown", function(e) { + if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) { + if (!altCursor) { + editor.renderer.setMouseCursor("crosshair"); + altCursor = true; + } + } else if (altCursor) { + reset(); + } + }); + + event.addListener(el, "keyup", reset); + event.addListener(el, "blur", reset); + function reset(e) { + if (altCursor) { + editor.renderer.setMouseCursor(""); + altCursor = false; + } + } + } + + exports.MultiSelect = MultiSelect; + + + acequire("./config").defineOptions(Editor.prototype, "editor", { + enableMultiselect: { + set: function(val) { + MultiSelect(this); + if (val) { + this.on("changeSession", this.$multiselectOnSessionChange); + this.on("mousedown", onMouseDown); + } else { + this.off("changeSession", this.$multiselectOnSessionChange); + this.off("mousedown", onMouseDown); + } + }, + value: true + } + }); + + + + }); + + ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"], function(acequire, exports, module) { + "use strict"; + + var Range = acequire("../../range").Range; + + var FoldMode = exports.FoldMode = function() {}; + + (function() { + + this.foldingStartMarker = null; + this.foldingStopMarker = null; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + if (this.foldingStartMarker.test(line)) + return "start"; + if (foldStyle == "markbeginend" + && this.foldingStopMarker + && this.foldingStopMarker.test(line)) + return "end"; + return ""; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + return null; + }; + + this.indentationBlock = function(session, row, column) { + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1) + return; + + var startColumn = column || line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + var level = session.getLine(row).search(re); + + if (level == -1) + continue; + + if (level <= startLevel) + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + + this.openingBracketBlock = function(session, bracket, row, column, typeRe) { + var start = {row: row, column: column + 1}; + var end = session.$findClosingBracket(bracket, start, typeRe); + if (!end) + return; + + var fw = session.foldWidgets[end.row]; + if (fw == null) + fw = session.getFoldWidget(end.row); + + if (fw == "start" && end.row > start.row) { + end.row --; + end.column = session.getLine(end.row).length; + } + return Range.fromPoints(start, end); + }; + + this.closingBracketBlock = function(session, bracket, row, column, typeRe) { + var end = {row: row, column: column}; + var start = session.$findOpeningBracket(bracket, end); + + if (!start) + return; + + start.column++; + end.column--; + + return Range.fromPoints(start, end); + }; + }).call(FoldMode.prototype); + + }); + + ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { + "use strict"; + + exports.isDark = false; + exports.cssClass = "ace-tm"; + exports.cssText = ".ace-tm .ace_gutter {\ + background: #f0f0f0;\ + color: #333;\ + }\ + .ace-tm .ace_print-margin {\ + width: 1px;\ + background: #e8e8e8;\ + }\ + .ace-tm .ace_fold {\ + background-color: #6B72E6;\ + }\ + .ace-tm {\ + background-color: #FFFFFF;\ + color: black;\ + }\ + .ace-tm .ace_cursor {\ + color: black;\ + }\ + .ace-tm .ace_invisible {\ + color: rgb(191, 191, 191);\ + }\ + .ace-tm .ace_storage,\ + .ace-tm .ace_keyword {\ + color: blue;\ + }\ + .ace-tm .ace_constant {\ + color: rgb(197, 6, 11);\ + }\ + .ace-tm .ace_constant.ace_buildin {\ + color: rgb(88, 72, 246);\ + }\ + .ace-tm .ace_constant.ace_language {\ + color: rgb(88, 92, 246);\ + }\ + .ace-tm .ace_constant.ace_library {\ + color: rgb(6, 150, 14);\ + }\ + .ace-tm .ace_invalid {\ + background-color: rgba(255, 0, 0, 0.1);\ + color: red;\ + }\ + .ace-tm .ace_support.ace_function {\ + color: rgb(60, 76, 114);\ + }\ + .ace-tm .ace_support.ace_constant {\ + color: rgb(6, 150, 14);\ + }\ + .ace-tm .ace_support.ace_type,\ + .ace-tm .ace_support.ace_class {\ + color: rgb(109, 121, 222);\ + }\ + .ace-tm .ace_keyword.ace_operator {\ + color: rgb(104, 118, 135);\ + }\ + .ace-tm .ace_string {\ + color: rgb(3, 106, 7);\ + }\ + .ace-tm .ace_comment {\ + color: rgb(76, 136, 107);\ + }\ + .ace-tm .ace_comment.ace_doc {\ + color: rgb(0, 102, 255);\ + }\ + .ace-tm .ace_comment.ace_doc.ace_tag {\ + color: rgb(128, 159, 191);\ + }\ + .ace-tm .ace_constant.ace_numeric {\ + color: rgb(0, 0, 205);\ + }\ + .ace-tm .ace_variable {\ + color: rgb(49, 132, 149);\ + }\ + .ace-tm .ace_xml-pe {\ + color: rgb(104, 104, 91);\ + }\ + .ace-tm .ace_entity.ace_name.ace_function {\ + color: #0000A2;\ + }\ + .ace-tm .ace_heading {\ + color: rgb(12, 7, 255);\ + }\ + .ace-tm .ace_list {\ + color:rgb(185, 6, 144);\ + }\ + .ace-tm .ace_meta.ace_tag {\ + color:rgb(0, 22, 142);\ + }\ + .ace-tm .ace_string.ace_regex {\ + color: rgb(255, 0, 0)\ + }\ + .ace-tm .ace_marker-layer .ace_selection {\ + background: rgb(181, 213, 255);\ + }\ + .ace-tm.ace_multiselect .ace_selection.ace_start {\ + box-shadow: 0 0 3px 0px white;\ + border-radius: 2px;\ + }\ + .ace-tm .ace_marker-layer .ace_step {\ + background: rgb(252, 255, 0);\ + }\ + .ace-tm .ace_marker-layer .ace_stack {\ + background: rgb(164, 229, 101);\ + }\ + .ace-tm .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgb(192, 192, 192);\ + }\ + .ace-tm .ace_marker-layer .ace_active-line {\ + background: rgba(0, 0, 0, 0.07);\ + }\ + .ace-tm .ace_gutter-active-line {\ + background-color : #dcdcdc;\ + }\ + .ace-tm .ace_marker-layer .ace_selected-word {\ + background: rgb(250, 250, 255);\ + border: 1px solid rgb(200, 200, 250);\ + }\ + .ace-tm .ace_indent-guide {\ + background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ + }\ + "; + + var dom = acequire("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); + }); + + ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("./lib/oop"); + var dom = acequire("./lib/dom"); + var Range = acequire("./range").Range; + + + function LineWidgets(session) { + this.session = session; + this.session.widgetManager = this; + this.session.getRowLength = this.getRowLength; + this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; + this.updateOnChange = this.updateOnChange.bind(this); + this.renderWidgets = this.renderWidgets.bind(this); + this.measureWidgets = this.measureWidgets.bind(this); + this.session._changedWidgets = []; + this.$onChangeEditor = this.$onChangeEditor.bind(this); + + this.session.on("change", this.updateOnChange); + this.session.on("changeEditor", this.$onChangeEditor); + } + + (function() { + this.getRowLength = function(row) { + var h; + if (this.lineWidgets) + h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0; + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1 + h; + } else { + return this.$wrapData[row].length + 1 + h; + } + }; + + this.$getWidgetScreenLength = function() { + var screenRows = 0; + this.lineWidgets.forEach(function(w){ + if (w && w.rowCount) + screenRows +=w.rowCount; + }); + return screenRows; + }; + + this.$onChangeEditor = function(e) { + this.attach(e.editor); + }; + + this.attach = function(editor) { + if (editor && editor.widgetManager && editor.widgetManager != this) + editor.widgetManager.detach(); + + if (this.editor == editor) + return; + + this.detach(); + this.editor = editor; + + if (editor) { + editor.widgetManager = this; + editor.renderer.on("beforeRender", this.measureWidgets); + editor.renderer.on("afterRender", this.renderWidgets); + } + }; + this.detach = function(e) { + var editor = this.editor; + if (!editor) + return; + + this.editor = null; + editor.widgetManager = null; + + editor.renderer.off("beforeRender", this.measureWidgets); + editor.renderer.off("afterRender", this.renderWidgets); + var lineWidgets = this.session.lineWidgets; + lineWidgets && lineWidgets.forEach(function(w) { + if (w && w.el && w.el.parentNode) { + w._inDocument = false; + w.el.parentNode.removeChild(w.el); + } + }); + }; + + this.updateOnChange = function(e) { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) return; + + var delta = e.data; + var range = delta.range; + var startRow = range.start.row; + var len = range.end.row - startRow; + + if (len === 0) { + } else if (delta.action == "removeText" || delta.action == "removeLines") { + var removed = lineWidgets.splice(startRow + 1, len); + removed.forEach(function(w) { + w && this.removeLineWidget(w); + }, this); + this.$updateRows(); + } else { + var args = new Array(len); + args.unshift(startRow, 0); + lineWidgets.splice.apply(lineWidgets, args); + this.$updateRows(); + } + }; + + this.$updateRows = function() { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) return; + var noWidgets = true; + lineWidgets.forEach(function(w, i) { + if (w) { + noWidgets = false; + w.row = i; + } + }); + if (noWidgets) + this.session.lineWidgets = null; + }; + + this.addLineWidget = function(w) { + if (!this.session.lineWidgets) + this.session.lineWidgets = new Array(this.session.getLength()); + + this.session.lineWidgets[w.row] = w; + + var renderer = this.editor.renderer; + if (w.html && !w.el) { + w.el = dom.createElement("div"); + w.el.innerHTML = w.html; + } + if (w.el) { + dom.addCssClass(w.el, "ace_lineWidgetContainer"); + w.el.style.position = "absolute"; + w.el.style.zIndex = 5; + renderer.container.appendChild(w.el); + w._inDocument = true; + } + + if (!w.coverGutter) { + w.el.style.zIndex = 3; + } + if (!w.pixelHeight) { + w.pixelHeight = w.el.offsetHeight; + } + if (w.rowCount == null) + w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; + + this.session._emit("changeFold", {data:{start:{row: w.row}}}); + + this.$updateRows(); + this.renderWidgets(null, renderer); + return w; + }; + + this.removeLineWidget = function(w) { + w._inDocument = false; + if (w.el && w.el.parentNode) + w.el.parentNode.removeChild(w.el); + if (w.editor && w.editor.destroy) try { + w.editor.destroy(); + } catch(e){} + if (this.session.lineWidgets) + this.session.lineWidgets[w.row] = undefined; + this.session._emit("changeFold", {data:{start:{row: w.row}}}); + this.$updateRows(); + }; + + this.onWidgetChanged = function(w) { + this.session._changedWidgets.push(w); + this.editor && this.editor.renderer.updateFull(); + }; + + this.measureWidgets = function(e, renderer) { + var changedWidgets = this.session._changedWidgets; + var config = renderer.layerConfig; + + if (!changedWidgets || !changedWidgets.length) return; + var min = Infinity; + for (var i = 0; i < changedWidgets.length; i++) { + var w = changedWidgets[i]; + if (!w._inDocument) { + w._inDocument = true; + renderer.container.appendChild(w.el); + } + + w.h = w.el.offsetHeight; + + if (!w.fixedWidth) { + w.w = w.el.offsetWidth; + w.screenWidth = Math.ceil(w.w / config.characterWidth); + } + + var rowCount = w.h / config.lineHeight; + if (w.coverLine) { + rowCount -= this.session.getRowLineCount(w.row); + if (rowCount < 0) + rowCount = 0; + } + if (w.rowCount != rowCount) { + w.rowCount = rowCount; + if (w.row < min) + min = w.row; + } + } + if (min != Infinity) { + this.session._emit("changeFold", {data:{start:{row: min}}}); + this.session.lineWidgetWidth = null; + } + this.session._changedWidgets = []; + }; + + this.renderWidgets = function(e, renderer) { + var config = renderer.layerConfig; + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var first = Math.min(this.firstRow, config.firstRow); + var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); + + while (first > 0 && !lineWidgets[first]) + first--; + + this.firstRow = config.firstRow; + this.lastRow = config.lastRow; + + renderer.$cursorLayer.config = config; + for (var i = first; i <= last; i++) { + var w = lineWidgets[i]; + if (!w || !w.el) continue; + + if (!w._inDocument) { + w._inDocument = true; + renderer.container.appendChild(w.el); + } + var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top; + if (!w.coverLine) + top += config.lineHeight * this.session.getRowLineCount(w.row); + w.el.style.top = top - config.offset + "px"; + + var left = w.coverGutter ? 0 : renderer.gutterWidth; + if (!w.fixedWidth) + left -= renderer.scrollLeft; + w.el.style.left = left + "px"; + + if (w.fixedWidth) { + w.el.style.right = renderer.scrollBar.getWidth() + "px"; + } else { + w.el.style.right = ""; + } + } + }; + + }).call(LineWidgets.prototype); + + + exports.LineWidgets = LineWidgets; + + }); + + ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"], function(acequire, exports, module) { + "use strict"; + var LineWidgets = acequire("../line_widgets").LineWidgets; + var dom = acequire("../lib/dom"); + var Range = acequire("../range").Range; + + function binarySearch(array, needle, comparator) { + var first = 0; + var last = array.length - 1; + + while (first <= last) { + var mid = (first + last) >> 1; + var c = comparator(needle, array[mid]); + if (c > 0) + first = mid + 1; + else if (c < 0) + last = mid - 1; + else + return mid; + } + return -(first + 1); + } + + function findAnnotations(session, row, dir) { + var annotations = session.getAnnotations().sort(Range.comparePoints); + if (!annotations.length) + return; + + var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints); + if (i < 0) + i = -i - 1; + + if (i >= annotations.length) + i = dir > 0 ? 0 : annotations.length - 1; + else if (i === 0 && dir < 0) + i = annotations.length - 1; + + var annotation = annotations[i]; + if (!annotation || !dir) + return; + + if (annotation.row === row) { + do { + annotation = annotations[i += dir]; + } while (annotation && annotation.row === row); + if (!annotation) + return annotations.slice(); + } + + + var matched = []; + row = annotation.row; + do { + matched[dir < 0 ? "unshift" : "push"](annotation); + annotation = annotations[i += dir]; + } while (annotation && annotation.row == row); + return matched.length && matched; + } + + exports.showErrorMarker = function(editor, dir) { + var session = editor.session; + if (!session.widgetManager) { + session.widgetManager = new LineWidgets(session); + session.widgetManager.attach(editor); + } + + var pos = editor.getCursorPosition(); + var row = pos.row; + var oldWidget = session.lineWidgets && session.lineWidgets[row]; + if (oldWidget) { + oldWidget.destroy(); + } else { + row -= dir; + } + var annotations = findAnnotations(session, row, dir); + var gutterAnno; + if (annotations) { + var annotation = annotations[0]; + pos.column = (annotation.pos && typeof annotation.column != "number" + ? annotation.pos.sc + : annotation.column) || 0; + pos.row = annotation.row; + gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; + } else if (oldWidget) { + return; + } else { + gutterAnno = { + text: ["Looks good!"], + className: "ace_ok" + }; + } + editor.session.unfold(pos.row); + editor.selection.moveToPosition(pos); + + var w = { + row: pos.row, + fixedWidth: true, + coverGutter: true, + el: dom.createElement("div") + }; + var el = w.el.appendChild(dom.createElement("div")); + var arrow = w.el.appendChild(dom.createElement("div")); + arrow.className = "error_widget_arrow " + gutterAnno.className; + + var left = editor.renderer.$cursorLayer + .getPixelPosition(pos).left; + arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; + + w.el.className = "error_widget_wrapper"; + el.className = "error_widget " + gutterAnno.className; + el.innerHTML = gutterAnno.text.join("
    "); + + el.appendChild(dom.createElement("div")); + + var kb = function(_, hashId, keyString) { + if (hashId === 0 && (keyString === "esc" || keyString === "return")) { + w.destroy(); + return {command: "null"}; + } + }; + + w.destroy = function() { + if (editor.$mouseHandler.isMousePressed) + return; + editor.keyBinding.removeKeyboardHandler(kb); + session.widgetManager.removeLineWidget(w); + editor.off("changeSelection", w.destroy); + editor.off("changeSession", w.destroy); + editor.off("mouseup", w.destroy); + editor.off("change", w.destroy); + }; + + editor.keyBinding.addKeyboardHandler(kb); + editor.on("changeSelection", w.destroy); + editor.on("changeSession", w.destroy); + editor.on("mouseup", w.destroy); + editor.on("change", w.destroy); + + editor.session.widgetManager.addLineWidget(w); + + w.el.onmousedown = editor.focus.bind(editor); + + editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight}); + }; + + + dom.importCssString("\ + .error_widget_wrapper {\ + background: inherit;\ + color: inherit;\ + border:none\ + }\ + .error_widget {\ + border-top: solid 2px;\ + border-bottom: solid 2px;\ + margin: 5px 0;\ + padding: 10px 40px;\ + white-space: pre-wrap;\ + }\ + .error_widget.ace_error, .error_widget_arrow.ace_error{\ + border-color: #ff5a5a\ + }\ + .error_widget.ace_warning, .error_widget_arrow.ace_warning{\ + border-color: #F1D817\ + }\ + .error_widget.ace_info, .error_widget_arrow.ace_info{\ + border-color: #5a5a5a\ + }\ + .error_widget.ace_ok, .error_widget_arrow.ace_ok{\ + border-color: #5aaa5a\ + }\ + .error_widget_arrow {\ + position: absolute;\ + border: solid 5px;\ + border-top-color: transparent!important;\ + border-right-color: transparent!important;\ + border-left-color: transparent!important;\ + top: -5px;\ + }\ + ", ""); + + }); + + ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"], function(acequire, exports, module) { + "use strict"; + + acequire("./lib/fixoldbrowsers"); + + var dom = acequire("./lib/dom"); + var event = acequire("./lib/event"); + + var Editor = acequire("./editor").Editor; + var EditSession = acequire("./edit_session").EditSession; + var UndoManager = acequire("./undomanager").UndoManager; + var Renderer = acequire("./virtual_renderer").VirtualRenderer; + acequire("./worker/worker_client"); + acequire("./keyboard/hash_handler"); + acequire("./placeholder"); + acequire("./multi_select"); + acequire("./mode/folding/fold_mode"); + acequire("./theme/textmate"); + acequire("./ext/error_marker"); + + exports.config = acequire("./config"); + exports.acequire = acequire; + exports.edit = function(el) { + if (typeof(el) == "string") { + var _id = el; + el = document.getElementById(_id); + if (!el) + throw new Error("ace.edit can't find div #" + _id); + } + + if (el && el.env && el.env.editor instanceof Editor) + return el.env.editor; + + var value = ""; + if (el && /input|textarea/i.test(el.tagName)) { + var oldNode = el; + value = oldNode.value; + el = dom.createElement("pre"); + oldNode.parentNode.replaceChild(el, oldNode); + } else { + value = dom.getInnerText(el); + el.innerHTML = ''; + } + + var doc = exports.createEditSession(value); + + var editor = new Editor(new Renderer(el)); + editor.setSession(doc); + + var env = { + document: doc, + editor: editor, + onResize: editor.resize.bind(editor, null) + }; + if (oldNode) env.textarea = oldNode; + event.addListener(window, "resize", env.onResize); + editor.on("destroy", function() { + event.removeListener(window, "resize", env.onResize); + env.editor.container.env = null; // prevent memory leak on old ie + }); + editor.container.env = editor.env = env; + return editor; + }; + exports.createEditSession = function(text, mode) { + var doc = new EditSession(text, mode); + doc.setUndoManager(new UndoManager()); + return doc; + } + exports.EditSession = EditSession; + exports.UndoManager = UndoManager; + }); + (function() { + ace.acequire(["ace/ace"], function(a) { + a && a.config.init(true); + if (!window.ace) + window.ace = a; + for (var key in a) if (a.hasOwnProperty(key)) + window.ace[key] = a[key]; + }); + })(); + + module.exports = window.ace.acequire("ace/ace"); + +/***/ }, +/* 487 */ +/***/ function(module, exports) { + + module.exports = function() { throw new Error("define cannot be used indirect"); }; + + +/***/ }, +/* 488 */ +/***/ function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {module.exports = get_blob() + + function get_blob() { + if(global.Blob) { + try { + new Blob(['asdf'], {type: 'text/plain'}) + return Blob + } catch(err) {} + } + + var Builder = global.WebKitBlobBuilder || + global.MozBlobBuilder || + global.MSBlobBuilder + + return function(parts, bag) { + var builder = new Builder + , endings = bag.endings + , type = bag.type + + if(endings) for(var i = 0, len = parts.length; i < len; ++i) { + builder.append(parts[i], endings) + } else for(var i = 0, len = parts.length; i < len; ++i) { + builder.append(parts[i]) + } + + return type ? builder.getBlob(type) : builder.getBlob() + } + } + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 489 */ +/***/ function(module, exports, __webpack_require__) { + + ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("../lib/oop"); + var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules; + + var JsonHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "variable", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' + }, { + token : "string", // single line + regex : '"', + next : "string" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : "invalid.illegal", // single quoted strings are not allowed + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "invalid.illegal", // comments are not allowed + regex : "\\/\\/.*$" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "string" : [ + { + token : "constant.language.escape", + regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ + }, { + token : "string", + regex : '[^"\\\\]+' + }, { + token : "string", + regex : '"', + next : "start" + }, { + token : "string", + regex : "", + next : "start" + } + ] + }; + + }; + + oop.inherits(JsonHighlightRules, TextHighlightRules); + + exports.JsonHighlightRules = JsonHighlightRules; + }); + + ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(acequire, exports, module) { + "use strict"; + + var Range = acequire("../range").Range; + + var MatchingBraceOutdent = function() {}; + + (function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + + }).call(MatchingBraceOutdent.prototype); + + exports.MatchingBraceOutdent = MatchingBraceOutdent; + }); + + ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("../../lib/oop"); + var Behaviour = acequire("../behaviour").Behaviour; + var TokenIterator = acequire("../../token_iterator").TokenIterator; + var lang = acequire("../../lib/lang"); + + var SAFE_INSERT_IN_TOKENS = + ["text", "paren.rparen", "punctuation.operator"]; + var SAFE_INSERT_BEFORE_TOKENS = + ["text", "paren.rparen", "punctuation.operator", "comment"]; + + var context; + var contextCache = {}; + var initContext = function(editor) { + var id = -1; + if (editor.multiSelect) { + id = editor.selection.index; + if (contextCache.rangeCount != editor.multiSelect.rangeCount) + contextCache = {rangeCount: editor.multiSelect.rangeCount}; + } + if (contextCache[id]) + return context = contextCache[id]; + context = contextCache[id] = { + autoInsertedBrackets: 0, + autoInsertedRow: -1, + autoInsertedLineEnd: "", + maybeInsertedBrackets: 0, + maybeInsertedRow: -1, + maybeInsertedLineStart: "", + maybeInsertedLineEnd: "" + }; + }; + + var getWrapped = function(selection, selected, opening, closing) { + var rowDiff = selection.end.row - selection.start.row; + return { + text: opening + selected + closing, + selection: [ + 0, + selection.start.column + 1, + rowDiff, + selection.end.column + (rowDiff ? 0 : 1) + ] + }; + }; + + var CstyleBehaviour = function() { + this.add("braces", "insertion", function(state, action, editor, session, text) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (text == '{') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '{', '}'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { + CstyleBehaviour.recordAutoInsert(editor, session, "}"); + return { + text: '{}', + selection: [1, 1] + }; + } else { + CstyleBehaviour.recordMaybeInsert(editor, session, "{"); + return { + text: '{', + selection: [1, 1] + }; + } + } + } else if (text == '}') { + initContext(editor); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '}') { + var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } else if (text == "\n" || text == "\r\n") { + initContext(editor); + var closing = ""; + if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { + closing = lang.stringRepeat("}", context.maybeInsertedBrackets); + CstyleBehaviour.clearMaybeInsertedClosing(); + } + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === '}') { + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); + if (!openBracePos) + return null; + var next_indent = this.$getIndent(session.getLine(openBracePos.row)); + } else if (closing) { + var next_indent = this.$getIndent(line); + } else { + CstyleBehaviour.clearMaybeInsertedClosing(); + return; + } + var indent = next_indent + session.getTabString(); + + return { + text: '\n' + indent + '\n' + next_indent + closing, + selection: [1, indent.length, 1, indent.length] + }; + } else { + CstyleBehaviour.clearMaybeInsertedClosing(); + } + }); + + this.add("braces", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '{') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar == '}') { + range.end.column++; + return range; + } else { + context.maybeInsertedBrackets--; + } + } + }); + + this.add("parens", "insertion", function(state, action, editor, session, text) { + if (text == '(') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '(', ')'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, ")"); + return { + text: '()', + selection: [1, 1] + }; + } + } else if (text == ')') { + initContext(editor); + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ')') { + var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("parens", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '(') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ')') { + range.end.column++; + return range; + } + } + }); + + this.add("brackets", "insertion", function(state, action, editor, session, text) { + if (text == '[') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '[', ']'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, "]"); + return { + text: '[]', + selection: [1, 1] + }; + } + } else if (text == ']') { + initContext(editor); + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ']') { + var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("brackets", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '[') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ']') { + range.end.column++; + return range; + } + } + }); + + this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { + if (text == '"' || text == "'") { + initContext(editor); + var quote = text; + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, quote, quote); + } else if (!selected) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var leftChar = line.substring(cursor.column-1, cursor.column); + var rightChar = line.substring(cursor.column, cursor.column + 1); + + var token = session.getTokenAt(cursor.row, cursor.column); + var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); + if (leftChar == "\\" && token && /escape/.test(token.type)) + return null; + + var stringBefore = token && /string/.test(token.type); + var stringAfter = !rightToken || /string/.test(rightToken.type); + + var pair; + if (rightChar == quote) { + pair = stringBefore !== stringAfter; + } else { + if (stringBefore && !stringAfter) + return null; // wrap string with different quote + if (stringBefore && stringAfter) + return null; // do not pair quotes inside strings + var wordRe = session.$mode.tokenRe; + wordRe.lastIndex = 0; + var isWordBefore = wordRe.test(leftChar); + wordRe.lastIndex = 0; + var isWordAfter = wordRe.test(leftChar); + if (isWordBefore || isWordAfter) + return null; // before or after alphanumeric + if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) + return null; // there is rightChar and it isn't closing + pair = true; + } + return { + text: pair ? quote + quote : "", + selection: [1,1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + }; + + + CstyleBehaviour.isSaneInsertion = function(editor, session) { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { + var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); + if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) + return false; + } + iterator.stepForward(); + return iterator.getCurrentTokenRow() !== cursor.row || + this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); + }; + + CstyleBehaviour.$matchTokenType = function(token, types) { + return types.indexOf(token.type || token) > -1; + }; + + CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) + context.autoInsertedBrackets = 0; + context.autoInsertedRow = cursor.row; + context.autoInsertedLineEnd = bracket + line.substr(cursor.column); + context.autoInsertedBrackets++; + }; + + CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isMaybeInsertedClosing(cursor, line)) + context.maybeInsertedBrackets = 0; + context.maybeInsertedRow = cursor.row; + context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; + context.maybeInsertedLineEnd = line.substr(cursor.column); + context.maybeInsertedBrackets++; + }; + + CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { + return context.autoInsertedBrackets > 0 && + cursor.row === context.autoInsertedRow && + bracket === context.autoInsertedLineEnd[0] && + line.substr(cursor.column) === context.autoInsertedLineEnd; + }; + + CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { + return context.maybeInsertedBrackets > 0 && + cursor.row === context.maybeInsertedRow && + line.substr(cursor.column) === context.maybeInsertedLineEnd && + line.substr(0, cursor.column) == context.maybeInsertedLineStart; + }; + + CstyleBehaviour.popAutoInsertedClosing = function() { + context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); + context.autoInsertedBrackets--; + }; + + CstyleBehaviour.clearMaybeInsertedClosing = function() { + if (context) { + context.maybeInsertedBrackets = 0; + context.maybeInsertedRow = -1; + } + }; + + + + oop.inherits(CstyleBehaviour, Behaviour); + + exports.CstyleBehaviour = CstyleBehaviour; + }); + + ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("../../lib/oop"); + var Range = acequire("../../range").Range; + var BaseFoldMode = acequire("./fold_mode").FoldMode; + + var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } + }; + oop.inherits(FoldMode, BaseFoldMode); + + (function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + + }).call(FoldMode.prototype); + + }); + + ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"], function(acequire, exports, module) { + "use strict"; + + var oop = acequire("../lib/oop"); + var TextMode = acequire("./text").Mode; + var HighlightRules = acequire("./json_highlight_rules").JsonHighlightRules; + var MatchingBraceOutdent = acequire("./matching_brace_outdent").MatchingBraceOutdent; + var CstyleBehaviour = acequire("./behaviour/cstyle").CstyleBehaviour; + var CStyleFoldMode = acequire("./folding/cstyle").FoldMode; + var WorkerClient = acequire("../worker/worker_client").WorkerClient; + + var Mode = function() { + this.HighlightRules = HighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); + }; + oop.inherits(Mode, TextMode); + + (function() { + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], __webpack_require__(490), "JsonWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + + this.$id = "ace/mode/json"; + }).call(Mode.prototype); + + exports.Mode = Mode; + }); + + +/***/ }, +/* 490 */ +/***/ function(module, exports) { + + module.exports.id = 'ace/mode/json_worker'; + module.exports.src = "\"no use strict\";(function(window){if(void 0===window.window||!window.document){window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:\"log\",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console,window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:\"error\",data:{message:message,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf(\"!\")){var chunks=moduleName.split(\"!\");return window.normalizeModule(parentId,chunks[0])+\"!\"+window.normalizeModule(parentId,chunks[1])}if(\".\"==moduleName.charAt(0)){var base=parentId.split(\"/\").slice(0,-1).join(\"/\");for(moduleName=(base?base+\"/\":\"\")+moduleName;-1!==moduleName.indexOf(\".\")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,\"\").replace(/\\/\\.\\//,\"/\").replace(/[^\\/]+\\/\\.\\.\\//,\"\")}}return moduleName},window.acequire=function(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error(\"worker.js acequire() accepts only (parentId, id) as arguments\");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;var chunks=id.split(\"/\");if(!window.acequire.tlns)return console.log(\"unable to load \"+id);chunks[0]=window.acequire.tlns[chunks[0]]||chunks[0];var path=chunks.join(\"/\")+\".js\";return window.acequire.id=id,importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,\"string\"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),\"function\"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=[\"require\",\"exports\",\"module\"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case\"require\":return req;case\"exports\":return module.exports;case\"module\":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},window.initBaseUrls=function initBaseUrls(topLevelNamespaces){acequire.tlns=topLevelNamespaces},window.initSender=function initSender(){var EventEmitter=window.acequire(\"ace/lib/event_emitter\").EventEmitter,oop=window.acequire(\"ace/lib/oop\"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:\"call\",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:\"event\",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.command){if(!main[msg.command])throw Error(\"Unknown command:\"+msg.command);main[msg.command].apply(main,msg.args)}else if(msg.init){initBaseUrls(msg.tlns),acequire(\"ace/lib/es5-shim\"),sender=window.sender=initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}else msg.event&&sender&&sender._signal(msg.event,msg.data)}}})(this),ace.define(\"ace/lib/oop\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define(\"ace/lib/event_emitter\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){\"object\"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?\"unshift\":\"push\"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define(\"ace/range\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return\"Range: [\"+this.start.row+\"/\"+this.start.column+\"] -> [\"+this.end.row+\"/\"+this.end.column+\"]\"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){\"object\"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){\"object\"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define(\"ace/anchor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"],function(acequire,exports){\"use strict\";var oop=acequire(\"./lib/oop\"),EventEmitter=acequire(\"./lib/event_emitter\").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){oop.implement(this,EventEmitter),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){var delta=e.data,range=delta.range;if(!(range.start.row==range.end.row&&range.start.row!=this.row||range.start.row>this.row||range.start.row==this.row&&range.start.column>this.column)){var row=this.row,column=this.column,start=range.start,end=range.end;\"insertText\"===delta.action?start.row===row&&column>=start.column?start.column===column&&this.$insertRight||(start.row===end.row?column+=end.column-start.column:(column-=start.column,row+=end.row-start.row)):start.row!==end.row&&row>start.row&&(row+=end.row-start.row):\"insertLines\"===delta.action?start.row===row&&0===column&&this.$insertRight||row>=start.row&&(row+=end.row-start.row):\"removeText\"===delta.action?start.row===row&&column>start.column?column=end.column>=column?start.column:Math.max(0,column-(end.column-start.column)):start.row!==end.row&&row>start.row?(end.row===row&&(column=Math.max(0,column-end.column)+start.column),row-=end.row-start.row):end.row===row&&(row-=end.row-start.row,column=Math.max(0,column-end.column)+start.column):\"removeLines\"==delta.action&&row>=start.row&&(row>=end.row?row-=end.row-start.row:(row=start.row,column=0)),this.setPosition(row,column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal(\"change\",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener(\"change\",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on(\"change\",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define(\"ace/document\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\",\"ace/range\",\"ace/anchor\"],function(acequire,exports){\"use strict\";var oop=acequire(\"./lib/oop\"),EventEmitter=acequire(\"./lib/event_emitter\").EventEmitter,Range=acequire(\"./range\").Range,Anchor=acequire(\"./anchor\").Anchor,Document=function(text){this.$lines=[],0===text.length?this.$lines=[\"\"]:Array.isArray(text)?this._insertLines(0,text):this.insert({row:0,column:0},text)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength();this.remove(new Range(0,0,len,this.getLine(len-1).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0===\"aaa\".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,\"\\n\").split(\"\\n\")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:\"\\n\",this._signal(\"changeNewLineMode\")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case\"windows\":return\"\\r\\n\";case\"unix\":return\"\\n\";default:return this.$autoNewLine||\"\\n\"}},this.$autoNewLine=\"\",this.$newLineMode=\"auto\",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal(\"changeNewLineMode\"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return\"\\r\\n\"==text||\"\\r\"==text||\"\\n\"==text},this.getLine=function(row){return this.$lines[row]||\"\"},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){if(range.start.row==range.end.row)return this.getLine(range.start.row).substring(range.start.column,range.end.column);var lines=this.getLines(range.start.row,range.end.row);lines[0]=(lines[0]||\"\").substring(range.start.column);var l=lines.length-1;return range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column)),lines.join(this.getNewLineCharacter())},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):0>position.row&&(position.row=0),position},this.insert=function(position,text){if(!text||0===text.length)return position;position=this.$clipPosition(position),1>=this.getLength()&&this.$detectNewLine(text);var lines=this.$split(text),firstLine=lines.splice(0,1)[0],lastLine=0==lines.length?null:lines.splice(lines.length-1,1)[0];return position=this.insertInLine(position,firstLine),null!==lastLine&&(position=this.insertNewLine(position),position=this._insertLines(position.row,lines),position=this.insertInLine(position,lastLine||\"\")),position},this.insertLines=function(row,lines){return row>=this.getLength()?this.insert({row:row,column:0},\"\\n\"+lines.join(\"\\n\")):this._insertLines(Math.max(row,0),lines)},this._insertLines=function(row,lines){if(0==lines.length)return{row:row,column:0};for(;lines.length>2e4;){var end=this._insertLines(row,lines.slice(0,2e4));lines=lines.slice(2e4),row=end.row}var args=[row,0];args.push.apply(args,lines),this.$lines.splice.apply(this.$lines,args);var range=new Range(row,0,row+lines.length,0),delta={action:\"insertLines\",range:range,lines:lines};return this._signal(\"change\",{data:delta}),range.end},this.insertNewLine=function(position){position=this.$clipPosition(position);var line=this.$lines[position.row]||\"\";this.$lines[position.row]=line.substring(0,position.column),this.$lines.splice(position.row+1,0,line.substring(position.column,line.length));var end={row:position.row+1,column:0},delta={action:\"insertText\",range:Range.fromPoints(position,end),text:this.getNewLineCharacter()};return this._signal(\"change\",{data:delta}),end},this.insertInLine=function(position,text){if(0==text.length)return position;var line=this.$lines[position.row]||\"\";this.$lines[position.row]=line.substring(0,position.column)+text+line.substring(position.column);var end={row:position.row,column:position.column+text.length},delta={action:\"insertText\",range:Range.fromPoints(position,end),text:text};return this._signal(\"change\",{data:delta}),end},this.remove=function(range){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),range.start=this.$clipPosition(range.start),range.end=this.$clipPosition(range.end),range.isEmpty())return range.start;var firstRow=range.start.row,lastRow=range.end.row;if(range.isMultiLine()){var firstFullRow=0==range.start.column?firstRow:firstRow+1,lastFullRow=lastRow-1;range.end.column>0&&this.removeInLine(lastRow,0,range.end.column),lastFullRow>=firstFullRow&&this._removeLines(firstFullRow,lastFullRow),firstFullRow!=firstRow&&(this.removeInLine(firstRow,range.start.column,this.getLine(firstRow).length),this.removeNewLine(range.start.row))}else this.removeInLine(firstRow,range.start.column,range.end.column);return range.start},this.removeInLine=function(row,startColumn,endColumn){if(startColumn!=endColumn){var range=new Range(row,startColumn,row,endColumn),line=this.getLine(row),removed=line.substring(startColumn,endColumn),newLine=line.substring(0,startColumn)+line.substring(endColumn,line.length);this.$lines.splice(row,1,newLine);var delta={action:\"removeText\",range:range,text:removed};return this._signal(\"change\",{data:delta}),range.start}},this.removeLines=function(firstRow,lastRow){return 0>firstRow||lastRow>=this.getLength()?this.remove(new Range(firstRow,0,lastRow+1,0)):this._removeLines(firstRow,lastRow)},this._removeLines=function(firstRow,lastRow){var range=new Range(firstRow,0,lastRow+1,0),removed=this.$lines.splice(firstRow,lastRow-firstRow+1),delta={action:\"removeLines\",range:range,nl:this.getNewLineCharacter(),lines:removed};return this._signal(\"change\",{data:delta}),removed},this.removeNewLine=function(row){var firstLine=this.getLine(row),secondLine=this.getLine(row+1),range=new Range(row,firstLine.length,row+1,0),line=firstLine+secondLine;this.$lines.splice(row,2,line);var delta={action:\"removeText\",range:range,text:this.getNewLineCharacter()};this._signal(\"change\",{data:delta})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0==text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;if(this.remove(range),text)var end=this.insert(range.start,text);else end=range.start;return end},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++){var delta=deltas[i],range=Range.fromPoints(delta.range.start,delta.range.end);\"insertLines\"==delta.action?this.insertLines(range.start.row,delta.lines):\"insertText\"==delta.action?this.insert(range.start,delta.text):\"removeLines\"==delta.action?this._removeLines(range.start.row,range.end.row-1):\"removeText\"==delta.action&&this.remove(range)}},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--){var delta=deltas[i],range=Range.fromPoints(delta.range.start,delta.range.end);\"insertLines\"==delta.action?this._removeLines(range.start.row,range.end.row-1):\"insertText\"==delta.action?this.remove(range):\"removeLines\"==delta.action?this._insertLines(range.start.row,delta.lines):\"removeText\"==delta.action&&this.insert(range.start,delta.text)}},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define(\"ace/lib/lang\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split(\"\").reverse().join(\"\")},exports.stringRepeat=function(string,count){for(var result=\"\";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,\"\")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,\"\")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&\"object\"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function(obj){if(\"object\"!=typeof obj||!obj)return obj;var cons=obj.constructor;if(cons===RegExp)return obj;var copy=cons();for(var key in obj)copy[key]=\"object\"==typeof obj[key]?exports.deepCopy(obj[key]):obj[key];return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,\"\\\\$1\")},exports.escapeHTML=function(str){return str.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/'/g,\"'\").replace(/=\"0\"&&\"9\">=ch;)string+=ch,next();if(\".\"===ch)for(string+=\".\";next()&&ch>=\"0\"&&\"9\">=ch;)string+=ch;if(\"e\"===ch||\"E\"===ch)for(string+=ch,next(),(\"-\"===ch||\"+\"===ch)&&(string+=ch,next());ch>=\"0\"&&\"9\">=ch;)string+=ch,next();return number=+string,isNaN(number)?(error(\"Bad number\"),void 0):number},string=function(){var hex,i,uffff,string=\"\";if('\"'===ch)for(;next();){if('\"'===ch)return next(),string;if(\"\\\\\"===ch)if(next(),\"u\"===ch){for(uffff=0,i=0;4>i&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if(\"string\"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error(\"Bad string\")},white=function(){for(;ch&&\" \">=ch;)next()},word=function(){switch(ch){case\"t\":return next(\"t\"),next(\"r\"),next(\"u\"),next(\"e\"),!0;case\"f\":return next(\"f\"),next(\"a\"),next(\"l\"),next(\"s\"),next(\"e\"),!1;case\"n\":return next(\"n\"),next(\"u\"),next(\"l\"),next(\"l\"),null}error(\"Unexpected '\"+ch+\"'\")},array=function(){var array=[];if(\"[\"===ch){if(next(\"[\"),white(),\"]\"===ch)return next(\"]\"),array;for(;ch;){if(array.push(value()),white(),\"]\"===ch)return next(\"]\"),array;next(\",\"),white()}}error(\"Bad array\")},object=function(){var key,object={};if(\"{\"===ch){if(next(\"{\"),white(),\"}\"===ch)return next(\"}\"),object;for(;ch;){if(key=string(),white(),next(\":\"),Object.hasOwnProperty.call(object,key)&&error('Duplicate key \"'+key+'\"'),object[key]=value(),white(),\"}\"===ch)return next(\"}\"),object;next(\",\"),white()}}error(\"Bad object\")};return value=function(){switch(white(),ch){case\"{\":return object();case\"[\":return array();case'\"':return string();case\"-\":return number();default:return ch>=\"0\"&&\"9\">=ch?number():word()}},function(source,reviver){var result;return text=source,at=0,ch=\" \",result=value(),white(),ch&&error(\"Syntax error\"),\"function\"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&\"object\"==typeof value)for(k in value)Object.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({\"\":result},\"\"):result}}),ace.define(\"ace/mode/json_worker\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/worker/mirror\",\"ace/mode/json/json_parse\"],function(acequire,exports){\"use strict\";var oop=acequire(\"../lib/oop\"),Mirror=acequire(\"../worker/mirror\").Mirror,parse=acequire(\"./json/json_parse\"),JsonWorker=exports.JsonWorker=function(sender){Mirror.call(this,sender),this.setTimeout(200)};oop.inherits(JsonWorker,Mirror),function(){this.onUpdate=function(){var value=this.doc.getValue(),errors=[];try{value&&parse(value)}catch(e){var pos=this.doc.indexToPosition(e.at-1);errors.push({row:pos.row,column:pos.column,text:e.message,type:\"error\"})}this.sender.emit(\"annotate\",errors)}}.call(JsonWorker.prototype)}),ace.define(\"ace/lib/es5-shim\",[\"require\",\"exports\",\"module\"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,\"sentinel\",{}),\"sentinel\"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if(\"function\"!=typeof target)throw new TypeError(\"Function.prototype.bind called on incompatible \"+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,\"__defineGetter__\"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,\"XXX\"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return\"[object Array]\"==_toString(obj)});var boxedString=Object(\"a\"),splitString=\"a\"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,thisp=arguments[1],i=-1,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError;\nfor(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,result=[],thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");if(!length&&1==arguments.length)throw new TypeError(\"reduce of empty array with no initial value\");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError(\"reduce of empty array with no initial value\")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");if(!length&&1==arguments.length)throw new TypeError(\"reduceRight of empty array with no initial value\");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError(\"reduceRight of empty array with no initial value\")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT=\"Object.getOwnPropertyDescriptor called on a non-object: \";Object.getOwnPropertyDescriptor=function(object,property){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if(\"object\"!=typeof prototype)throw new TypeError(\"typeof prototype[\"+typeof prototype+\"] != 'object'\");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom=\"undefined\"==typeof document||doesDefinePropertyWork(document.createElement(\"div\"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR=\"Property description must be an object: \",ERR_NON_OBJECT_TARGET=\"Object.defineProperty called on non-object: \",ERR_ACCESSORS_NOT_SUPPORTED=\"getters & setters can not be defined on this javascript engine\";Object.defineProperty=function(object,property,descriptor){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if(\"object\"!=typeof descriptor&&\"function\"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,\"value\"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,\"get\")&&defineGetter(object,property,descriptor.get),owns(descriptor,\"set\")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return\"function\"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name=\"\";owns(object,name);)name+=\"?\";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=[\"toString\",\"toLocaleString\",\"valueOf\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"constructor\"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(\"Object.keys called on a non-object\");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws=\"\t\\n\u000b\\f\\r   ᠎ â€â€‚         âŸã€€\\u2028\\u2029\";if(!String.prototype.trim||ws.trim()){ws=\"[\"+ws+\"]\";var trimBeginRegexp=RegExp(\"^\"+ws+ws+\"*\"),trimEndRegexp=RegExp(ws+ws+\"*$\");String.prototype.trim=function(){return(this+\"\").replace(trimBeginRegexp,\"\").replace(trimEndRegexp,\"\")}}var toObject=function(o){if(null==o)throw new TypeError(\"can't convert \"+o+\" to object\");return Object(o)}});"; + +/***/ }, +/* 491 */ +/***/ function(module, exports) { + + 'use strict'; + + /** + * Binds a ACE Editor widget + */ + angular.module('ui.ace', []) + .constant('uiAceConfig', {}) + .directive('uiAce', ['uiAceConfig', function (uiAceConfig) { + + if (angular.isUndefined(window.ace)) { + throw new Error('ui-ace need ace to work... (o rly?)'); + } + + /** + * Sets editor options such as the wrapping mode or the syntax checker. + * + * The supported options are: + * + *
      + *
    • showGutter
    • + *
    • useWrapMode
    • + *
    • onLoad
    • + *
    • theme
    • + *
    • mode
    • + *
    + * + * @param acee + * @param session ACE editor session + * @param {object} opts Options to be set + */ + var setOptions = function(acee, session, opts) { + + // sets the ace worker path, if running from concatenated + // or minified source + if (angular.isDefined(opts.workerPath)) { + var config = window.ace.require('ace/config'); + config.set('workerPath', opts.workerPath); + } + // ace requires loading + if (angular.isDefined(opts.require)) { + opts.require.forEach(function (n) { + window.ace.require(n); + }); + } + // Boolean options + if (angular.isDefined(opts.showGutter)) { + acee.renderer.setShowGutter(opts.showGutter); + } + if (angular.isDefined(opts.useWrapMode)) { + session.setUseWrapMode(opts.useWrapMode); + } + if (angular.isDefined(opts.showInvisibles)) { + acee.renderer.setShowInvisibles(opts.showInvisibles); + } + if (angular.isDefined(opts.showIndentGuides)) { + acee.renderer.setDisplayIndentGuides(opts.showIndentGuides); + } + if (angular.isDefined(opts.useSoftTabs)) { + session.setUseSoftTabs(opts.useSoftTabs); + } + if (angular.isDefined(opts.showPrintMargin)) { + acee.setShowPrintMargin(opts.showPrintMargin); + } + + // commands + if (angular.isDefined(opts.disableSearch) && opts.disableSearch) { + acee.commands.addCommands([ + { + name: 'unfind', + bindKey: { + win: 'Ctrl-F', + mac: 'Command-F' + }, + exec: function () { + return false; + }, + readOnly: true + } + ]); + } + + // Basic options + if (angular.isString(opts.theme)) { + acee.setTheme('ace/theme/' + opts.theme); + } + if (angular.isString(opts.mode)) { + session.setMode('ace/mode/' + opts.mode); + } + // Advanced options + if (angular.isDefined(opts.firstLineNumber)) { + if (angular.isNumber(opts.firstLineNumber)) { + session.setOption('firstLineNumber', opts.firstLineNumber); + } else if (angular.isFunction(opts.firstLineNumber)) { + session.setOption('firstLineNumber', opts.firstLineNumber()); + } + } + + // advanced options + var key, obj; + if (angular.isDefined(opts.advanced)) { + for (key in opts.advanced) { + // create a javascript object with the key and value + obj = { name: key, value: opts.advanced[key] }; + // try to assign the option to the ace editor + acee.setOption(obj.name, obj.value); + } + } + + // advanced options for the renderer + if (angular.isDefined(opts.rendererOptions)) { + for (key in opts.rendererOptions) { + // create a javascript object with the key and value + obj = { name: key, value: opts.rendererOptions[key] }; + // try to assign the option to the ace editor + acee.renderer.setOption(obj.name, obj.value); + } + } + + // onLoad callbacks + angular.forEach(opts.callbacks, function (cb) { + if (angular.isFunction(cb)) { + cb(acee); + } + }); + }; + + return { + restrict: 'EA', + require: '?ngModel', + link: function (scope, elm, attrs, ngModel) { + + /** + * Corresponds the uiAceConfig ACE configuration. + * @type object + */ + var options = uiAceConfig.ace || {}; + + /** + * uiAceConfig merged with user options via json in attribute or data binding + * @type object + */ + var opts = angular.extend({}, options, scope.$eval(attrs.uiAce)); + + /** + * ACE editor + * @type object + */ + var acee = window.ace.edit(elm[0]); + + /** + * ACE editor session. + * @type object + * @see [EditSession]{@link http://ace.c9.io/#nav=api&api=edit_session} + */ + var session = acee.getSession(); + + /** + * Reference to a change listener created by the listener factory. + * @function + * @see listenerFactory.onChange + */ + var onChangeListener; + + /** + * Reference to a blur listener created by the listener factory. + * @function + * @see listenerFactory.onBlur + */ + var onBlurListener; + + /** + * Calls a callback by checking its existing. The argument list + * is variable and thus this function is relying on the arguments + * object. + * @throws {Error} If the callback isn't a function + */ + var executeUserCallback = function () { + + /** + * The callback function grabbed from the array-like arguments + * object. The first argument should always be the callback. + * + * @see [arguments]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments} + * @type {*} + */ + var callback = arguments[0]; + + /** + * Arguments to be passed to the callback. These are taken + * from the array-like arguments object. The first argument + * is stripped because that should be the callback function. + * + * @see [arguments]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments} + * @type {Array} + */ + var args = Array.prototype.slice.call(arguments, 1); + + if (angular.isDefined(callback)) { + scope.$evalAsync(function () { + if (angular.isFunction(callback)) { + callback(args); + } else { + throw new Error('ui-ace use a function as callback.'); + } + }); + } + }; + + /** + * Listener factory. Until now only change listeners can be created. + * @type object + */ + var listenerFactory = { + /** + * Creates a change listener which propagates the change event + * and the editor session to the callback from the user option + * onChange. It might be exchanged during runtime, if this + * happens the old listener will be unbound. + * + * @param callback callback function defined in the user options + * @see onChangeListener + */ + onChange: function (callback) { + return function (e) { + var newValue = session.getValue(); + + if (ngModel && newValue !== ngModel.$viewValue && + // HACK make sure to only trigger the apply outside of the + // digest loop 'cause ACE is actually using this callback + // for any text transformation ! + !scope.$$phase && !scope.$root.$$phase) { + scope.$evalAsync(function () { + ngModel.$setViewValue(newValue); + }); + } + + executeUserCallback(callback, e, acee); + }; + }, + /** + * Creates a blur listener which propagates the editor session + * to the callback from the user option onBlur. It might be + * exchanged during runtime, if this happens the old listener + * will be unbound. + * + * @param callback callback function defined in the user options + * @see onBlurListener + */ + onBlur: function (callback) { + return function () { + executeUserCallback(callback, acee); + }; + } + }; + + attrs.$observe('readonly', function (value) { + acee.setReadOnly(!!value || value === ''); + }); + + // Value Blind + if (ngModel) { + ngModel.$formatters.push(function (value) { + if (angular.isUndefined(value) || value === null) { + return ''; + } + else if (angular.isObject(value) || angular.isArray(value)) { + throw new Error('ui-ace cannot use an object or an array as a model'); + } + return value; + }); + + ngModel.$render = function () { + session.setValue(ngModel.$viewValue); + }; + } + + // Listen for option updates + var updateOptions = function (current, previous) { + if (current === previous) return; + opts = angular.extend({}, options, scope.$eval(attrs.uiAce)); + + opts.callbacks = [ opts.onLoad ]; + if (opts.onLoad !== options.onLoad) { + // also call the global onLoad handler + opts.callbacks.unshift(options.onLoad); + } + + // EVENTS + + // unbind old change listener + session.removeListener('change', onChangeListener); + + // bind new change listener + onChangeListener = listenerFactory.onChange(opts.onChange); + session.on('change', onChangeListener); + + // unbind old blur listener + //session.removeListener('blur', onBlurListener); + acee.removeListener('blur', onBlurListener); + + // bind new blur listener + onBlurListener = listenerFactory.onBlur(opts.onBlur); + acee.on('blur', onBlurListener); + + setOptions(acee, session, opts); + }; + + scope.$watch(attrs.uiAce, updateOptions, /* deep watch */ true); + + // set the options here, even if we try to watch later, if this + // line is missing things go wrong (and the tests will also fail) + updateOptions(options); + + elm.on('$destroy', function () { + acee.session.$stopWorker(); + acee.destroy(); + }); + + scope.$watch(function() { + return [elm[0].offsetWidth, elm[0].offsetHeight]; + }, function() { + acee.resize(); + acee.renderer.updateFull(); + }, true); + + } + }; + }]); + + +/***/ }, +/* 492 */, +/* 493 */, +/* 494 */, +/* 495 */, +/* 496 */, +/* 497 */, +/* 498 */, +/* 499 */, +/* 500 */, +/* 501 */, +/* 502 */, +/* 503 */, +/* 504 */, +/* 505 */, +/* 506 */, +/* 507 */, +/* 508 */, +/* 509 */, +/* 510 */, +/* 511 */, +/* 512 */, +/* 513 */, +/* 514 */, +/* 515 */, +/* 516 */, +/* 517 */, +/* 518 */, +/* 519 */ +/***/ function(module, exports) { + + /*! elasticsearch - v8.0.1 - 2015-08-26 + * http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html + * Copyright (c) 2015 Elasticsearch BV; Licensed Apache-2.0 */ + + ;(function () { + /* prevent lodash from detecting external amd loaders */var define; + ;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o i; ++i) { + if (array.hasOwnProperty(i)) { + if (isValueSet) { + value = callback(value, array[i], i, array); + } + else { + value = array[i]; + isValueSet = true; + } + } + } + + return value; + }; + + // String.prototype.substr - negative index don't work in IE8 + if ('ab'.substr(-1) !== 'b') { + exports.substr = function (str, start, length) { + // did we get a negative start, calculate how much it is from the beginning of the string + if (start < 0) start = str.length + start; + + // call the original function + return str.substr(start, length); + }; + } else { + exports.substr = function (str, start, length) { + return str.substr(start, length); + }; + } + + // String.prototype.trim is supported in IE9 + exports.trim = function (str) { + if (str.trim) return str.trim(); + return str.replace(/^\s+|\s+$/g, ''); + }; + + // Function.prototype.bind is supported in IE9 + exports.bind = function () { + var args = Array.prototype.slice.call(arguments); + var fn = args.shift(); + if (fn.bind) return fn.bind.apply(fn, args); + var self = args.shift(); + return function () { + fn.apply(self, args.concat([Array.prototype.slice.call(arguments)])); + }; + }; + + // Object.create is supported in IE9 + function create(prototype, properties) { + var object; + if (prototype === null) { + object = { '__proto__' : null }; + } + else { + if (typeof prototype !== 'object') { + throw new TypeError( + 'typeof prototype[' + (typeof prototype) + '] != \'object\'' + ); + } + var Type = function () {}; + Type.prototype = prototype; + object = new Type(); + object.__proto__ = prototype; + } + if (typeof properties !== 'undefined' && Object.defineProperties) { + Object.defineProperties(object, properties); + } + return object; + } + exports.create = typeof Object.create === 'function' ? Object.create : create; + + // Object.keys and Object.getOwnPropertyNames is supported in IE9 however + // they do show a description and number property on Error objects + function notObject(object) { + return ((typeof object != "object" && typeof object != "function") || object === null); + } + + function keysShim(object) { + if (notObject(object)) { + throw new TypeError("Object.keys called on a non-object"); + } + + var result = []; + for (var name in object) { + if (hasOwnProperty.call(object, name)) { + result.push(name); + } + } + return result; + } + + // getOwnPropertyNames is almost the same as Object.keys one key feature + // is that it returns hidden properties, since that can't be implemented, + // this feature gets reduced so it just shows the length property on arrays + function propertyShim(object) { + if (notObject(object)) { + throw new TypeError("Object.getOwnPropertyNames called on a non-object"); + } + + var result = keysShim(object); + if (exports.isArray(object) && exports.indexOf(object, 'length') === -1) { + result.push('length'); + } + return result; + } + + var keys = typeof Object.keys === 'function' ? Object.keys : keysShim; + var getOwnPropertyNames = typeof Object.getOwnPropertyNames === 'function' ? + Object.getOwnPropertyNames : propertyShim; + + if (new Error().hasOwnProperty('description')) { + var ERROR_PROPERTY_FILTER = function (obj, array) { + if (toString.call(obj) === '[object Error]') { + array = exports.filter(array, function (name) { + return name !== 'description' && name !== 'number' && name !== 'message'; + }); + } + return array; + }; + + exports.keys = function (object) { + return ERROR_PROPERTY_FILTER(object, keys(object)); + }; + exports.getOwnPropertyNames = function (object) { + return ERROR_PROPERTY_FILTER(object, getOwnPropertyNames(object)); + }; + } else { + exports.keys = keys; + exports.getOwnPropertyNames = getOwnPropertyNames; + } + + // Object.getOwnPropertyDescriptor - supported in IE8 but only on dom elements + function valueObject(value, key) { + return { value: value[key] }; + } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + try { + Object.getOwnPropertyDescriptor({'a': 1}, 'a'); + exports.getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + } catch (e) { + // IE8 dom element issue - use a try catch and default to valueObject + exports.getOwnPropertyDescriptor = function (value, key) { + try { + return Object.getOwnPropertyDescriptor(value, key); + } catch (e) { + return valueObject(value, key); + } + }; + } + } else { + exports.getOwnPropertyDescriptor = valueObject; + } + + },{}],3:[function(require,module,exports){ + // Copyright Joyent, Inc. and other Node 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. + + // UTILITY + var util = require('util'); + var shims = require('_shims'); + var pSlice = Array.prototype.slice; + + // 1. The assert module provides functions that throw + // AssertionError's when particular conditions are not met. The + // assert module must conform to the following interface. + + var assert = module.exports = ok; + + // 2. The AssertionError is defined in assert. + // new assert.AssertionError({ message: message, + // actual: actual, + // expected: expected }) + + assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + this.message = options.message || getMessage(this); + }; + + // assert.AssertionError instanceof Error + util.inherits(assert.AssertionError, Error); + + function replacer(key, value) { + if (util.isUndefined(value)) { + return '' + value; + } + if (util.isNumber(value) && (isNaN(value) || !isFinite(value))) { + return value.toString(); + } + if (util.isFunction(value) || util.isRegExp(value)) { + return value.toString(); + } + return value; + } + + function truncate(s, n) { + if (util.isString(s)) { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } + } + + function getMessage(self) { + return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + + self.operator + ' ' + + truncate(JSON.stringify(self.expected, replacer), 128); + } + + // At present only the three keys mentioned above are used and + // understood by the spec. Implementations or sub modules can pass + // other keys to the AssertionError's constructor - they will be + // ignored. + + // 3. All of the following functions must throw an AssertionError + // when a corresponding condition is not met, with a message that + // may be undefined if not provided. All assertion methods provide + // both the actual and expected values to the assertion error for + // display purposes. + + function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); + } + + // EXTENSION! allows for well behaved errors defined elsewhere. + assert.fail = fail; + + // 4. Pure assertion tests whether a value is truthy, as determined + // by !!guard. + // assert.ok(guard, message_opt); + // This statement is equivalent to assert.equal(true, !!guard, + // message_opt);. To test strictly for the value true, use + // assert.strictEqual(true, guard, message_opt);. + + function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); + } + assert.ok = ok; + + // 5. The equality assertion tests shallow, coercive equality with + // ==. + // assert.equal(actual, expected, message_opt); + + assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); + }; + + // 6. The non-equality assertion tests for whether two objects are not equal + // with != assert.notEqual(actual, expected, message_opt); + + assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } + }; + + // 7. The equivalence assertion tests a deep equality relation. + // assert.deepEqual(actual, expected, message_opt); + + assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } + }; + + function _deepEqual(actual, expected) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (util.isBuffer(actual) && util.isBuffer(expected)) { + if (actual.length != expected.length) return false; + + for (var i = 0; i < actual.length; i++) { + if (actual[i] !== expected[i]) return false; + } + + return true; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!util.isObject(actual) && !util.isObject(expected)) { + return actual == expected; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected); + } + } + + function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; + } + + function objEquiv(a, b) { + if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b); + } + try { + var ka = shims.keys(a), + kb = shims.keys(b), + key, i; + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key])) return false; + } + return true; + } + + // 8. The non-equivalence assertion tests for any deep inequality. + // assert.notDeepEqual(actual, expected, message_opt); + + assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } + }; + + // 9. The strict equality assertion tests strict equality, as determined by ===. + // assert.strictEqual(actual, expected, message_opt); + + assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } + }; + + // 10. The strict non-equality assertion tests for strict inequality, as + // determined by !==. assert.notStrictEqual(actual, expected, message_opt); + + assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } + }; + + function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } else if (actual instanceof expected) { + return true; + } else if (expected.call({}, actual) === true) { + return true; + } + + return false; + } + + function _throws(shouldThrow, block, expected, message) { + var actual; + + if (util.isString(expected)) { + message = expected; + expected = null; + } + + try { + block(); + } catch (e) { + actual = e; + } + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + if (!shouldThrow && expectedException(actual, expected)) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } + } + + // 11. Expected to throw an error: + // assert.throws(block, Error_opt, message_opt); + + assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws.apply(this, [true].concat(pSlice.call(arguments))); + }; + + // EXTENSION! This is annoying to write outside this module. + assert.doesNotThrow = function(block, /*optional*/message) { + _throws.apply(this, [false].concat(pSlice.call(arguments))); + }; + + assert.ifError = function(err) { if (err) {throw err;}}; + },{"_shims":2,"util":8}],4:[function(require,module,exports){ + // Copyright Joyent, Inc. and other Node 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. + + var util = require('util'); + + function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; + } + module.exports = EventEmitter; + + // Backwards-compat with node 0.10.x + EventEmitter.EventEmitter = EventEmitter; + + EventEmitter.prototype._events = undefined; + EventEmitter.prototype._maxListeners = undefined; + + // By default EventEmitters will print a warning if more than 10 listeners are + // added to it. This is a useful default which helps finding memory leaks. + EventEmitter.defaultMaxListeners = 10; + + // Obviously not all Emitters should be limited to 10. This function allows + // that to be increased. Set to zero for unlimited. + EventEmitter.prototype.setMaxListeners = function(n) { + if (!util.isNumber(n) || n < 0) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; + }; + + EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (util.isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + throw TypeError('Uncaught, unspecified "error" event.'); + } + return false; + } + } + + handler = this._events[type]; + + if (util.isUndefined(handler)) + return false; + + if (util.isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + handler.apply(this, args); + } + } else if (util.isObject(handler)) { + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; + }; + + EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!util.isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + util.isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (util.isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (util.isObject(this._events[type]) && !this._events[type].warned) { + var m; + if (!util.isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + console.trace(); + } + } + + return this; + }; + + EventEmitter.prototype.on = EventEmitter.prototype.addListener; + + EventEmitter.prototype.once = function(type, listener) { + if (!util.isFunction(listener)) + throw TypeError('listener must be a function'); + + function g() { + this.removeListener(type, g); + listener.apply(this, arguments); + } + + g.listener = listener; + this.on(type, g); + + return this; + }; + + // emits a 'removeListener' event iff the listener was removed + EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!util.isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (util.isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (util.isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; + }; + + EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (util.isFunction(listeners)) { + this.removeListener(type, listeners); + } else { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; + }; + + EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (util.isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; + }; + + EventEmitter.listenerCount = function(emitter, type) { + var ret; + if (!emitter._events || !emitter._events[type]) + ret = 0; + else if (util.isFunction(emitter._events[type])) + ret = 1; + else + ret = emitter._events[type].length; + return ret; + }; + },{"util":8}],5:[function(require,module,exports){ + var process=require("__browserify_process");// Copyright Joyent, Inc. and other Node 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. + + var util = require('util'); + var shims = require('_shims'); + + // resolves . and .. elements in a path array with directory names there + // must be no slashes, empty elements, or device names (c:\) in the array + // (so also no leading and trailing slashes - it does not distinguish + // relative and absolute paths) + function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; + } + + // Split a filename into [root, dir, basename, ext], unix version + // 'root' is just a slash, or nothing. + var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); + }; + + // path.resolve([from ...], to) + // posix version + exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (!util.isString(path)) { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(shims.filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; + }; + + // path.normalize(path) + // posix version + exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = shims.substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(shims.filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; + }; + + // posix version + exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; + }; + + // posix version + exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(shims.filter(paths, function(p, index) { + if (!util.isString(p)) { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); + }; + + + // path.relative(from, to) + // posix version + exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); + }; + + exports.sep = '/'; + exports.delimiter = ':'; + + exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; + }; + + + exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; + }; + + + exports.extname = function(path) { + return splitPath(path)[3]; + }; + + },{"__browserify_process":13,"_shims":2,"util":8}],6:[function(require,module,exports){ + // Copyright Joyent, Inc. and other Node 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. + + // Query String Utilities + + var QueryString = exports; + var util = require('util'); + var shims = require('_shims'); + var Buffer = require('buffer').Buffer; + + // If obj.hasOwnProperty has been overridden, then calling + // obj.hasOwnProperty(prop) will break. + // See: https://github.com/joyent/node/issues/1707 + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + + function charCode(c) { + return c.charCodeAt(0); + } + + + // a safe fast alternative to decodeURIComponent + QueryString.unescapeBuffer = function(s, decodeSpaces) { + var out = new Buffer(s.length); + var state = 'CHAR'; // states: CHAR, HEX0, HEX1 + var n, m, hexchar; + + for (var inIndex = 0, outIndex = 0; inIndex <= s.length; inIndex++) { + var c = s.charCodeAt(inIndex); + switch (state) { + case 'CHAR': + switch (c) { + case charCode('%'): + n = 0; + m = 0; + state = 'HEX0'; + break; + case charCode('+'): + if (decodeSpaces) c = charCode(' '); + // pass thru + default: + out[outIndex++] = c; + break; + } + break; + + case 'HEX0': + state = 'HEX1'; + hexchar = c; + if (charCode('0') <= c && c <= charCode('9')) { + n = c - charCode('0'); + } else if (charCode('a') <= c && c <= charCode('f')) { + n = c - charCode('a') + 10; + } else if (charCode('A') <= c && c <= charCode('F')) { + n = c - charCode('A') + 10; + } else { + out[outIndex++] = charCode('%'); + out[outIndex++] = c; + state = 'CHAR'; + break; + } + break; + + case 'HEX1': + state = 'CHAR'; + if (charCode('0') <= c && c <= charCode('9')) { + m = c - charCode('0'); + } else if (charCode('a') <= c && c <= charCode('f')) { + m = c - charCode('a') + 10; + } else if (charCode('A') <= c && c <= charCode('F')) { + m = c - charCode('A') + 10; + } else { + out[outIndex++] = charCode('%'); + out[outIndex++] = hexchar; + out[outIndex++] = c; + break; + } + out[outIndex++] = 16 * n + m; + break; + } + } + + // TODO support returning arbitrary buffers. + + return out.slice(0, outIndex - 1); + }; + + + QueryString.unescape = function(s, decodeSpaces) { + return QueryString.unescapeBuffer(s, decodeSpaces).toString(); + }; + + + QueryString.escape = function(str) { + return encodeURIComponent(str); + }; + + var stringifyPrimitive = function(v) { + if (util.isString(v)) + return v; + if (util.isBoolean(v)) + return v ? 'true' : 'false'; + if (util.isNumber(v)) + return isFinite(v) ? v : ''; + return ''; + }; + + + QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (util.isNull(obj)) { + obj = undefined; + } + + if (util.isObject(obj)) { + return shims.map(shims.keys(obj), function(k) { + var ks = QueryString.escape(stringifyPrimitive(k)) + eq; + if (util.isArray(obj[k])) { + return shims.map(obj[k], function(v) { + return ks + QueryString.escape(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + QueryString.escape(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return QueryString.escape(stringifyPrimitive(name)) + eq + + QueryString.escape(stringifyPrimitive(obj)); + }; + + // Parse a key=val string. + QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (!util.isString(qs) || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && util.isNumber(options.maxKeys)) { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + try { + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + } catch (e) { + k = QueryString.unescape(kstr, true); + v = QueryString.unescape(vstr, true); + } + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (util.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; + }; + },{"_shims":2,"buffer":10,"util":8}],7:[function(require,module,exports){ + // Copyright Joyent, Inc. and other Node 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. + + var punycode = { encode : function (s) { return s } }; + var util = require('util'); + var shims = require('_shims'); + + exports.parse = urlParse; + exports.resolve = urlResolve; + exports.resolveObject = urlResolveObject; + exports.format = urlFormat; + + exports.Url = Url; + + function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; + } + + // Reference: RFC 3986, RFC 1808, RFC 2396 + + // define these here so at least they only have to be + // compiled once on the first module load. + var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + + function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; + } + + Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = shims.trim(rest); + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a puny coded representation of "domain". + // It only converts the part of the domain name that + // has non ASCII characters. I.e. it dosent matter if + // you call it with a domain that already is in ASCII. + var domainArray = this.hostname.split('.'); + var newOut = []; + for (var i = 0; i < domainArray.length; ++i) { + var s = domainArray[i]; + newOut.push(s.match(/[^A-Za-z0-9_-]/) ? + 'xn--' + punycode.encode(s) : s); + } + this.hostname = newOut.join('.'); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; + }; + + // format a parsed object into a url string + function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); + } + + Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + shims.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && shims.substr(protocol, -1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; + }; + + function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); + } + + Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); + }; + + function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); + } + + Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + shims.forEach(shims.keys(this), function(k) { + result[k] = this[k]; + }, this); + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + shims.forEach(shims.keys(relative), function(k) { + if (k !== 'protocol') + result[k] = relative[k]; + }); + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + shims.forEach(shims.keys(relative), function(k) { + result[k] = relative[k]; + }); + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especialy happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host) && (last === '.' || last === '..') || + last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last == '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (shims.substr(srcPath.join('/'), -1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especialy happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + }; + + Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; + }; + },{"_shims":2,"querystring":6,"util":8}],8:[function(require,module,exports){ + // Copyright Joyent, Inc. and other Node 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. + + var shims = require('_shims'); + + var formatRegExp = /%[sdj%]/g; + exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; + }; + + /** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ + /* legacy: obj, showHidden, depth, colors*/ + function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); + } + exports.inspect = inspect; + + + // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics + inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] + }; + + // Don't use 'blue' not visible on cmd.exe + inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' + }; + + + function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } + } + + + function stylizeNoColor(str, styleType) { + return str; + } + + + function arrayToHash(array) { + var hash = {}; + + shims.forEach(array, function(val, idx) { + hash[val] = true; + }); + + return hash; + } + + + function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = shims.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = shims.getOwnPropertyNames(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); + } + + + function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); + } + + + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + + + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + + shims.forEach(keys, function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; + } + + + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = shims.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (shims.indexOf(ctx.seen, desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; + } + + + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = shims.reduce(output, function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { + return shims.isArray(ar); + } + exports.isArray = isArray; + + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + exports.isBoolean = isBoolean; + + function isNull(arg) { + return arg === null; + } + exports.isNull = isNull; + + function isNullOrUndefined(arg) { + return arg == null; + } + exports.isNullOrUndefined = isNullOrUndefined; + + function isNumber(arg) { + return typeof arg === 'number'; + } + exports.isNumber = isNumber; + + function isString(arg) { + return typeof arg === 'string'; + } + exports.isString = isString; + + function isSymbol(arg) { + return typeof arg === 'symbol'; + } + exports.isSymbol = isSymbol; + + function isUndefined(arg) { + return arg === void 0; + } + exports.isUndefined = isUndefined; + + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + exports.isRegExp = isRegExp; + + function isObject(arg) { + return typeof arg === 'object' && arg; + } + exports.isObject = isObject; + + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + exports.isDate = isDate; + + function isError(e) { + return isObject(e) && objectToString(e) === '[object Error]'; + } + exports.isError = isError; + + function isFunction(arg) { + return typeof arg === 'function'; + } + exports.isFunction = isFunction; + + function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; + } + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.binarySlice === 'function' + ; + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); + } + + + function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); + } + + + var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + + // 26 Feb 16:19:34 + function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); + } + + + // log is just a thin wrapper to console.log that prepends a timestamp + exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); + }; + + + /** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ + exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = shims.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + + exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = shims.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; + }; + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + },{"_shims":2}],9:[function(require,module,exports){ + exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) { + var e, m, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + nBits = -7, + i = isBE ? 0 : (nBytes - 1), + d = isBE ? 1 : -1, + s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity); + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + + exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) { + var e, m, c, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), + i = isBE ? (nBytes - 1) : 0, + d = isBE ? -1 : 1, + s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); + + buffer[offset + i - d] |= s * 128; + }; + + },{}],10:[function(require,module,exports){ + var assert; + exports.Buffer = Buffer; + exports.SlowBuffer = Buffer; + Buffer.poolSize = 8192; + exports.INSPECT_MAX_BYTES = 50; + + function stringtrim(str) { + if (str.trim) return str.trim(); + return str.replace(/^\s+|\s+$/g, ''); + } + + function Buffer(subject, encoding, offset) { + if(!assert) assert= require('assert'); + if (!(this instanceof Buffer)) { + return new Buffer(subject, encoding, offset); + } + this.parent = this; + this.offset = 0; + + // Work-around: node's base64 implementation + // allows for non-padded strings while base64-js + // does not.. + if (encoding == "base64" && typeof subject == "string") { + subject = stringtrim(subject); + while (subject.length % 4 != 0) { + subject = subject + "="; + } + } + + var type; + + // Are we slicing? + if (typeof offset === 'number') { + this.length = coerce(encoding); + // slicing works, with limitations (no parent tracking/update) + // check https://github.com/toots/buffer-browserify/issues/19 + for (var i = 0; i < this.length; i++) { + this[i] = subject.get(i+offset); + } + } else { + // Find the length + switch (type = typeof subject) { + case 'number': + this.length = coerce(subject); + break; + + case 'string': + this.length = Buffer.byteLength(subject, encoding); + break; + + case 'object': // Assume object is an array + this.length = coerce(subject.length); + break; + + default: + throw new TypeError('First argument needs to be a number, ' + + 'array or string.'); + } + + // Treat array-ish objects as a byte array. + if (isArrayIsh(subject)) { + for (var i = 0; i < this.length; i++) { + if (subject instanceof Buffer) { + this[i] = subject.readUInt8(i); + } + else { + // Round-up subject[i] to a UInt8. + // e.g.: ((-432 % 256) + 256) % 256 = (-176 + 256) % 256 + // = 80 + this[i] = ((subject[i] % 256) + 256) % 256; + } + } + } else if (type == 'string') { + // We are a string + this.length = this.write(subject, 0, encoding); + } else if (type === 'number') { + for (var i = 0; i < this.length; i++) { + this[i] = 0; + } + } + } + } + + Buffer.prototype.get = function get(i) { + if (i < 0 || i >= this.length) throw new Error('oob'); + return this[i]; + }; + + Buffer.prototype.set = function set(i, v) { + if (i < 0 || i >= this.length) throw new Error('oob'); + return this[i] = v; + }; + + Buffer.byteLength = function (str, encoding) { + switch (encoding || "utf8") { + case 'hex': + return str.length / 2; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(str).length; + + case 'ascii': + case 'binary': + return str.length; + + case 'base64': + return base64ToBytes(str).length; + + default: + throw new Error('Unknown encoding'); + } + }; + + Buffer.prototype.utf8Write = function (string, offset, length) { + var bytes, pos; + return Buffer._charsWritten = blitBuffer(utf8ToBytes(string), this, offset, length); + }; + + Buffer.prototype.asciiWrite = function (string, offset, length) { + var bytes, pos; + return Buffer._charsWritten = blitBuffer(asciiToBytes(string), this, offset, length); + }; + + Buffer.prototype.binaryWrite = Buffer.prototype.asciiWrite; + + Buffer.prototype.base64Write = function (string, offset, length) { + var bytes, pos; + return Buffer._charsWritten = blitBuffer(base64ToBytes(string), this, offset, length); + }; + + Buffer.prototype.base64Slice = function (start, end) { + var bytes = Array.prototype.slice.apply(this, arguments) + return require("base64-js").fromByteArray(bytes); + }; + + Buffer.prototype.utf8Slice = function () { + var bytes = Array.prototype.slice.apply(this, arguments); + var res = ""; + var tmp = ""; + var i = 0; + while (i < bytes.length) { + if (bytes[i] <= 0x7F) { + res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i]); + tmp = ""; + } else + tmp += "%" + bytes[i].toString(16); + + i++; + } + + return res + decodeUtf8Char(tmp); + } + + Buffer.prototype.asciiSlice = function () { + var bytes = Array.prototype.slice.apply(this, arguments); + var ret = ""; + for (var i = 0; i < bytes.length; i++) + ret += String.fromCharCode(bytes[i]); + return ret; + } + + Buffer.prototype.binarySlice = Buffer.prototype.asciiSlice; + + Buffer.prototype.inspect = function() { + var out = [], + len = this.length; + for (var i = 0; i < len; i++) { + out[i] = toHex(this[i]); + if (i == exports.INSPECT_MAX_BYTES) { + out[i + 1] = '...'; + break; + } + } + return ''; + }; + + + Buffer.prototype.hexSlice = function(start, end) { + var len = this.length; + + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + + var out = ''; + for (var i = start; i < end; i++) { + out += toHex(this[i]); + } + return out; + }; + + + Buffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + start = +start || 0; + if (typeof end == 'undefined') end = this.length; + + // Fastpath empty strings + if (+end == start) { + return ''; + } + + switch (encoding) { + case 'hex': + return this.hexSlice(start, end); + + case 'utf8': + case 'utf-8': + return this.utf8Slice(start, end); + + case 'ascii': + return this.asciiSlice(start, end); + + case 'binary': + return this.binarySlice(start, end); + + case 'base64': + return this.base64Slice(start, end); + + case 'ucs2': + case 'ucs-2': + return this.ucs2Slice(start, end); + + default: + throw new Error('Unknown encoding'); + } + }; + + + Buffer.prototype.hexWrite = function(string, offset, length) { + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + + // must be an even number of digits + var strLen = string.length; + if (strLen % 2) { + throw new Error('Invalid hex string'); + } + if (length > strLen / 2) { + length = strLen / 2; + } + for (var i = 0; i < length; i++) { + var b = parseInt(string.substr(i * 2, 2), 16); + if (isNaN(b)) throw new Error('Invalid hex string'); + this[offset + i] = b; + } + Buffer._charsWritten = i * 2; + return i; + }; + + + Buffer.prototype.write = function(string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + encoding = String(encoding || 'utf8').toLowerCase(); + + switch (encoding) { + case 'hex': + return this.hexWrite(string, offset, length); + + case 'utf8': + case 'utf-8': + return this.utf8Write(string, offset, length); + + case 'ascii': + return this.asciiWrite(string, offset, length); + + case 'binary': + return this.binaryWrite(string, offset, length); + + case 'base64': + return this.base64Write(string, offset, length); + + case 'ucs2': + case 'ucs-2': + return this.ucs2Write(string, offset, length); + + default: + throw new Error('Unknown encoding'); + } + }; + + // slice(start, end) + function clamp(index, len, defaultValue) { + if (typeof index !== 'number') return defaultValue; + index = ~~index; // Coerce to integer. + if (index >= len) return len; + if (index >= 0) return index; + index += len; + if (index >= 0) return index; + return 0; + } + + Buffer.prototype.slice = function(start, end) { + var len = this.length; + start = clamp(start, len, 0); + end = clamp(end, len, len); + return new Buffer(this, end - start, +start); + }; + + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function(target, target_start, start, end) { + var source = this; + start || (start = 0); + if (end === undefined || isNaN(end)) { + end = this.length; + } + target_start || (target_start = 0); + + if (end < start) throw new Error('sourceEnd < sourceStart'); + + // Copy 0 bytes; we're done + if (end === start) return 0; + if (target.length == 0 || source.length == 0) return 0; + + if (target_start < 0 || target_start >= target.length) { + throw new Error('targetStart out of bounds'); + } + + if (start < 0 || start >= source.length) { + throw new Error('sourceStart out of bounds'); + } + + if (end < 0 || end > source.length) { + throw new Error('sourceEnd out of bounds'); + } + + // Are we oob? + if (end > this.length) { + end = this.length; + } + + if (target.length - target_start < end - start) { + end = target.length - target_start + start; + } + + var temp = []; + for (var i=start; i= this.length) { + throw new Error('start out of bounds'); + } + + if (end < 0 || end > this.length) { + throw new Error('end out of bounds'); + } + + for (var i = start; i < end; i++) { + this[i] = value; + } + } + + // Static methods + Buffer.isBuffer = function isBuffer(b) { + return b instanceof Buffer; + }; + + Buffer.concat = function (list, totalLength) { + if (!isArray(list)) { + throw new Error("Usage: Buffer.concat(list, [totalLength])\n \ + list should be an Array."); + } + + if (list.length === 0) { + return new Buffer(0); + } else if (list.length === 1) { + return list[0]; + } + + if (typeof totalLength !== 'number') { + totalLength = 0; + for (var i = 0; i < list.length; i++) { + var buf = list[i]; + totalLength += buf.length; + } + } + + var buffer = new Buffer(totalLength); + var pos = 0; + for (var i = 0; i < list.length; i++) { + var buf = list[i]; + buf.copy(buffer, pos); + pos += buf.length; + } + return buffer; + }; + + Buffer.isEncoding = function(encoding) { + switch ((encoding + '').toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + case 'raw': + return true; + + default: + return false; + } + }; + + // helpers + + function coerce(length) { + // Coerce length to a number (possibly NaN), round up + // in case it's fractional (e.g. 123.456) then do a + // double negate to coerce a NaN to 0. Easy, right? + length = ~~Math.ceil(+length); + return length < 0 ? 0 : length; + } + + function isArray(subject) { + return (Array.isArray || + function(subject){ + return {}.toString.apply(subject) == '[object Array]' + }) + (subject) + } + + function isArrayIsh(subject) { + return isArray(subject) || Buffer.isBuffer(subject) || + subject && typeof subject === 'object' && + typeof subject.length === 'number'; + } + + function toHex(n) { + if (n < 16) return '0' + n.toString(16); + return n.toString(16); + } + + function utf8ToBytes(str) { + var byteArray = []; + for (var i = 0; i < str.length; i++) + if (str.charCodeAt(i) <= 0x7F) + byteArray.push(str.charCodeAt(i)); + else { + var h = encodeURIComponent(str.charAt(i)).substr(1).split('%'); + for (var j = 0; j < h.length; j++) + byteArray.push(parseInt(h[j], 16)); + } + + return byteArray; + } + + function asciiToBytes(str) { + var byteArray = [] + for (var i = 0; i < str.length; i++ ) + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push( str.charCodeAt(i) & 0xFF ); + + return byteArray; + } + + function base64ToBytes(str) { + return require("base64-js").toByteArray(str); + } + + function blitBuffer(src, dst, offset, length) { + var pos, i = 0; + while (i < length) { + if ((i+offset >= dst.length) || (i >= src.length)) + break; + + dst[i + offset] = src[i]; + i++; + } + return i; + } + + function decodeUtf8Char(str) { + try { + return decodeURIComponent(str); + } catch (err) { + return String.fromCharCode(0xFFFD); // UTF 8 invalid char + } + } + + // read/write bit-twiddling + + Buffer.prototype.readUInt8 = function(offset, noAssert) { + var buffer = this; + + if (!noAssert) { + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return; + + return buffer[offset]; + }; + + function readUInt16(buffer, offset, isBigEndian, noAssert) { + var val = 0; + + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return 0; + + if (isBigEndian) { + val = buffer[offset] << 8; + if (offset + 1 < buffer.length) { + val |= buffer[offset + 1]; + } + } else { + val = buffer[offset]; + if (offset + 1 < buffer.length) { + val |= buffer[offset + 1] << 8; + } + } + + return val; + } + + Buffer.prototype.readUInt16LE = function(offset, noAssert) { + return readUInt16(this, offset, false, noAssert); + }; + + Buffer.prototype.readUInt16BE = function(offset, noAssert) { + return readUInt16(this, offset, true, noAssert); + }; + + function readUInt32(buffer, offset, isBigEndian, noAssert) { + var val = 0; + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return 0; + + if (isBigEndian) { + if (offset + 1 < buffer.length) + val = buffer[offset + 1] << 16; + if (offset + 2 < buffer.length) + val |= buffer[offset + 2] << 8; + if (offset + 3 < buffer.length) + val |= buffer[offset + 3]; + val = val + (buffer[offset] << 24 >>> 0); + } else { + if (offset + 2 < buffer.length) + val = buffer[offset + 2] << 16; + if (offset + 1 < buffer.length) + val |= buffer[offset + 1] << 8; + val |= buffer[offset]; + if (offset + 3 < buffer.length) + val = val + (buffer[offset + 3] << 24 >>> 0); + } + + return val; + } + + Buffer.prototype.readUInt32LE = function(offset, noAssert) { + return readUInt32(this, offset, false, noAssert); + }; + + Buffer.prototype.readUInt32BE = function(offset, noAssert) { + return readUInt32(this, offset, true, noAssert); + }; + + + /* + * Signed integer types, yay team! A reminder on how two's complement actually + * works. The first bit is the signed bit, i.e. tells us whether or not the + * number should be positive or negative. If the two's complement value is + * positive, then we're done, as it's equivalent to the unsigned representation. + * + * Now if the number is positive, you're pretty much done, you can just leverage + * the unsigned translations and return those. Unfortunately, negative numbers + * aren't quite that straightforward. + * + * At first glance, one might be inclined to use the traditional formula to + * translate binary numbers between the positive and negative values in two's + * complement. (Though it doesn't quite work for the most negative value) + * Mainly: + * - invert all the bits + * - add one to the result + * + * Of course, this doesn't quite work in Javascript. Take for example the value + * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of + * course, Javascript will do the following: + * + * > ~0xff80 + * -65409 + * + * Whoh there, Javascript, that's not quite right. But wait, according to + * Javascript that's perfectly correct. When Javascript ends up seeing the + * constant 0xff80, it has no notion that it is actually a signed number. It + * assumes that we've input the unsigned value 0xff80. Thus, when it does the + * binary negation, it casts it into a signed value, (positive 0xff80). Then + * when you perform binary negation on that, it turns it into a negative number. + * + * Instead, we're going to have to use the following general formula, that works + * in a rather Javascript friendly way. I'm glad we don't support this kind of + * weird numbering scheme in the kernel. + * + * (BIT-MAX - (unsigned)val + 1) * -1 + * + * The astute observer, may think that this doesn't make sense for 8-bit numbers + * (really it isn't necessary for them). However, when you get 16-bit numbers, + * you do. Let's go back to our prior example and see how this will look: + * + * (0xffff - 0xff80 + 1) * -1 + * (0x007f + 1) * -1 + * (0x0080) * -1 + */ + Buffer.prototype.readInt8 = function(offset, noAssert) { + var buffer = this; + var neg; + + if (!noAssert) { + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return; + + neg = buffer[offset] & 0x80; + if (!neg) { + return (buffer[offset]); + } + + return ((0xff - buffer[offset] + 1) * -1); + }; + + function readInt16(buffer, offset, isBigEndian, noAssert) { + var neg, val; + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'Trying to read beyond buffer length'); + } + + val = readUInt16(buffer, offset, isBigEndian, noAssert); + neg = val & 0x8000; + if (!neg) { + return val; + } + + return (0xffff - val + 1) * -1; + } + + Buffer.prototype.readInt16LE = function(offset, noAssert) { + return readInt16(this, offset, false, noAssert); + }; + + Buffer.prototype.readInt16BE = function(offset, noAssert) { + return readInt16(this, offset, true, noAssert); + }; + + function readInt32(buffer, offset, isBigEndian, noAssert) { + var neg, val; + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to read beyond buffer length'); + } + + val = readUInt32(buffer, offset, isBigEndian, noAssert); + neg = val & 0x80000000; + if (!neg) { + return (val); + } + + return (0xffffffff - val + 1) * -1; + } + + Buffer.prototype.readInt32LE = function(offset, noAssert) { + return readInt32(this, offset, false, noAssert); + }; + + Buffer.prototype.readInt32BE = function(offset, noAssert) { + return readInt32(this, offset, true, noAssert); + }; + + function readFloat(buffer, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to read beyond buffer length'); + } + + return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, + 23, 4); + } + + Buffer.prototype.readFloatLE = function(offset, noAssert) { + return readFloat(this, offset, false, noAssert); + }; + + Buffer.prototype.readFloatBE = function(offset, noAssert) { + return readFloat(this, offset, true, noAssert); + }; + + function readDouble(buffer, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset + 7 < buffer.length, + 'Trying to read beyond buffer length'); + } + + return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, + 52, 8); + } + + Buffer.prototype.readDoubleLE = function(offset, noAssert) { + return readDouble(this, offset, false, noAssert); + }; + + Buffer.prototype.readDoubleBE = function(offset, noAssert) { + return readDouble(this, offset, true, noAssert); + }; + + + /* + * We have to make sure that the value is a valid integer. This means that it is + * non-negative. It has no fractional component and that it does not exceed the + * maximum allowed value. + * + * value The number to check for validity + * + * max The maximum value + */ + function verifuint(value, max) { + assert.ok(typeof (value) == 'number', + 'cannot write a non-number as a number'); + + assert.ok(value >= 0, + 'specified a negative value for writing an unsigned value'); + + assert.ok(value <= max, 'value is larger than maximum value for type'); + + assert.ok(Math.floor(value) === value, 'value has a fractional component'); + } + + Buffer.prototype.writeUInt8 = function(value, offset, noAssert) { + var buffer = this; + + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'trying to write beyond buffer length'); + + verifuint(value, 0xff); + } + + if (offset < buffer.length) { + buffer[offset] = value; + } + }; + + function writeUInt16(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'trying to write beyond buffer length'); + + verifuint(value, 0xffff); + } + + for (var i = 0; i < Math.min(buffer.length - offset, 2); i++) { + buffer[offset + i] = + (value & (0xff << (8 * (isBigEndian ? 1 - i : i)))) >>> + (isBigEndian ? 1 - i : i) * 8; + } + + } + + Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) { + writeUInt16(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) { + writeUInt16(this, value, offset, true, noAssert); + }; + + function writeUInt32(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'trying to write beyond buffer length'); + + verifuint(value, 0xffffffff); + } + + for (var i = 0; i < Math.min(buffer.length - offset, 4); i++) { + buffer[offset + i] = + (value >>> (isBigEndian ? 3 - i : i) * 8) & 0xff; + } + } + + Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) { + writeUInt32(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) { + writeUInt32(this, value, offset, true, noAssert); + }; + + + /* + * We now move onto our friends in the signed number category. Unlike unsigned + * numbers, we're going to have to worry a bit more about how we put values into + * arrays. Since we are only worrying about signed 32-bit values, we're in + * slightly better shape. Unfortunately, we really can't do our favorite binary + * & in this system. It really seems to do the wrong thing. For example: + * + * > -32 & 0xff + * 224 + * + * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of + * this aren't treated as a signed number. Ultimately a bad thing. + * + * What we're going to want to do is basically create the unsigned equivalent of + * our representation and pass that off to the wuint* functions. To do that + * we're going to do the following: + * + * - if the value is positive + * we can pass it directly off to the equivalent wuint + * - if the value is negative + * we do the following computation: + * mb + val + 1, where + * mb is the maximum unsigned value in that byte size + * val is the Javascript negative integer + * + * + * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If + * you do out the computations: + * + * 0xffff - 128 + 1 + * 0xffff - 127 + * 0xff80 + * + * You can then encode this value as the signed version. This is really rather + * hacky, but it should work and get the job done which is our goal here. + */ + + /* + * A series of checks to make sure we actually have a signed 32-bit number + */ + function verifsint(value, max, min) { + assert.ok(typeof (value) == 'number', + 'cannot write a non-number as a number'); + + assert.ok(value <= max, 'value larger than maximum allowed value'); + + assert.ok(value >= min, 'value smaller than minimum allowed value'); + + assert.ok(Math.floor(value) === value, 'value has a fractional component'); + } + + function verifIEEE754(value, max, min) { + assert.ok(typeof (value) == 'number', + 'cannot write a non-number as a number'); + + assert.ok(value <= max, 'value larger than maximum allowed value'); + + assert.ok(value >= min, 'value smaller than minimum allowed value'); + } + + Buffer.prototype.writeInt8 = function(value, offset, noAssert) { + var buffer = this; + + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'Trying to write beyond buffer length'); + + verifsint(value, 0x7f, -0x80); + } + + if (value >= 0) { + buffer.writeUInt8(value, offset, noAssert); + } else { + buffer.writeUInt8(0xff + value + 1, offset, noAssert); + } + }; + + function writeInt16(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'Trying to write beyond buffer length'); + + verifsint(value, 0x7fff, -0x8000); + } + + if (value >= 0) { + writeUInt16(buffer, value, offset, isBigEndian, noAssert); + } else { + writeUInt16(buffer, 0xffff + value + 1, offset, isBigEndian, noAssert); + } + } + + Buffer.prototype.writeInt16LE = function(value, offset, noAssert) { + writeInt16(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { + writeInt16(this, value, offset, true, noAssert); + }; + + function writeInt32(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to write beyond buffer length'); + + verifsint(value, 0x7fffffff, -0x80000000); + } + + if (value >= 0) { + writeUInt32(buffer, value, offset, isBigEndian, noAssert); + } else { + writeUInt32(buffer, 0xffffffff + value + 1, offset, isBigEndian, noAssert); + } + } + + Buffer.prototype.writeInt32LE = function(value, offset, noAssert) { + writeInt32(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { + writeInt32(this, value, offset, true, noAssert); + }; + + function writeFloat(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to write beyond buffer length'); + + verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); + } + + require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, + 23, 4); + } + + Buffer.prototype.writeFloatLE = function(value, offset, noAssert) { + writeFloat(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeFloatBE = function(value, offset, noAssert) { + writeFloat(this, value, offset, true, noAssert); + }; + + function writeDouble(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 7 < buffer.length, + 'Trying to write beyond buffer length'); + + verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); + } + + require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, + 52, 8); + } + + Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) { + writeDouble(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) { + writeDouble(this, value, offset, true, noAssert); + }; + + },{"./buffer_ieee754":9,"assert":3,"base64-js":11}],11:[function(require,module,exports){ + var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + ;(function (exports) { + 'use strict'; + + var Arr = (typeof Uint8Array !== 'undefined') + ? Uint8Array + : Array + + var PLUS = '+'.charCodeAt(0) + var SLASH = '/'.charCodeAt(0) + var NUMBER = '0'.charCodeAt(0) + var LOWER = 'a'.charCodeAt(0) + var UPPER = 'A'.charCodeAt(0) + var PLUS_URL_SAFE = '-'.charCodeAt(0) + var SLASH_URL_SAFE = '_'.charCodeAt(0) + + function decode (elt) { + var code = elt.charCodeAt(0) + if (code === PLUS || + code === PLUS_URL_SAFE) + return 62 // '+' + if (code === SLASH || + code === SLASH_URL_SAFE) + return 63 // '/' + if (code < NUMBER) + return -1 //no match + if (code < NUMBER + 10) + return code - NUMBER + 26 + 26 + if (code < UPPER + 26) + return code - UPPER + if (code < LOWER + 26) + return code - LOWER + 26 + } + + function b64ToByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + + if (b64.length % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + exports.toByteArray = b64ToByteArray + exports.fromByteArray = uint8ToBase64 + }(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) + + },{}],12:[function(require,module,exports){ + require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 1, + nBits = -7, + i = isBE ? 0 : (nBytes - 1), + d = isBE ? 1 : -1, + s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity); + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + + exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) { + var e, m, c, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), + i = isBE ? (nBytes - 1) : 0, + d = isBE ? -1 : 1, + s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); + + buffer[offset + i - d] |= s * 128; + }; + + },{}],"q9TxCC":[function(require,module,exports){ + var assert; + exports.Buffer = Buffer; + exports.SlowBuffer = Buffer; + Buffer.poolSize = 8192; + exports.INSPECT_MAX_BYTES = 50; + + function stringtrim(str) { + if (str.trim) return str.trim(); + return str.replace(/^\s+|\s+$/g, ''); + } + + function Buffer(subject, encoding, offset) { + if(!assert) assert= require('assert'); + if (!(this instanceof Buffer)) { + return new Buffer(subject, encoding, offset); + } + this.parent = this; + this.offset = 0; + + // Work-around: node's base64 implementation + // allows for non-padded strings while base64-js + // does not.. + if (encoding == "base64" && typeof subject == "string") { + subject = stringtrim(subject); + while (subject.length % 4 != 0) { + subject = subject + "="; + } + } + + var type; + + // Are we slicing? + if (typeof offset === 'number') { + this.length = coerce(encoding); + // slicing works, with limitations (no parent tracking/update) + // check https://github.com/toots/buffer-browserify/issues/19 + for (var i = 0; i < this.length; i++) { + this[i] = subject.get(i+offset); + } + } else { + // Find the length + switch (type = typeof subject) { + case 'number': + this.length = coerce(subject); + break; + + case 'string': + this.length = Buffer.byteLength(subject, encoding); + break; + + case 'object': // Assume object is an array + this.length = coerce(subject.length); + break; + + default: + throw new Error('First argument needs to be a number, ' + + 'array or string.'); + } + + // Treat array-ish objects as a byte array. + if (isArrayIsh(subject)) { + for (var i = 0; i < this.length; i++) { + if (subject instanceof Buffer) { + this[i] = subject.readUInt8(i); + } + else { + this[i] = subject[i]; + } + } + } else if (type == 'string') { + // We are a string + this.length = this.write(subject, 0, encoding); + } else if (type === 'number') { + for (var i = 0; i < this.length; i++) { + this[i] = 0; + } + } + } + } + + Buffer.prototype.get = function get(i) { + if (i < 0 || i >= this.length) throw new Error('oob'); + return this[i]; + }; + + Buffer.prototype.set = function set(i, v) { + if (i < 0 || i >= this.length) throw new Error('oob'); + return this[i] = v; + }; + + Buffer.byteLength = function (str, encoding) { + switch (encoding || "utf8") { + case 'hex': + return str.length / 2; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(str).length; + + case 'ascii': + case 'binary': + return str.length; + + case 'base64': + return base64ToBytes(str).length; + + default: + throw new Error('Unknown encoding'); + } + }; + + Buffer.prototype.utf8Write = function (string, offset, length) { + var bytes, pos; + return Buffer._charsWritten = blitBuffer(utf8ToBytes(string), this, offset, length); + }; + + Buffer.prototype.asciiWrite = function (string, offset, length) { + var bytes, pos; + return Buffer._charsWritten = blitBuffer(asciiToBytes(string), this, offset, length); + }; + + Buffer.prototype.binaryWrite = Buffer.prototype.asciiWrite; + + Buffer.prototype.base64Write = function (string, offset, length) { + var bytes, pos; + return Buffer._charsWritten = blitBuffer(base64ToBytes(string), this, offset, length); + }; + + Buffer.prototype.base64Slice = function (start, end) { + var bytes = Array.prototype.slice.apply(this, arguments) + return require("base64-js").fromByteArray(bytes); + }; + + Buffer.prototype.utf8Slice = function () { + var bytes = Array.prototype.slice.apply(this, arguments); + var res = ""; + var tmp = ""; + var i = 0; + while (i < bytes.length) { + if (bytes[i] <= 0x7F) { + res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i]); + tmp = ""; + } else + tmp += "%" + bytes[i].toString(16); + + i++; + } + + return res + decodeUtf8Char(tmp); + } + + Buffer.prototype.asciiSlice = function () { + var bytes = Array.prototype.slice.apply(this, arguments); + var ret = ""; + for (var i = 0; i < bytes.length; i++) + ret += String.fromCharCode(bytes[i]); + return ret; + } + + Buffer.prototype.binarySlice = Buffer.prototype.asciiSlice; + + Buffer.prototype.inspect = function() { + var out = [], + len = this.length; + for (var i = 0; i < len; i++) { + out[i] = toHex(this[i]); + if (i == exports.INSPECT_MAX_BYTES) { + out[i + 1] = '...'; + break; + } + } + return ''; + }; + + + Buffer.prototype.hexSlice = function(start, end) { + var len = this.length; + + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + + var out = ''; + for (var i = start; i < end; i++) { + out += toHex(this[i]); + } + return out; + }; + + + Buffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + start = +start || 0; + if (typeof end == 'undefined') end = this.length; + + // Fastpath empty strings + if (+end == start) { + return ''; + } + + switch (encoding) { + case 'hex': + return this.hexSlice(start, end); + + case 'utf8': + case 'utf-8': + return this.utf8Slice(start, end); + + case 'ascii': + return this.asciiSlice(start, end); + + case 'binary': + return this.binarySlice(start, end); + + case 'base64': + return this.base64Slice(start, end); + + case 'ucs2': + case 'ucs-2': + return this.ucs2Slice(start, end); + + default: + throw new Error('Unknown encoding'); + } + }; + + + Buffer.prototype.hexWrite = function(string, offset, length) { + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + + // must be an even number of digits + var strLen = string.length; + if (strLen % 2) { + throw new Error('Invalid hex string'); + } + if (length > strLen / 2) { + length = strLen / 2; + } + for (var i = 0; i < length; i++) { + var byte = parseInt(string.substr(i * 2, 2), 16); + if (isNaN(byte)) throw new Error('Invalid hex string'); + this[offset + i] = byte; + } + Buffer._charsWritten = i * 2; + return i; + }; + + + Buffer.prototype.write = function(string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + encoding = String(encoding || 'utf8').toLowerCase(); + + switch (encoding) { + case 'hex': + return this.hexWrite(string, offset, length); + + case 'utf8': + case 'utf-8': + return this.utf8Write(string, offset, length); + + case 'ascii': + return this.asciiWrite(string, offset, length); + + case 'binary': + return this.binaryWrite(string, offset, length); + + case 'base64': + return this.base64Write(string, offset, length); + + case 'ucs2': + case 'ucs-2': + return this.ucs2Write(string, offset, length); + + default: + throw new Error('Unknown encoding'); + } + }; + + // slice(start, end) + function clamp(index, len, defaultValue) { + if (typeof index !== 'number') return defaultValue; + index = ~~index; // Coerce to integer. + if (index >= len) return len; + if (index >= 0) return index; + index += len; + if (index >= 0) return index; + return 0; + } + + Buffer.prototype.slice = function(start, end) { + var len = this.length; + start = clamp(start, len, 0); + end = clamp(end, len, len); + return new Buffer(this, end - start, +start); + }; + + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function(target, target_start, start, end) { + var source = this; + start || (start = 0); + if (end === undefined || isNaN(end)) { + end = this.length; + } + target_start || (target_start = 0); + + if (end < start) throw new Error('sourceEnd < sourceStart'); + + // Copy 0 bytes; we're done + if (end === start) return 0; + if (target.length == 0 || source.length == 0) return 0; + + if (target_start < 0 || target_start >= target.length) { + throw new Error('targetStart out of bounds'); + } + + if (start < 0 || start >= source.length) { + throw new Error('sourceStart out of bounds'); + } + + if (end < 0 || end > source.length) { + throw new Error('sourceEnd out of bounds'); + } + + // Are we oob? + if (end > this.length) { + end = this.length; + } + + if (target.length - target_start < end - start) { + end = target.length - target_start + start; + } + + var temp = []; + for (var i=start; i= this.length) { + throw new Error('start out of bounds'); + } + + if (end < 0 || end > this.length) { + throw new Error('end out of bounds'); + } + + for (var i = start; i < end; i++) { + this[i] = value; + } + } + + // Static methods + Buffer.isBuffer = function isBuffer(b) { + return b instanceof Buffer || b instanceof Buffer; + }; + + Buffer.concat = function (list, totalLength) { + if (!isArray(list)) { + throw new Error("Usage: Buffer.concat(list, [totalLength])\n \ + list should be an Array."); + } + + if (list.length === 0) { + return new Buffer(0); + } else if (list.length === 1) { + return list[0]; + } + + if (typeof totalLength !== 'number') { + totalLength = 0; + for (var i = 0; i < list.length; i++) { + var buf = list[i]; + totalLength += buf.length; + } + } + + var buffer = new Buffer(totalLength); + var pos = 0; + for (var i = 0; i < list.length; i++) { + var buf = list[i]; + buf.copy(buffer, pos); + pos += buf.length; + } + return buffer; + }; + + Buffer.isEncoding = function(encoding) { + switch ((encoding + '').toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + case 'raw': + return true; + + default: + return false; + } + }; + + // helpers + + function coerce(length) { + // Coerce length to a number (possibly NaN), round up + // in case it's fractional (e.g. 123.456) then do a + // double negate to coerce a NaN to 0. Easy, right? + length = ~~Math.ceil(+length); + return length < 0 ? 0 : length; + } + + function isArray(subject) { + return (Array.isArray || + function(subject){ + return {}.toString.apply(subject) == '[object Array]' + }) + (subject) + } + + function isArrayIsh(subject) { + return isArray(subject) || Buffer.isBuffer(subject) || + subject && typeof subject === 'object' && + typeof subject.length === 'number'; + } + + function toHex(n) { + if (n < 16) return '0' + n.toString(16); + return n.toString(16); + } + + function utf8ToBytes(str) { + var byteArray = []; + for (var i = 0; i < str.length; i++) + if (str.charCodeAt(i) <= 0x7F) + byteArray.push(str.charCodeAt(i)); + else { + var h = encodeURIComponent(str.charAt(i)).substr(1).split('%'); + for (var j = 0; j < h.length; j++) + byteArray.push(parseInt(h[j], 16)); + } + + return byteArray; + } + + function asciiToBytes(str) { + var byteArray = [] + for (var i = 0; i < str.length; i++ ) + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push( str.charCodeAt(i) & 0xFF ); + + return byteArray; + } + + function base64ToBytes(str) { + return require("base64-js").toByteArray(str); + } + + function blitBuffer(src, dst, offset, length) { + var pos, i = 0; + while (i < length) { + if ((i+offset >= dst.length) || (i >= src.length)) + break; + + dst[i + offset] = src[i]; + i++; + } + return i; + } + + function decodeUtf8Char(str) { + try { + return decodeURIComponent(str); + } catch (err) { + return String.fromCharCode(0xFFFD); // UTF 8 invalid char + } + } + + // read/write bit-twiddling + + Buffer.prototype.readUInt8 = function(offset, noAssert) { + var buffer = this; + + if (!noAssert) { + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return; + + return buffer[offset]; + }; + + function readUInt16(buffer, offset, isBigEndian, noAssert) { + var val = 0; + + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return 0; + + if (isBigEndian) { + val = buffer[offset] << 8; + if (offset + 1 < buffer.length) { + val |= buffer[offset + 1]; + } + } else { + val = buffer[offset]; + if (offset + 1 < buffer.length) { + val |= buffer[offset + 1] << 8; + } + } + + return val; + } + + Buffer.prototype.readUInt16LE = function(offset, noAssert) { + return readUInt16(this, offset, false, noAssert); + }; + + Buffer.prototype.readUInt16BE = function(offset, noAssert) { + return readUInt16(this, offset, true, noAssert); + }; + + function readUInt32(buffer, offset, isBigEndian, noAssert) { + var val = 0; + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return 0; + + if (isBigEndian) { + if (offset + 1 < buffer.length) + val = buffer[offset + 1] << 16; + if (offset + 2 < buffer.length) + val |= buffer[offset + 2] << 8; + if (offset + 3 < buffer.length) + val |= buffer[offset + 3]; + val = val + (buffer[offset] << 24 >>> 0); + } else { + if (offset + 2 < buffer.length) + val = buffer[offset + 2] << 16; + if (offset + 1 < buffer.length) + val |= buffer[offset + 1] << 8; + val |= buffer[offset]; + if (offset + 3 < buffer.length) + val = val + (buffer[offset + 3] << 24 >>> 0); + } + + return val; + } + + Buffer.prototype.readUInt32LE = function(offset, noAssert) { + return readUInt32(this, offset, false, noAssert); + }; + + Buffer.prototype.readUInt32BE = function(offset, noAssert) { + return readUInt32(this, offset, true, noAssert); + }; + + + /* + * Signed integer types, yay team! A reminder on how two's complement actually + * works. The first bit is the signed bit, i.e. tells us whether or not the + * number should be positive or negative. If the two's complement value is + * positive, then we're done, as it's equivalent to the unsigned representation. + * + * Now if the number is positive, you're pretty much done, you can just leverage + * the unsigned translations and return those. Unfortunately, negative numbers + * aren't quite that straightforward. + * + * At first glance, one might be inclined to use the traditional formula to + * translate binary numbers between the positive and negative values in two's + * complement. (Though it doesn't quite work for the most negative value) + * Mainly: + * - invert all the bits + * - add one to the result + * + * Of course, this doesn't quite work in Javascript. Take for example the value + * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of + * course, Javascript will do the following: + * + * > ~0xff80 + * -65409 + * + * Whoh there, Javascript, that's not quite right. But wait, according to + * Javascript that's perfectly correct. When Javascript ends up seeing the + * constant 0xff80, it has no notion that it is actually a signed number. It + * assumes that we've input the unsigned value 0xff80. Thus, when it does the + * binary negation, it casts it into a signed value, (positive 0xff80). Then + * when you perform binary negation on that, it turns it into a negative number. + * + * Instead, we're going to have to use the following general formula, that works + * in a rather Javascript friendly way. I'm glad we don't support this kind of + * weird numbering scheme in the kernel. + * + * (BIT-MAX - (unsigned)val + 1) * -1 + * + * The astute observer, may think that this doesn't make sense for 8-bit numbers + * (really it isn't necessary for them). However, when you get 16-bit numbers, + * you do. Let's go back to our prior example and see how this will look: + * + * (0xffff - 0xff80 + 1) * -1 + * (0x007f + 1) * -1 + * (0x0080) * -1 + */ + Buffer.prototype.readInt8 = function(offset, noAssert) { + var buffer = this; + var neg; + + if (!noAssert) { + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'Trying to read beyond buffer length'); + } + + if (offset >= buffer.length) return; + + neg = buffer[offset] & 0x80; + if (!neg) { + return (buffer[offset]); + } + + return ((0xff - buffer[offset] + 1) * -1); + }; + + function readInt16(buffer, offset, isBigEndian, noAssert) { + var neg, val; + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'Trying to read beyond buffer length'); + } + + val = readUInt16(buffer, offset, isBigEndian, noAssert); + neg = val & 0x8000; + if (!neg) { + return val; + } + + return (0xffff - val + 1) * -1; + } + + Buffer.prototype.readInt16LE = function(offset, noAssert) { + return readInt16(this, offset, false, noAssert); + }; + + Buffer.prototype.readInt16BE = function(offset, noAssert) { + return readInt16(this, offset, true, noAssert); + }; + + function readInt32(buffer, offset, isBigEndian, noAssert) { + var neg, val; + + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to read beyond buffer length'); + } + + val = readUInt32(buffer, offset, isBigEndian, noAssert); + neg = val & 0x80000000; + if (!neg) { + return (val); + } + + return (0xffffffff - val + 1) * -1; + } + + Buffer.prototype.readInt32LE = function(offset, noAssert) { + return readInt32(this, offset, false, noAssert); + }; + + Buffer.prototype.readInt32BE = function(offset, noAssert) { + return readInt32(this, offset, true, noAssert); + }; + + function readFloat(buffer, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to read beyond buffer length'); + } + + return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, + 23, 4); + } + + Buffer.prototype.readFloatLE = function(offset, noAssert) { + return readFloat(this, offset, false, noAssert); + }; + + Buffer.prototype.readFloatBE = function(offset, noAssert) { + return readFloat(this, offset, true, noAssert); + }; + + function readDouble(buffer, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset + 7 < buffer.length, + 'Trying to read beyond buffer length'); + } + + return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, + 52, 8); + } + + Buffer.prototype.readDoubleLE = function(offset, noAssert) { + return readDouble(this, offset, false, noAssert); + }; + + Buffer.prototype.readDoubleBE = function(offset, noAssert) { + return readDouble(this, offset, true, noAssert); + }; + + + /* + * We have to make sure that the value is a valid integer. This means that it is + * non-negative. It has no fractional component and that it does not exceed the + * maximum allowed value. + * + * value The number to check for validity + * + * max The maximum value + */ + function verifuint(value, max) { + assert.ok(typeof (value) == 'number', + 'cannot write a non-number as a number'); + + assert.ok(value >= 0, + 'specified a negative value for writing an unsigned value'); + + assert.ok(value <= max, 'value is larger than maximum value for type'); + + assert.ok(Math.floor(value) === value, 'value has a fractional component'); + } + + Buffer.prototype.writeUInt8 = function(value, offset, noAssert) { + var buffer = this; + + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'trying to write beyond buffer length'); + + verifuint(value, 0xff); + } + + if (offset < buffer.length) { + buffer[offset] = value; + } + }; + + function writeUInt16(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'trying to write beyond buffer length'); + + verifuint(value, 0xffff); + } + + for (var i = 0; i < Math.min(buffer.length - offset, 2); i++) { + buffer[offset + i] = + (value & (0xff << (8 * (isBigEndian ? 1 - i : i)))) >>> + (isBigEndian ? 1 - i : i) * 8; + } + + } + + Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) { + writeUInt16(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) { + writeUInt16(this, value, offset, true, noAssert); + }; + + function writeUInt32(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'trying to write beyond buffer length'); + + verifuint(value, 0xffffffff); + } + + for (var i = 0; i < Math.min(buffer.length - offset, 4); i++) { + buffer[offset + i] = + (value >>> (isBigEndian ? 3 - i : i) * 8) & 0xff; + } + } + + Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) { + writeUInt32(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) { + writeUInt32(this, value, offset, true, noAssert); + }; + + + /* + * We now move onto our friends in the signed number category. Unlike unsigned + * numbers, we're going to have to worry a bit more about how we put values into + * arrays. Since we are only worrying about signed 32-bit values, we're in + * slightly better shape. Unfortunately, we really can't do our favorite binary + * & in this system. It really seems to do the wrong thing. For example: + * + * > -32 & 0xff + * 224 + * + * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of + * this aren't treated as a signed number. Ultimately a bad thing. + * + * What we're going to want to do is basically create the unsigned equivalent of + * our representation and pass that off to the wuint* functions. To do that + * we're going to do the following: + * + * - if the value is positive + * we can pass it directly off to the equivalent wuint + * - if the value is negative + * we do the following computation: + * mb + val + 1, where + * mb is the maximum unsigned value in that byte size + * val is the Javascript negative integer + * + * + * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If + * you do out the computations: + * + * 0xffff - 128 + 1 + * 0xffff - 127 + * 0xff80 + * + * You can then encode this value as the signed version. This is really rather + * hacky, but it should work and get the job done which is our goal here. + */ + + /* + * A series of checks to make sure we actually have a signed 32-bit number + */ + function verifsint(value, max, min) { + assert.ok(typeof (value) == 'number', + 'cannot write a non-number as a number'); + + assert.ok(value <= max, 'value larger than maximum allowed value'); + + assert.ok(value >= min, 'value smaller than minimum allowed value'); + + assert.ok(Math.floor(value) === value, 'value has a fractional component'); + } + + function verifIEEE754(value, max, min) { + assert.ok(typeof (value) == 'number', + 'cannot write a non-number as a number'); + + assert.ok(value <= max, 'value larger than maximum allowed value'); + + assert.ok(value >= min, 'value smaller than minimum allowed value'); + } + + Buffer.prototype.writeInt8 = function(value, offset, noAssert) { + var buffer = this; + + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset < buffer.length, + 'Trying to write beyond buffer length'); + + verifsint(value, 0x7f, -0x80); + } + + if (value >= 0) { + buffer.writeUInt8(value, offset, noAssert); + } else { + buffer.writeUInt8(0xff + value + 1, offset, noAssert); + } + }; + + function writeInt16(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 1 < buffer.length, + 'Trying to write beyond buffer length'); + + verifsint(value, 0x7fff, -0x8000); + } + + if (value >= 0) { + writeUInt16(buffer, value, offset, isBigEndian, noAssert); + } else { + writeUInt16(buffer, 0xffff + value + 1, offset, isBigEndian, noAssert); + } + } + + Buffer.prototype.writeInt16LE = function(value, offset, noAssert) { + writeInt16(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { + writeInt16(this, value, offset, true, noAssert); + }; + + function writeInt32(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to write beyond buffer length'); + + verifsint(value, 0x7fffffff, -0x80000000); + } + + if (value >= 0) { + writeUInt32(buffer, value, offset, isBigEndian, noAssert); + } else { + writeUInt32(buffer, 0xffffffff + value + 1, offset, isBigEndian, noAssert); + } + } + + Buffer.prototype.writeInt32LE = function(value, offset, noAssert) { + writeInt32(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { + writeInt32(this, value, offset, true, noAssert); + }; + + function writeFloat(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 3 < buffer.length, + 'Trying to write beyond buffer length'); + + verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); + } + + require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, + 23, 4); + } + + Buffer.prototype.writeFloatLE = function(value, offset, noAssert) { + writeFloat(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeFloatBE = function(value, offset, noAssert) { + writeFloat(this, value, offset, true, noAssert); + }; + + function writeDouble(buffer, value, offset, isBigEndian, noAssert) { + if (!noAssert) { + assert.ok(value !== undefined && value !== null, + 'missing value'); + + assert.ok(typeof (isBigEndian) === 'boolean', + 'missing or invalid endian'); + + assert.ok(offset !== undefined && offset !== null, + 'missing offset'); + + assert.ok(offset + 7 < buffer.length, + 'Trying to write beyond buffer length'); + + verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); + } + + require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, + 52, 8); + } + + Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) { + writeDouble(this, value, offset, false, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) { + writeDouble(this, value, offset, true, noAssert); + }; + + },{"./buffer_ieee754":1,"assert":6,"base64-js":4}],"buffer-browserify":[function(require,module,exports){ + module.exports=require('q9TxCC'); + },{}],4:[function(require,module,exports){ + (function (exports) { + 'use strict'; + + var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + function b64ToByteArray(b64) { + var i, j, l, tmp, placeHolders, arr; + + if (b64.length % 4 > 0) { + throw 'Invalid string. Length must be a multiple of 4'; + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + placeHolders = b64.indexOf('='); + placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0; + + // base64 is 4/3 + up to two characters of the original data + arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders); + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length; + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]); + arr.push((tmp & 0xFF0000) >> 16); + arr.push((tmp & 0xFF00) >> 8); + arr.push(tmp & 0xFF); + } + + if (placeHolders === 2) { + tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4); + arr.push(tmp & 0xFF); + } else if (placeHolders === 1) { + tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2); + arr.push((tmp >> 8) & 0xFF); + arr.push(tmp & 0xFF); + } + + return arr; + } + + function uint8ToBase64(uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length; + + function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; + }; + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); + output += tripletToBase64(temp); + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1]; + output += lookup[temp >> 2]; + output += lookup[(temp << 4) & 0x3F]; + output += '=='; + break; + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]); + output += lookup[temp >> 10]; + output += lookup[(temp >> 4) & 0x3F]; + output += lookup[(temp << 2) & 0x3F]; + output += '='; + break; + } + + return output; + } + + module.exports.toByteArray = b64ToByteArray; + module.exports.fromByteArray = uint8ToBase64; + }()); + + },{}],5:[function(require,module,exports){ + + + // + // The shims in this file are not fully implemented shims for the ES5 + // features, but do work for the particular usecases there is in + // the other modules. + // + + var toString = Object.prototype.toString; + var hasOwnProperty = Object.prototype.hasOwnProperty; + + // Array.isArray is supported in IE9 + function isArray(xs) { + return toString.call(xs) === '[object Array]'; + } + exports.isArray = typeof Array.isArray === 'function' ? Array.isArray : isArray; + + // Array.prototype.indexOf is supported in IE9 + exports.indexOf = function indexOf(xs, x) { + if (xs.indexOf) return xs.indexOf(x); + for (var i = 0; i < xs.length; i++) { + if (x === xs[i]) return i; + } + return -1; + }; + + // Array.prototype.filter is supported in IE9 + exports.filter = function filter(xs, fn) { + if (xs.filter) return xs.filter(fn); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (fn(xs[i], i, xs)) res.push(xs[i]); + } + return res; + }; + + // Array.prototype.forEach is supported in IE9 + exports.forEach = function forEach(xs, fn, self) { + if (xs.forEach) return xs.forEach(fn, self); + for (var i = 0; i < xs.length; i++) { + fn.call(self, xs[i], i, xs); + } + }; + + // Array.prototype.map is supported in IE9 + exports.map = function map(xs, fn) { + if (xs.map) return xs.map(fn); + var out = new Array(xs.length); + for (var i = 0; i < xs.length; i++) { + out[i] = fn(xs[i], i, xs); + } + return out; + }; + + // Array.prototype.reduce is supported in IE9 + exports.reduce = function reduce(array, callback, opt_initialValue) { + if (array.reduce) return array.reduce(callback, opt_initialValue); + var value, isValueSet = false; + + if (2 < arguments.length) { + value = opt_initialValue; + isValueSet = true; + } + for (var i = 0, l = array.length; l > i; ++i) { + if (array.hasOwnProperty(i)) { + if (isValueSet) { + value = callback(value, array[i], i, array); + } + else { + value = array[i]; + isValueSet = true; + } + } + } + + return value; + }; + + // String.prototype.substr - negative index don't work in IE8 + if ('ab'.substr(-1) !== 'b') { + exports.substr = function (str, start, length) { + // did we get a negative start, calculate how much it is from the beginning of the string + if (start < 0) start = str.length + start; + + // call the original function + return str.substr(start, length); + }; + } else { + exports.substr = function (str, start, length) { + return str.substr(start, length); + }; + } + + // String.prototype.trim is supported in IE9 + exports.trim = function (str) { + if (str.trim) return str.trim(); + return str.replace(/^\s+|\s+$/g, ''); + }; + + // Function.prototype.bind is supported in IE9 + exports.bind = function () { + var args = Array.prototype.slice.call(arguments); + var fn = args.shift(); + if (fn.bind) return fn.bind.apply(fn, args); + var self = args.shift(); + return function () { + fn.apply(self, args.concat([Array.prototype.slice.call(arguments)])); + }; + }; + + // Object.create is supported in IE9 + function create(prototype, properties) { + var object; + if (prototype === null) { + object = { '__proto__' : null }; + } + else { + if (typeof prototype !== 'object') { + throw new TypeError( + 'typeof prototype[' + (typeof prototype) + '] != \'object\'' + ); + } + var Type = function () {}; + Type.prototype = prototype; + object = new Type(); + object.__proto__ = prototype; + } + if (typeof properties !== 'undefined' && Object.defineProperties) { + Object.defineProperties(object, properties); + } + return object; + } + exports.create = typeof Object.create === 'function' ? Object.create : create; + + // Object.keys and Object.getOwnPropertyNames is supported in IE9 however + // they do show a description and number property on Error objects + function notObject(object) { + return ((typeof object != "object" && typeof object != "function") || object === null); + } + + function keysShim(object) { + if (notObject(object)) { + throw new TypeError("Object.keys called on a non-object"); + } + + var result = []; + for (var name in object) { + if (hasOwnProperty.call(object, name)) { + result.push(name); + } + } + return result; + } + + // getOwnPropertyNames is almost the same as Object.keys one key feature + // is that it returns hidden properties, since that can't be implemented, + // this feature gets reduced so it just shows the length property on arrays + function propertyShim(object) { + if (notObject(object)) { + throw new TypeError("Object.getOwnPropertyNames called on a non-object"); + } + + var result = keysShim(object); + if (exports.isArray(object) && exports.indexOf(object, 'length') === -1) { + result.push('length'); + } + return result; + } + + var keys = typeof Object.keys === 'function' ? Object.keys : keysShim; + var getOwnPropertyNames = typeof Object.getOwnPropertyNames === 'function' ? + Object.getOwnPropertyNames : propertyShim; + + if (new Error().hasOwnProperty('description')) { + var ERROR_PROPERTY_FILTER = function (obj, array) { + if (toString.call(obj) === '[object Error]') { + array = exports.filter(array, function (name) { + return name !== 'description' && name !== 'number' && name !== 'message'; + }); + } + return array; + }; + + exports.keys = function (object) { + return ERROR_PROPERTY_FILTER(object, keys(object)); + }; + exports.getOwnPropertyNames = function (object) { + return ERROR_PROPERTY_FILTER(object, getOwnPropertyNames(object)); + }; + } else { + exports.keys = keys; + exports.getOwnPropertyNames = getOwnPropertyNames; + } + + // Object.getOwnPropertyDescriptor - supported in IE8 but only on dom elements + function valueObject(value, key) { + return { value: value[key] }; + } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + try { + Object.getOwnPropertyDescriptor({'a': 1}, 'a'); + exports.getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + } catch (e) { + // IE8 dom element issue - use a try catch and default to valueObject + exports.getOwnPropertyDescriptor = function (value, key) { + try { + return Object.getOwnPropertyDescriptor(value, key); + } catch (e) { + return valueObject(value, key); + } + }; + } + } else { + exports.getOwnPropertyDescriptor = valueObject; + } + + },{}],6:[function(require,module,exports){ + // Copyright Joyent, Inc. and other Node 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. + + // UTILITY + var util = require('util'); + var shims = require('_shims'); + var pSlice = Array.prototype.slice; + + // 1. The assert module provides functions that throw + // AssertionError's when particular conditions are not met. The + // assert module must conform to the following interface. + + var assert = module.exports = ok; + + // 2. The AssertionError is defined in assert. + // new assert.AssertionError({ message: message, + // actual: actual, + // expected: expected }) + + assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + this.message = options.message || getMessage(this); + }; + + // assert.AssertionError instanceof Error + util.inherits(assert.AssertionError, Error); + + function replacer(key, value) { + if (util.isUndefined(value)) { + return '' + value; + } + if (util.isNumber(value) && (isNaN(value) || !isFinite(value))) { + return value.toString(); + } + if (util.isFunction(value) || util.isRegExp(value)) { + return value.toString(); + } + return value; + } + + function truncate(s, n) { + if (util.isString(s)) { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } + } + + function getMessage(self) { + return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + + self.operator + ' ' + + truncate(JSON.stringify(self.expected, replacer), 128); + } + + // At present only the three keys mentioned above are used and + // understood by the spec. Implementations or sub modules can pass + // other keys to the AssertionError's constructor - they will be + // ignored. + + // 3. All of the following functions must throw an AssertionError + // when a corresponding condition is not met, with a message that + // may be undefined if not provided. All assertion methods provide + // both the actual and expected values to the assertion error for + // display purposes. + + function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); + } + + // EXTENSION! allows for well behaved errors defined elsewhere. + assert.fail = fail; + + // 4. Pure assertion tests whether a value is truthy, as determined + // by !!guard. + // assert.ok(guard, message_opt); + // This statement is equivalent to assert.equal(true, !!guard, + // message_opt);. To test strictly for the value true, use + // assert.strictEqual(true, guard, message_opt);. + + function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); + } + assert.ok = ok; + + // 5. The equality assertion tests shallow, coercive equality with + // ==. + // assert.equal(actual, expected, message_opt); + + assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); + }; + + // 6. The non-equality assertion tests for whether two objects are not equal + // with != assert.notEqual(actual, expected, message_opt); + + assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } + }; + + // 7. The equivalence assertion tests a deep equality relation. + // assert.deepEqual(actual, expected, message_opt); + + assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } + }; + + function _deepEqual(actual, expected) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (util.isBuffer(actual) && util.isBuffer(expected)) { + if (actual.length != expected.length) return false; + + for (var i = 0; i < actual.length; i++) { + if (actual[i] !== expected[i]) return false; + } + + return true; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!util.isObject(actual) && !util.isObject(expected)) { + return actual == expected; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected); + } + } + + function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; + } + + function objEquiv(a, b) { + if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b); + } + try { + var ka = shims.keys(a), + kb = shims.keys(b), + key, i; + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key])) return false; + } + return true; + } + + // 8. The non-equivalence assertion tests for any deep inequality. + // assert.notDeepEqual(actual, expected, message_opt); + + assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } + }; + + // 9. The strict equality assertion tests strict equality, as determined by ===. + // assert.strictEqual(actual, expected, message_opt); + + assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } + }; + + // 10. The strict non-equality assertion tests for strict inequality, as + // determined by !==. assert.notStrictEqual(actual, expected, message_opt); + + assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } + }; + + function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } else if (actual instanceof expected) { + return true; + } else if (expected.call({}, actual) === true) { + return true; + } + + return false; + } + + function _throws(shouldThrow, block, expected, message) { + var actual; + + if (util.isString(expected)) { + message = expected; + expected = null; + } + + try { + block(); + } catch (e) { + actual = e; + } + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + if (!shouldThrow && expectedException(actual, expected)) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } + } + + // 11. Expected to throw an error: + // assert.throws(block, Error_opt, message_opt); + + assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws.apply(this, [true].concat(pSlice.call(arguments))); + }; + + // EXTENSION! This is annoying to write outside this module. + assert.doesNotThrow = function(block, /*optional*/message) { + _throws.apply(this, [false].concat(pSlice.call(arguments))); + }; + + assert.ifError = function(err) { if (err) {throw err;}}; + },{"_shims":5,"util":7}],7:[function(require,module,exports){ + // Copyright Joyent, Inc. and other Node 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. + + var shims = require('_shims'); + + var formatRegExp = /%[sdj%]/g; + exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; + }; + + /** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ + /* legacy: obj, showHidden, depth, colors*/ + function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); + } + exports.inspect = inspect; + + + // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics + inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] + }; + + // Don't use 'blue' not visible on cmd.exe + inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' + }; + + + function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } + } + + + function stylizeNoColor(str, styleType) { + return str; + } + + + function arrayToHash(array) { + var hash = {}; + + shims.forEach(array, function(val, idx) { + hash[val] = true; + }); + + return hash; + } + + + function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = shims.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = shims.getOwnPropertyNames(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); + } + + + function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); + } + + + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + + + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + + shims.forEach(keys, function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; + } + + + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = shims.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (shims.indexOf(ctx.seen, desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; + } + + + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = shims.reduce(output, function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { + return shims.isArray(ar); + } + exports.isArray = isArray; + + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + exports.isBoolean = isBoolean; + + function isNull(arg) { + return arg === null; + } + exports.isNull = isNull; + + function isNullOrUndefined(arg) { + return arg == null; + } + exports.isNullOrUndefined = isNullOrUndefined; + + function isNumber(arg) { + return typeof arg === 'number'; + } + exports.isNumber = isNumber; + + function isString(arg) { + return typeof arg === 'string'; + } + exports.isString = isString; + + function isSymbol(arg) { + return typeof arg === 'symbol'; + } + exports.isSymbol = isSymbol; + + function isUndefined(arg) { + return arg === void 0; + } + exports.isUndefined = isUndefined; + + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + exports.isRegExp = isRegExp; + + function isObject(arg) { + return typeof arg === 'object' && arg; + } + exports.isObject = isObject; + + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + exports.isDate = isDate; + + function isError(e) { + return isObject(e) && objectToString(e) === '[object Error]'; + } + exports.isError = isError; + + function isFunction(arg) { + return typeof arg === 'function'; + } + exports.isFunction = isFunction; + + function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; + } + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { + return arg instanceof Buffer; + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); + } + + + function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); + } + + + var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + + // 26 Feb 16:19:34 + function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); + } + + + // log is just a thin wrapper to console.log that prepends a timestamp + exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); + }; + + + /** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ + exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = shims.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + + exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = shims.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; + }; + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + },{"_shims":5}]},{},[]) + ;;module.exports=require("buffer-browserify") + + },{}],13:[function(require,module,exports){ + // shim for using process in browser + + var process = module.exports = {}; + + process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + if (canPost) { + var queue = []; + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; + })(); + + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + } + + // TODO(shtylman) + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + + },{}],14:[function(require,module,exports){ + var global=typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};/** + * @license + * lodash 3.10.1 (Custom Build) + * Build: `lodash compat -d -o ./index.js` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + ;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '3.10.1'; + + /** Used to compose bitmasks for wrapper metadata. */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_BOUND_FLAG = 4, + CURRY_FLAG = 8, + CURRY_RIGHT_FLAG = 16, + PARTIAL_FLAG = 32, + PARTIAL_RIGHT_FLAG = 64, + ARY_FLAG = 128, + REARG_FLAG = 256; + + /** Used as default options for `_.trunc`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect when a function becomes hot. */ + var HOT_COUNT = 150, + HOT_SPAN = 16; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2; + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, + reUnescapedHtml = /[&<>"'`]/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; + + /** + * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) + * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern). + */ + var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g, + reHasRegExpChars = RegExp(reRegExpChars.source); + + /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ + var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect hexadecimal string values. */ + var reHasHexPrefix = /^0[xX]/; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^\d+$/; + + /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ + var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to match words to create compound words. */ + var reWords = (function() { + var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', + lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; + + return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); + }()); + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', + 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite', + 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap' + ]; + + /** Used to fix the JScript `[[DontEnum]]` bug. */ + var shadowProps = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dateTag] = typedArrayTags[errorTag] = + typedArrayTags[funcTag] = typedArrayTags[mapTag] = + typedArrayTags[numberTag] = typedArrayTags[objectTag] = + typedArrayTags[regexpTag] = typedArrayTags[setTag] = + typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = + cloneableTags[dateTag] = cloneableTags[float32Tag] = + cloneableTags[float64Tag] = cloneableTags[int8Tag] = + cloneableTags[int16Tag] = cloneableTags[int32Tag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[stringTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[mapTag] = cloneableTags[setTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map latin-1 supplementary letters to basic latin letters. */ + var deburredLetters = { + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'", + '`': '`' + }; + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Used to escape characters for inclusion in compiled regexes. */ + var regexpEscapes = { + '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34', + '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39', + 'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46', + 'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66', + 'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78' + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Detect free variable `exports`. */ + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; + + /** Detect free variable `self`. */ + var freeSelf = objectTypes[typeof self] && self && self.Object && self; + + /** Detect free variable `window`. */ + var freeWindow = objectTypes[typeof window] && window && window.Object && window; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `compareAscending` which compares values and + * sorts them in ascending order without guaranteeing a stable sort. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function baseCompareAscending(value, other) { + if (value !== other) { + var valIsNull = value === null, + valIsUndef = value === undefined, + valIsReflexive = value === value; + + var othIsNull = other === null, + othIsUndef = other === undefined, + othIsReflexive = other === other; + + if ((value > other && !othIsNull) || !valIsReflexive || + (valIsNull && !othIsUndef && othIsReflexive) || + (valIsUndef && othIsReflexive)) { + return 1; + } + if ((value < other && !valIsNull) || !othIsReflexive || + (othIsNull && !valIsUndef && valIsReflexive) || + (othIsUndef && valIsReflexive)) { + return -1; + } + } + return 0; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for callback shorthands and `this` binding. + * + * @private + * @param {Array} array The array to search. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without support for binary searches. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isFunction` without support for environments + * with incorrect `typeof` results. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + */ + function baseIsFunction(value) { + // Avoid a Chakra JIT bug in compatibility modes of IE 11. + // See https://github.com/jashkenas/underscore/issues/1621 for more details. + return typeof value == 'function' || false; + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + return value == null ? '' : (value + ''); + } + + /** + * Used by `_.trim` and `_.trimLeft` to get the index of the first character + * of `string` that is not found in `chars`. + * + * @private + * @param {string} string The string to inspect. + * @param {string} chars The characters to find. + * @returns {number} Returns the index of the first character not found in `chars`. + */ + function charsLeftIndex(string, chars) { + var index = -1, + length = string.length; + + while (++index < length && chars.indexOf(string.charAt(index)) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimRight` to get the index of the last character + * of `string` that is not found in `chars`. + * + * @private + * @param {string} string The string to inspect. + * @param {string} chars The characters to find. + * @returns {number} Returns the index of the last character not found in `chars`. + */ + function charsRightIndex(string, chars) { + var index = string.length; + + while (index-- && chars.indexOf(string.charAt(index)) > -1) {} + return index; + } + + /** + * Used by `_.sortBy` to compare transformed elements of a collection and stable + * sort them in ascending order. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareAscending(object, other) { + return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index); + } + + /** + * Used by `_.sortByOrder` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise, + * a value is sorted in ascending order if its corresponding order is "asc", and + * descending if "desc". + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = baseCompareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * ((order === 'asc' || order === true) ? 1 : -1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://code.google.com/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + function deburrLetter(letter) { + return deburredLetters[letter]; + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(chr) { + return htmlEscapes[chr]; + } + + /** + * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes. + * + * @private + * @param {string} chr The matched character to escape. + * @param {string} leadingChar The capture group for a leading character. + * @param {string} whitespaceChar The capture group for a whitespace character. + * @returns {string} Returns the escaped character. + */ + function escapeRegExpChar(chr, leadingChar, whitespaceChar) { + if (leadingChar) { + chr = regexpEscapes[chr]; + } else if (whitespaceChar) { + chr = stringEscapes[chr]; + } + return '\\' + chr; + } + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ + function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; + } + + /** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ + var isHostObject = (function() { + try { + Object({ 'toString': 0 } + ''); + } catch(e) { + return function() { return false; }; + } + return function(value) { + // IE < 9 presents many host objects as `Object` objects that can coerce + // to strings despite having improperly defined `toString` methods. + return typeof value.toString != 'function' && typeof (value + '') == 'string'; + }; + }()); + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a + * character code is whitespace. + * + * @private + * @param {number} charCode The character code to inspect. + * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. + */ + function isSpace(charCode) { + return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || + (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279))); + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + if (array[index] === placeholder) { + array[index] = PLACEHOLDER; + result[++resIndex] = index; + } + } + return result; + } + + /** + * An implementation of `_.uniq` optimized for sorted arrays without support + * for callback shorthands and `this` binding. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The function invoked per iteration. + * @returns {Array} Returns the new duplicate free array. + */ + function sortedUniq(array, iteratee) { + var seen, + index = -1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value, index, array) : value; + + if (!index || seen !== computed) { + seen = computed; + result[++resIndex] = value; + } + } + return result; + } + + /** + * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the first non-whitespace character. + */ + function trimmedLeftIndex(string) { + var index = -1, + length = string.length; + + while (++index < length && isSpace(string.charCodeAt(index))) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedRightIndex(string) { + var index = string.length; + + while (index-- && isSpace(string.charCodeAt(index))) {} + return index; + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(chr) { + return htmlUnescapes[chr]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the given `context` object. + * + * @static + * @memberOf _ + * @category Utility + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // using `context` to mock `Date#getTime` use in `_.now` + * var mock = _.runInContext({ + * 'Date': function() { + * return { 'getTime': getTimeMock }; + * } + * }); + * + * // or creating a suped-up `defer` in Node.js + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + function runInContext(context) { + // Avoid issues with some ES3 environments that attempt to use values, named + // after built-in constructors like `Object`, for the creation of literals. + // ES5 clears this up by stating that literals must use built-in constructors. + // See https://es5.github.io/#x11.1.5 for more details. + context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; + + /** Native constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Number = context.Number, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for native method references. */ + var arrayProto = Array.prototype, + errorProto = Error.prototype, + objectProto = Object.prototype, + stringProto = String.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Native method references. */ + var ArrayBuffer = context.ArrayBuffer, + clearTimeout = context.clearTimeout, + parseFloat = context.parseFloat, + pow = Math.pow, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + Set = getNative(context, 'Set'), + setTimeout = context.setTimeout, + splice = arrayProto.splice, + Uint8Array = context.Uint8Array, + WeakMap = getNative(context, 'WeakMap'); + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeCreate = getNative(Object, 'create'), + nativeFloor = Math.floor, + nativeIsArray = getNative(Array, 'isArray'), + nativeIsFinite = context.isFinite, + nativeKeys = getNative(Object, 'keys'), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = getNative(Date, 'now'), + nativeParseInt = context.parseInt, + nativeRandom = Math.random; + + /** Used as references for `-Infinity` and `Infinity`. */ + var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, + POSITIVE_INFINITY = Number.POSITIVE_INFINITY; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to lookup a type array constructors by `toStringTag`. */ + var ctorByTag = {}; + ctorByTag[float32Tag] = context.Float32Array; + ctorByTag[float64Tag] = context.Float64Array; + ctorByTag[int8Tag] = context.Int8Array; + ctorByTag[int16Tag] = context.Int16Array; + ctorByTag[int32Tag] = context.Int32Array; + ctorByTag[uint8Tag] = Uint8Array; + ctorByTag[uint8ClampedTag] = context.Uint8ClampedArray; + ctorByTag[uint16Tag] = context.Uint16Array; + ctorByTag[uint32Tag] = context.Uint32Array; + + /** Used to avoid iterating over non-enumerable properties in IE < 9. */ + var nonEnumProps = {}; + nonEnumProps[arrayTag] = nonEnumProps[dateTag] = nonEnumProps[numberTag] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; + nonEnumProps[boolTag] = nonEnumProps[stringTag] = { 'constructor': true, 'toString': true, 'valueOf': true }; + nonEnumProps[errorTag] = nonEnumProps[funcTag] = nonEnumProps[regexpTag] = { 'constructor': true, 'toString': true }; + nonEnumProps[objectTag] = { 'constructor': true }; + + arrayEach(shadowProps, function(key) { + for (var tag in nonEnumProps) { + if (hasOwnProperty.call(nonEnumProps, tag)) { + var props = nonEnumProps[tag]; + props[key] = hasOwnProperty.call(props, key); + } + } + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit chaining. + * Methods that operate on and return arrays, collections, and functions can + * be chained together. Methods that retrieve a single value or may return a + * primitive value will automatically end the chain returning the unwrapped + * value. Explicit chaining may be enabled using `_.chain`. The execution of + * chained methods is lazy, that is, execution is deferred until `_#value` + * is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. Shortcut + * fusion is an optimization strategy which merge iteratee calls; this can help + * to avoid the creation of intermediate data structures and greatly reduce the + * number of iteratee executions. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, + * `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, + * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, + * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, + * and `where` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, + * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, + * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, + * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`, + * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, + * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, + * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, + * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, + * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`, + * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`, + * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`, + * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, + * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, + * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, + * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, + * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`, + * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, + * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, + * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, + * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, + * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`, + * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, + * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, + * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`, + * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`, + * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, + * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, + * `unescape`, `uniqueId`, `value`, and `words` + * + * The wrapper method `sample` will return a wrapped value when `n` is provided, + * otherwise an unwrapped value is returned. + * + * @name _ + * @constructor + * @category Chain + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(total, n) { + * return total + n; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(n) { + * return n * n; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The function whose prototype all chaining wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable chaining for all wrapper methods. + * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. + */ + function LodashWrapper(value, chainAll, actions) { + this.__wrapped__ = value; + this.__actions__ = actions || []; + this.__chain__ = !!chainAll; + } + + /** + * An object environment feature flags. + * + * @static + * @memberOf _ + * @type Object + */ + var support = lodash.support = {}; + + (function(x) { + var Ctor = function() { this.x = x; }, + object = { '0': x, 'length': x }, + props = []; + + Ctor.prototype = { 'valueOf': x, 'y': x }; + for (var key in new Ctor) { props.push(key); } + + /** + * Detect if `name` or `message` properties of `Error.prototype` are + * enumerable by default (IE < 9, Safari < 5.1). + * + * @memberOf _.support + * @type boolean + */ + support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || + propertyIsEnumerable.call(errorProto, 'name'); + + /** + * Detect if `prototype` properties are enumerable by default. + * + * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + * (if the prototype or a property on the prototype has been set) + * incorrectly set the `[[Enumerable]]` value of a function's `prototype` + * property to `true`. + * + * @memberOf _.support + * @type boolean + */ + support.enumPrototypes = propertyIsEnumerable.call(Ctor, 'prototype'); + + /** + * Detect if properties shadowing those on `Object.prototype` are non-enumerable. + * + * In IE < 9 an object's own properties, shadowing non-enumerable ones, + * are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug). + * + * @memberOf _.support + * @type boolean + */ + support.nonEnumShadows = !/valueOf/.test(props); + + /** + * Detect if own properties are iterated after inherited properties (IE < 9). + * + * @memberOf _.support + * @type boolean + */ + support.ownLast = props[0] != 'x'; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects + * correctly. + * + * Firefox < 10, compatibility modes of IE 8, and IE < 9 have buggy Array + * `shift()` and `splice()` functions that fail to remove the last element, + * `value[0]`, of array-like objects even though the "length" property is + * set to `0`. The `shift()` method is buggy in compatibility modes of IE 8, + * while `splice()` is buggy regardless of mode in IE < 9. + * + * @memberOf _.support + * @type boolean + */ + support.spliceObjects = (splice.call(object, 0, 1), !object[0]); + + /** + * Detect lack of support for accessing string characters by index. + * + * IE < 8 can't access characters by index. IE 8 can only access characters + * by index on string literals, not string objects. + * + * @memberOf _.support + * @type boolean + */ + support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx'; + }(1, 0)); + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB). Change the following template settings to use + * alternative delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': lodash + } + }; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = POSITIVE_INFINITY; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = arrayCopy(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = arrayCopy(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = arrayCopy(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a cache object to store key/value pairs. + * + * @private + * @static + * @name Cache + * @memberOf _.memoize + */ + function MapCache() { + this.__data__ = {}; + } + + /** + * Removes `key` and its value from the cache. + * + * @private + * @name delete + * @memberOf _.memoize.Cache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. + */ + function mapDelete(key) { + return this.has(key) && delete this.__data__[key]; + } + + /** + * Gets the cached value for `key`. + * + * @private + * @name get + * @memberOf _.memoize.Cache + * @param {string} key The key of the value to get. + * @returns {*} Returns the cached value. + */ + function mapGet(key) { + return key == '__proto__' ? undefined : this.__data__[key]; + } + + /** + * Checks if a cached value for `key` exists. + * + * @private + * @name has + * @memberOf _.memoize.Cache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapHas(key) { + return key != '__proto__' && hasOwnProperty.call(this.__data__, key); + } + + /** + * Sets `value` to `key` of the cache. + * + * @private + * @name set + * @memberOf _.memoize.Cache + * @param {string} key The key of the value to cache. + * @param {*} value The value to cache. + * @returns {Object} Returns the cache object. + */ + function mapSet(key, value) { + if (key != '__proto__') { + this.__data__[key] = value; + } + return this; + } + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates a cache object to store unique values. + * + * @private + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var length = values ? values.length : 0; + + this.data = { 'hash': nativeCreate(null), 'set': new Set }; + while (length--) { + this.push(values[length]); + } + } + + /** + * Checks if `value` is in `cache` mimicking the return signature of + * `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var data = cache.data, + result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; + + return result ? 0 : -1; + } + + /** + * Adds `value` to the cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ + function cachePush(value) { + var data = this.data; + if (typeof value == 'string' || isObject(value)) { + data.set.add(value); + } else { + data.hash[value] = true; + } + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a new array joining `array` with `other`. + * + * @private + * @param {Array} array The array to join. + * @param {Array} other The other array to join. + * @returns {Array} Returns the new concatenated array. + */ + function arrayConcat(array, other) { + var index = -1, + length = array.length, + othIndex = -1, + othLength = other.length, + result = Array(length + othLength); + + while (++index < length) { + result[index] = array[index]; + } + while (++othIndex < othLength) { + result[index++] = other[othIndex]; + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function arrayCopy(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * A specialized version of `_.forEach` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * callback shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `baseExtremum` for arrays which invokes `iteratee` + * with one argument: (value). + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} comparator The function used to compare values. + * @param {*} exValue The initial extremum value. + * @returns {*} Returns the extremum value. + */ + function arrayExtremum(array, iteratee, comparator, exValue) { + var index = -1, + length = array.length, + computed = exValue, + result = computed; + + while (++index < length) { + var value = array[index], + current = +iteratee(value); + + if (comparator(current, computed)) { + computed = current; + result = value; + } + } + return result; + } + + /** + * A specialized version of `_.filter` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[++resIndex] = value; + } + } + return result; + } + + /** + * A specialized version of `_.map` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initFromArray] Specify using the first element of `array` + * as the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initFromArray) { + var index = -1, + length = array.length; + + if (initFromArray && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * callback shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initFromArray] Specify using the last element of `array` + * as the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initFromArray) { + var length = array.length; + if (initFromArray && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.sum` for arrays without support for callback + * shorthands and `this` binding.. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function arraySum(array, iteratee) { + var length = array.length, + result = 0; + + while (length--) { + result += +iteratee(array[length]) || 0; + } + return result; + } + + /** + * Used by `_.defaults` to customize its `_.assign` use. + * + * @private + * @param {*} objectValue The destination object property value. + * @param {*} sourceValue The source object property value. + * @returns {*} Returns the value to assign to the destination object. + */ + function assignDefaults(objectValue, sourceValue) { + return objectValue === undefined ? sourceValue : objectValue; + } + + /** + * Used by `_.template` to customize its `_.assign` use. + * + * **Note:** This function is like `assignDefaults` except that it ignores + * inherited property values when checking if a property is `undefined`. + * + * @private + * @param {*} objectValue The destination object property value. + * @param {*} sourceValue The source object property value. + * @param {string} key The key associated with the object and source values. + * @param {Object} object The destination object. + * @returns {*} Returns the value to assign to the destination object. + */ + function assignOwnDefaults(objectValue, sourceValue, key, object) { + return (objectValue === undefined || !hasOwnProperty.call(object, key)) + ? sourceValue + : objectValue; + } + + /** + * A specialized version of `_.assign` for customizing assigned values without + * support for argument juggling, multiple sources, and `this` binding `customizer` + * functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + */ + function assignWith(object, source, customizer) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index], + value = object[key], + result = customizer(value, source[key], key, object, source); + + if ((result === result ? (result !== value) : (value === value)) || + (value === undefined && !(key in object))) { + object[key] = result; + } + } + return object; + } + + /** + * The base implementation of `_.assign` without support for argument juggling, + * multiple sources, and `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return source == null + ? object + : baseCopy(source, keys(source), object); + } + + /** + * The base implementation of `_.at` without support for string collections + * and individual key arguments. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {number[]|string[]} props The property names or indexes of elements to pick. + * @returns {Array} Returns the new array of picked elements. + */ + function baseAt(collection, props) { + var index = -1, + isNil = collection == null, + isArr = !isNil && isArrayLike(collection), + length = isArr ? collection.length : 0, + propsLength = props.length, + result = Array(propsLength); + + while(++index < propsLength) { + var key = props[index]; + if (isArr) { + result[index] = isIndex(key, length) ? collection[key] : undefined; + } else { + result[index] = isNil ? undefined : collection[key]; + } + } + return result; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ + function baseCopy(source, props, object) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + object[key] = source[key]; + } + return object; + } + + /** + * The base implementation of `_.callback` which supports specifying the + * number of arguments to provide to `func`. + * + * @private + * @param {*} [func=_.identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ + function baseCallback(func, thisArg, argCount) { + var type = typeof func; + if (type == 'function') { + return thisArg === undefined + ? func + : bindCallback(func, thisArg, argCount); + } + if (func == null) { + return identity; + } + if (type == 'object') { + return baseMatches(func); + } + return thisArg === undefined + ? property(func) + : baseMatchesProperty(func, thisArg); + } + + /** + * The base implementation of `_.clone` without support for argument juggling + * and `this` binding `customizer` functions. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The object `value` belongs to. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates clones with source counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { + var result; + if (customizer) { + result = object ? customizer(value, key, object) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return arrayCopy(value, result); + } + } else { + var tag = objToString.call(value), + isFunc = tag == funcTag; + + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return baseAssign(result, value); + } + } else { + return cloneableTags[tag] + ? initCloneByTag(value, tag, isDeep) + : (object ? value : {}); + } + } + // Check for circular references and return its corresponding clone. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + // Add the source value to the stack of traversed objects and associate it with its clone. + stackA.push(value); + stackB.push(result); + + // Recursively populate clone (susceptible to call stack limits). + (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { + result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); + }); + return result; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(prototype) { + if (isObject(prototype)) { + object.prototype = prototype; + var result = new object; + object.prototype = undefined; + } + return result || {}; + }; + }()); + + /** + * The base implementation of `_.delay` and `_.defer` which accepts an index + * of where to slice the arguments to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Object} args The arguments provide to `func`. + * @returns {number} Returns the timer id. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of `_.difference` which accepts a single array + * of values to exclude. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values) { + var length = array ? array.length : 0, + result = []; + + if (!length) { + return result; + } + var index = -1, + indexOf = getIndexOf(), + isCommon = indexOf === baseIndexOf, + cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null, + valuesLength = values.length; + + if (cache) { + indexOf = cacheIndexOf; + isCommon = false; + values = cache; + } + outer: + while (++index < length) { + var value = array[index]; + + if (isCommon && value === value) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === value) { + continue outer; + } + } + result.push(value); + } + else if (indexOf(values, value, 0) < 0) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object|string} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object|string} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * Gets the extremum value of `collection` invoking `iteratee` for each value + * in `collection` to generate the criterion by which the value is ranked. + * The `iteratee` is invoked with three arguments: (value, index|key, collection). + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} comparator The function used to compare values. + * @param {*} exValue The initial extremum value. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(collection, iteratee, comparator, exValue) { + var computed = exValue, + result = computed; + + baseEach(collection, function(value, index, collection) { + var current = +iteratee(value, index, collection); + if (comparator(current, computed) || (current === exValue && current === result)) { + computed = current; + result = value; + } + }); + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : (+end || 0); + if (end < 0) { + end += length; + } + length = start > end ? 0 : (end >>> 0); + start >>>= 0; + + while (start < length) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, + * without support for callback shorthands and `this` binding, which iterates + * over `collection` using the provided `eachFunc`. + * + * @private + * @param {Array|Object|string} collection The collection to search. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @param {boolean} [retKey] Specify returning the key of the found element + * instead of the element itself. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFind(collection, predicate, eachFunc, retKey) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = retKey ? key : value; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with added support for restricting + * flattening and specifying the start index. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isDeep] Specify a deep flatten. + * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, isDeep, isStrict, result) { + result || (result = []); + + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + if (isObjectLike(value) && isArrayLike(value) && + (isStrict || isArray(value) || isArguments(value))) { + if (isDeep) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, isDeep, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iteratee functions may exit iteration early by explicitly + * returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forIn` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForIn(object, iteratee) { + return baseFor(object, iteratee, keysIn); + } + + /** + * The base implementation of `_.forOwn` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from those provided. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the new array of filtered property names. + */ + function baseFunctions(object, props) { + var index = -1, + length = props.length, + resIndex = -1, + result = []; + + while (++index < length) { + var key = props[index]; + if (isFunction(object[key])) { + result[++resIndex] = key; + } + } + return result; + } + + /** + * The base implementation of `get` without support for string paths + * and default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path of the property to get. + * @param {string} [pathKey] The key representation of path. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path, pathKey) { + if (object == null) { + return; + } + object = toObject(object); + if (pathKey !== undefined && pathKey in object) { + path = [pathKey]; + } + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = toObject(object)[path[index++]]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `_.isEqual` without support for `this` binding + * `customizer` functions. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing objects. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `value` objects. + * @param {Array} [stackB=[]] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = objToString.call(object); + if (objTag == argsTag) { + objTag = objectTag; + } else if (objTag != objectTag) { + objIsArr = isTypedArray(object); + } + } + if (!othIsArr) { + othTag = objToString.call(other); + if (othTag == argsTag) { + othTag = objectTag; + } else if (othTag != objectTag) { + othIsArr = isTypedArray(other); + } + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !(objIsArr || objIsObj)) { + return equalByTag(object, other, objTag); + } + if (!isLoose) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); + } + } + if (!isSameTag) { + return false; + } + // Assume cyclic values are equal. + // For more information on detecting circular references see https://es5.github.io/#JO. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == object) { + return stackB[length] == other; + } + } + // Add `object` and `other` to the stack of traversed objects. + stackA.push(object); + stackB.push(other); + + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); + + stackA.pop(); + stackB.pop(); + + return result; + } + + /** + * The base implementation of `_.isMatch` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} matchData The propery names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparing objects. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = toObject(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var result = customizer ? customizer(objValue, srcValue, key) : undefined; + if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.map` without support for callback shorthands + * and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which does not clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + var key = matchData[0][0], + value = matchData[0][1]; + + return function(object) { + if (object == null) { + return false; + } + object = toObject(object); + return object[key] === value && (value !== undefined || (key in object)); + }; + } + return function(object) { + return baseIsMatch(object, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which does not clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to compare. + * @returns {Function} Returns the new function. + */ + function baseMatchesProperty(path, srcValue) { + var isArr = isArray(path), + isCommon = isKey(path) && isStrictComparable(srcValue), + pathKey = (path + ''); + + path = toPath(path); + return function(object) { + if (object == null) { + return false; + } + var key = pathKey; + object = toObject(object); + if ((isArr || !isCommon) && !(key in object)) { + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + if (object == null) { + return false; + } + key = last(path); + object = toObject(object); + } + return object[key] === srcValue + ? (srcValue !== undefined || (key in object)) + : baseIsEqual(srcValue, object[key], undefined, true); + }; + } + + /** + * The base implementation of `_.merge` without support for argument juggling, + * multiple sources, and `this` binding `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} [customizer] The function to customize merged values. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates values with source counterparts. + * @returns {Object} Returns `object`. + */ + function baseMerge(object, source, customizer, stackA, stackB) { + if (!isObject(object)) { + return object; + } + var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), + props = isSrcArr ? undefined : keys(source); + + arrayEach(props || source, function(srcValue, key) { + if (props) { + key = srcValue; + srcValue = source[key]; + } + if (isObjectLike(srcValue)) { + stackA || (stackA = []); + stackB || (stackB = []); + baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); + } + else { + var value = object[key], + result = customizer ? customizer(value, srcValue, key, object, source) : undefined, + isCommon = result === undefined; + + if (isCommon) { + result = srcValue; + } + if ((result !== undefined || (isSrcArr && !(key in object))) && + (isCommon || (result === result ? (result !== value) : (value === value)))) { + object[key] = result; + } + } + }); + return object; + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize merged values. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates values with source counterparts. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { + var length = stackA.length, + srcValue = source[key]; + + while (length--) { + if (stackA[length] == srcValue) { + object[key] = stackB[length]; + return; + } + } + var value = object[key], + result = customizer ? customizer(value, srcValue, key, object, source) : undefined, + isCommon = result === undefined; + + if (isCommon) { + result = srcValue; + if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { + result = isArray(value) + ? value + : (isArrayLike(value) ? arrayCopy(value) : []); + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + result = isArguments(value) + ? toPlainObject(value) + : (isPlainObject(value) ? value : {}); + } + else { + isCommon = false; + } + } + // Add the source value to the stack of traversed objects and associate + // it with its merged value. + stackA.push(srcValue); + stackB.push(result); + + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); + } else if (result === result ? (result !== value) : (value === value)) { + object[key] = result; + } + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : toObject(object)[key]; + }; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ + function basePropertyDeep(path) { + var pathKey = (path + ''); + path = toPath(path); + return function(object) { + return baseGet(object, path, pathKey); + }; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * index arguments and capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0; + while (length--) { + var index = indexes[length]; + if (index != previous && isIndex(index)) { + var previous = index; + splice.call(array, index, 1); + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for argument juggling + * and returning floating-point numbers. + * + * @private + * @param {number} min The minimum possible value. + * @param {number} max The maximum possible value. + * @returns {number} Returns the random number. + */ + function baseRandom(min, max) { + return min + nativeFloor(nativeRandom() * (max - min + 1)); + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight` without support + * for callback shorthands and `this` binding, which iterates over `collection` + * using the provided `eachFunc`. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initFromCollection Specify using the first or last element + * of `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initFromCollection + ? (initFromCollection = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `setData` without support for hot loop detection. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : (+end || 0); + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for callback shorthands + * and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define + * the sort order of `array` and replaces criteria objects with their + * corresponding values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sortByOrder` without param guards. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {boolean[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseSortByOrder(collection, iteratees, orders) { + var callback = getCallback(), + index = -1; + + iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); }); + + var result = baseMap(collection, function(value) { + var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.sum` without support for callback shorthands + * and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(collection, iteratee) { + var result = 0; + baseEach(collection, function(value, index, collection) { + result += +iteratee(value, index, collection) || 0; + }); + return result; + } + + /** + * The base implementation of `_.uniq` without support for callback shorthands + * and `this` binding. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The function invoked per iteration. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee) { + var index = -1, + indexOf = getIndexOf(), + length = array.length, + isCommon = indexOf === baseIndexOf, + isLarge = isCommon && length >= LARGE_ARRAY_SIZE, + seen = isLarge ? createCache() : null, + result = []; + + if (seen) { + indexOf = cacheIndexOf; + isCommon = false; + } else { + isLarge = false; + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value, index, array) : value; + + if (isCommon && value === value) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (indexOf(seen, computed, 0) < 0) { + if (iteratee || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + var index = -1, + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /** + * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, + * and `_.takeWhile` without support for callback shorthands and `this` binding. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to peform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + var index = -1, + length = actions.length; + + while (++index < length) { + var action = actions[index]; + result = action.func.apply(action.thisArg, arrayPush([result], action.args)); + } + return result; + } + + /** + * Performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function binaryIndex(array, value, retHighest) { + var low = 0, + high = array ? array.length : low; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return binaryIndexBy(array, value, identity, retHighest); + } + + /** + * This function is like `binaryIndex` except that it invokes `iteratee` for + * `value` and each element of `array` to compute their sort ranking. The + * iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The function invoked per iteration. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function binaryIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array ? array.length : 0, + valIsNaN = value !== value, + valIsNull = value === null, + valIsUndef = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + isDef = computed !== undefined, + isReflexive = computed === computed; + + if (valIsNaN) { + var setLow = isReflexive || retHighest; + } else if (valIsNull) { + setLow = isReflexive && isDef && (retHighest || computed != null); + } else if (valIsUndef) { + setLow = isReflexive && (retHighest || isDef); + } else if (computed == null) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ + function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + + /** + * Creates a clone of the given array buffer. + * + * @private + * @param {ArrayBuffer} buffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function bufferClone(buffer) { + var result = new ArrayBuffer(buffer.byteLength), + view = new Uint8Array(result); + + view.set(new Uint8Array(buffer)); + return result; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders) { + var holdersLength = holders.length, + argsIndex = -1, + argsLength = nativeMax(args.length - holdersLength, 0), + leftIndex = -1, + leftLength = partials.length, + result = Array(leftLength + argsLength); + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + while (argsLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders) { + var holdersIndex = -1, + holdersLength = holders.length, + argsIndex = -1, + argsLength = nativeMax(args.length - holdersLength, 0), + rightIndex = -1, + rightLength = partials.length, + result = Array(argsLength + rightLength); + + while (++argsIndex < argsLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + return result; + } + + /** + * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function. + * + * @private + * @param {Function} setter The function to set keys and values of the accumulator object. + * @param {Function} [initializer] The function to initialize the accumulator object. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee, thisArg) { + var result = initializer ? initializer() : {}; + iteratee = getCallback(iteratee, thisArg, 3); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + setter(result, value, iteratee(value, index, collection), collection); + } + } else { + baseEach(collection, function(value, key, collection) { + setter(result, value, iteratee(value, key, collection), collection); + }); + } + return result; + }; + } + + /** + * Creates a `_.assign`, `_.defaults`, or `_.merge` function. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return restParam(function(object, sources) { + var index = -1, + length = object == null ? 0 : sources.length, + customizer = length > 2 ? sources[length - 2] : undefined, + guard = length > 2 ? sources[2] : undefined, + thisArg = length > 1 ? sources[length - 1] : undefined; + + if (typeof customizer == 'function') { + customizer = bindCallback(customizer, thisArg, 5); + length -= 2; + } else { + customizer = typeof thisArg == 'function' ? thisArg : undefined; + length -= (customizer ? 1 : 0); + } + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + var length = collection ? getLength(collection) : 0; + if (!isLength(length)) { + return eachFunc(collection, iteratee); + } + var index = fromRight ? length : -1, + iterable = toObject(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for `_.forIn` or `_.forInRight`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var iterable = toObject(object), + props = keysFunc(object), + length = props.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + var key = props[index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` and invokes it with the `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new bound function. + */ + function createBindWrapper(func, thisArg) { + var Ctor = createCtorWrapper(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(thisArg, arguments); + } + return wrapper; + } + + /** + * Creates a `Set` cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [values] The values to cache. + * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. + */ + function createCache(values) { + return (nativeCreate && Set) ? new SetCache(values) : null; + } + + /** + * Creates a function that produces compound words out of the words in a + * given string. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + var index = -1, + array = words(deburr(string)), + length = array.length, + result = ''; + + while (++index < length) { + result = callback(result, array[index], index); + } + return result; + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtorWrapper(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. + // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a `_.curry` or `_.curryRight` function. + * + * @private + * @param {boolean} flag The curry bit flag. + * @returns {Function} Returns the new curry function. + */ + function createCurry(flag) { + function curryFunc(func, arity, guard) { + if (guard && isIterateeCall(func, arity, guard)) { + arity = undefined; + } + var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryFunc.placeholder; + return result; + } + return curryFunc; + } + + /** + * Creates a `_.defaults` or `_.defaultsDeep` function. + * + * @private + * @param {Function} assigner The function to assign values. + * @param {Function} customizer The function to customize assigned values. + * @returns {Function} Returns the new defaults function. + */ + function createDefaults(assigner, customizer) { + return restParam(function(args) { + var object = args[0]; + if (object == null) { + return object; + } + args.push(customizer); + return assigner.apply(undefined, args); + }); + } + + /** + * Creates a `_.max` or `_.min` function. + * + * @private + * @param {Function} comparator The function used to compare values. + * @param {*} exValue The initial extremum value. + * @returns {Function} Returns the new extremum function. + */ + function createExtremum(comparator, exValue) { + return function(collection, iteratee, thisArg) { + if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { + iteratee = undefined; + } + iteratee = getCallback(iteratee, thisArg, 3); + if (iteratee.length == 1) { + collection = isArray(collection) ? collection : toIterable(collection); + var result = arrayExtremum(collection, iteratee, comparator, exValue); + if (!(collection.length && result === exValue)) { + return result; + } + } + return baseExtremum(collection, iteratee, comparator, exValue); + }; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new find function. + */ + function createFind(eachFunc, fromRight) { + return function(collection, predicate, thisArg) { + predicate = getCallback(predicate, thisArg, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate, fromRight); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, eachFunc); + }; + } + + /** + * Creates a `_.findIndex` or `_.findLastIndex` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new find function. + */ + function createFindIndex(fromRight) { + return function(array, predicate, thisArg) { + if (!(array && array.length)) { + return -1; + } + predicate = getCallback(predicate, thisArg, 3); + return baseFindIndex(array, predicate, fromRight); + }; + } + + /** + * Creates a `_.findKey` or `_.findLastKey` function. + * + * @private + * @param {Function} objectFunc The function to iterate over an object. + * @returns {Function} Returns the new find function. + */ + function createFindKey(objectFunc) { + return function(object, predicate, thisArg) { + predicate = getCallback(predicate, thisArg, 3); + return baseFind(object, predicate, objectFunc, true); + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return function() { + var wrapper, + length = arguments.length, + index = fromRight ? length : -1, + leftIndex = 0, + funcs = Array(length); + + while ((fromRight ? index-- : ++index < length)) { + var func = funcs[leftIndex++] = arguments[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') { + wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? -1 : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }; + } + + /** + * Creates a function for `_.forEach` or `_.forEachRight`. + * + * @private + * @param {Function} arrayFunc The function to iterate over an array. + * @param {Function} eachFunc The function to iterate over a collection. + * @returns {Function} Returns the new each function. + */ + function createForEach(arrayFunc, eachFunc) { + return function(collection, iteratee, thisArg) { + return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) + ? arrayFunc(collection, iteratee) + : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); + }; + } + + /** + * Creates a function for `_.forIn` or `_.forInRight`. + * + * @private + * @param {Function} objectFunc The function to iterate over an object. + * @returns {Function} Returns the new each function. + */ + function createForIn(objectFunc) { + return function(object, iteratee, thisArg) { + if (typeof iteratee != 'function' || thisArg !== undefined) { + iteratee = bindCallback(iteratee, thisArg, 3); + } + return objectFunc(object, iteratee, keysIn); + }; + } + + /** + * Creates a function for `_.forOwn` or `_.forOwnRight`. + * + * @private + * @param {Function} objectFunc The function to iterate over an object. + * @returns {Function} Returns the new each function. + */ + function createForOwn(objectFunc) { + return function(object, iteratee, thisArg) { + if (typeof iteratee != 'function' || thisArg !== undefined) { + iteratee = bindCallback(iteratee, thisArg, 3); + } + return objectFunc(object, iteratee); + }; + } + + /** + * Creates a function for `_.mapKeys` or `_.mapValues`. + * + * @private + * @param {boolean} [isMapKeys] Specify mapping keys instead of values. + * @returns {Function} Returns the new map function. + */ + function createObjectMapper(isMapKeys) { + return function(object, iteratee, thisArg) { + var result = {}; + iteratee = getCallback(iteratee, thisArg, 3); + + baseForOwn(object, function(value, key, object) { + var mapped = iteratee(value, key, object); + key = isMapKeys ? mapped : key; + value = isMapKeys ? value : mapped; + result[key] = value; + }); + return result; + }; + } + + /** + * Creates a function for `_.padLeft` or `_.padRight`. + * + * @private + * @param {boolean} [fromRight] Specify padding from the right. + * @returns {Function} Returns the new pad function. + */ + function createPadDir(fromRight) { + return function(string, length, chars) { + string = baseToString(string); + return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); + }; + } + + /** + * Creates a `_.partial` or `_.partialRight` function. + * + * @private + * @param {boolean} flag The partial bit flag. + * @returns {Function} Returns the new partial function. + */ + function createPartial(flag) { + var partialFunc = restParam(function(func, partials) { + var holders = replaceHolders(partials, partialFunc.placeholder); + return createWrapper(func, flag, undefined, partials, holders); + }); + return partialFunc; + } + + /** + * Creates a function for `_.reduce` or `_.reduceRight`. + * + * @private + * @param {Function} arrayFunc The function to iterate over an array. + * @param {Function} eachFunc The function to iterate over a collection. + * @returns {Function} Returns the new each function. + */ + function createReduce(arrayFunc, eachFunc) { + return function(collection, iteratee, accumulator, thisArg) { + var initFromArray = arguments.length < 3; + return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) + ? arrayFunc(collection, iteratee, accumulator, initFromArray) + : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc); + }; + } + + /** + * Creates a function that wraps `func` and invokes it with optional `this` + * binding of, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & ARY_FLAG, + isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurry = bitmask & CURRY_FLAG, + isCurryBound = bitmask & CURRY_BOUND_FLAG, + isCurryRight = bitmask & CURRY_RIGHT_FLAG, + Ctor = isBindKey ? undefined : createCtorWrapper(func); + + function wrapper() { + // Avoid `arguments` object use disqualifying optimizations by + // converting it to an array before providing it to other functions. + var length = arguments.length, + index = length, + args = Array(length); + + while (index--) { + args[index] = arguments[index]; + } + if (partials) { + args = composeArgs(args, partials, holders); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight); + } + if (isCurry || isCurryRight) { + var placeholder = wrapper.placeholder, + argsHolders = replaceHolders(args, placeholder); + + length -= argsHolders.length; + if (length < arity) { + var newArgPos = argPos ? arrayCopy(argPos) : undefined, + newArity = nativeMax(arity - length, 0), + newsHolders = isCurry ? argsHolders : undefined, + newHoldersRight = isCurry ? undefined : argsHolders, + newPartials = isCurry ? args : undefined, + newPartialsRight = isCurry ? undefined : args; + + bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); + + if (!isCurryBound) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); + } + var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity], + result = createHybridWrapper.apply(undefined, newData); + + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return result; + } + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + if (argPos) { + args = reorder(args, argPos); + } + if (isAry && ary < args.length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtorWrapper(func); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates the padding required for `string` based on the given `length`. + * The `chars` string is truncated if the number of characters exceeds `length`. + * + * @private + * @param {string} string The string to create padding for. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the pad for `string`. + */ + function createPadding(string, length, chars) { + var strLength = string.length; + length = +length; + + if (strLength >= length || !nativeIsFinite(length)) { + return ''; + } + var padLength = length - strLength; + chars = chars == null ? ' ' : (chars + ''); + return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength); + } + + /** + * Creates a function that wraps `func` and invokes it with the optional `this` + * binding of `thisArg` and the `partials` prepended to those provided to + * the wrapper. + * + * @private + * @param {Function} func The function to partially apply arguments to. + * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to the new function. + * @returns {Function} Returns the new bound function. + */ + function createPartialWrapper(func, bitmask, thisArg, partials) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + // Avoid `arguments` object use disqualifying optimizations by + // converting it to an array before providing it `func`. + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength); + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.ceil`, `_.floor`, or `_.round` function. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + precision = precision === undefined ? 0 : (+precision || 0); + if (precision) { + precision = pow(10, precision); + return func(number * precision) / precision; + } + return func(number); + }; + } + + /** + * Creates a `_.sortedIndex` or `_.sortedLastIndex` function. + * + * @private + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {Function} Returns the new index function. + */ + function createSortedIndex(retHighest) { + return function(array, value, iteratee, thisArg) { + var callback = getCallback(iteratee); + return (iteratee == null && callback === baseCallback) + ? binaryIndex(array, value, retHighest) + : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of flags. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + length -= (holders ? holders.length : 0); + if (bitmask & PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func), + newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; + + if (data) { + mergeData(newData, data); + bitmask = newData[1]; + arity = newData[9]; + } + newData[9] = arity == null + ? (isBindKey ? 0 : func.length) + : (nativeMax(arity - length, 0) || 0); + + if (bitmask == BIND_FLAG) { + var result = createBindWrapper(newData[0], newData[2]); + } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { + result = createPartialWrapper.apply(undefined, newData); + } else { + result = createHybridWrapper.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setter(result, newData); + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing arrays. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { + var index = -1, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isLoose && othLength > arrLength)) { + return false; + } + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index], + result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; + + if (result !== undefined) { + if (result) { + continue; + } + return false; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isLoose) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); + })) { + return false; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { + return false; + } + } + return true; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag) { + switch (tag) { + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) + ? other != +other + : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings primitives and string + // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. + return object == (other + ''); + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isLoose) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var skipCtor = isLoose; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key], + result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; + + // Recursively compare objects (susceptible to call stack limits). + if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { + return false; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (!skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + return false; + } + } + return true; + } + + /** + * Gets the appropriate "callback" function. If the `_.callback` method is + * customized this function returns the custom method, otherwise it returns + * the `baseCallback` function. If arguments are provided the chosen function + * is invoked with them and its result is returned. + * + * @private + * @returns {Function} Returns the chosen function or its result. + */ + function getCallback(func, thisArg, argCount) { + var result = lodash.callback || callback; + result = result === callback ? baseCallback : result; + return argCount ? result(func, thisArg, argCount) : result; + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = array ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the appropriate "indexOf" function. If the `_.indexOf` method is + * customized this function returns the custom method, otherwise it returns + * the `baseIndexOf` function. If arguments are provided the chosen function + * is invoked with them and its result is returned. + * + * @private + * @returns {Function|number} Returns the chosen function or its result. + */ + function getIndexOf(collection, target, fromIndex) { + var result = lodash.indexOf || indexOf; + result = result === indexOf ? baseIndexOf : result; + return collection ? result(collection, target, fromIndex) : result; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Gets the propery names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = pairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add array properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + var Ctor = object.constructor; + if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { + Ctor = Object; + } + return new Ctor; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return bufferClone(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + // Safari 5 mobile incorrectly has `Object` as the constructor of typed arrays. + if (Ctor instanceof Ctor) { + Ctor = ctorByTag[tag]; + } + var buffer = object.buffer; + return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + var result = new Ctor(object.source, reFlags.exec(object)); + result.lastIndex = object.lastIndex; + } + return result; + } + + /** + * Invokes the method at `path` on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function invokePath(object, path, args) { + if (object != null && !isKey(path, object)) { + path = toPath(path); + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + path = last(path); + } + var func = object == null ? object : object[path]; + return func == null ? undefined : func.apply(object, args); + } + + /** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Checks if the provided arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + var other = object[index]; + return value === value ? (value === other) : (other !== other); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers required to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` + * augment function arguments, making the order in which they are executed important, + * preventing the merging of metadata. However, we make an exception for a safe + * common case where curried functions have `_.ary` and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < ARY_FLAG; + + var isCombo = + (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) || + (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) || + (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = arrayCopy(value); + } + // Use source `ary` if it's smaller. + if (srcBitmask & ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use. + * + * @private + * @param {*} objectValue The destination object property value. + * @param {*} sourceValue The source object property value. + * @returns {*} Returns the value to assign to the destination object. + */ + function mergeDefaults(objectValue, sourceValue) { + return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults); + } + + /** + * A specialized version of `_.pick` which picks `object` properties specified + * by `props`. + * + * @private + * @param {Object} object The source object. + * @param {string[]} props The property names to pick. + * @returns {Object} Returns the new object. + */ + function pickByArray(object, props) { + object = toObject(object); + + var index = -1, + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + return result; + } + + /** + * A specialized version of `_.pick` which picks `object` properties `predicate` + * returns truthy for. + * + * @private + * @param {Object} object The source object. + * @param {Function} predicate The function invoked per iteration. + * @returns {Object} Returns the new object. + */ + function pickByCallback(object, predicate) { + var result = {}; + baseForIn(object, function(value, key, object) { + if (predicate(value, key, object)) { + result[key] = value; + } + }); + return result; + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = arrayCopy(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity function + * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = (function() { + var count = 0, + lastCalled = 0; + + return function(key, value) { + var stamp = now(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return key; + } + } else { + count = 0; + } + return baseSetData(key, value); + }; + }()); + + /** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object) || isString(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to an array-like object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Array|Object} Returns the array-like object. + */ + function toIterable(value) { + if (value == null) { + return []; + } + if (!isArrayLike(value)) { + return values(value); + } + if (lodash.support.unindexedChars && isString(value)) { + return value.split(''); + } + return isObject(value) ? value : Object(value); + } + + /** + * Converts `value` to an object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ + function toObject(value) { + if (lodash.support.unindexedChars && isString(value)) { + var index = -1, + length = value.length, + result = Object(value); + + while (++index < length) { + result[index] = value.charAt(index); + } + return result; + } + return isObject(value) ? value : Object(value); + } + + /** + * Converts `value` to property path array if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Array} Returns the property path array. + */ + function toPath(value) { + if (isArray(value)) { + return value; + } + var result = []; + baseToString(value).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + return wrapper instanceof LazyWrapper + ? wrapper.clone() + : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `collection` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the new array containing chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if (guard ? isIterateeCall(array, size, guard) : size == null) { + size = 1; + } else { + size = nativeMax(nativeFloor(size) || 1, 1); + } + var index = 0, + length = array ? array.length : 0, + resIndex = -1, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[++resIndex] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + resIndex = -1, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[++resIndex] = value; + } + } + return result; + } + + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The arrays of values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.difference([1, 2, 3], [4, 2]); + * // => [1, 3] + */ + var difference = restParam(function(array, values) { + return (isObjectLike(array) && isArrayLike(array)) + ? baseDifference(array, baseFlatten(values, false, true)) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (guard ? isIterateeCall(array, n, guard) : n == null) { + n = 1; + } + return baseSlice(array, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (guard ? isIterateeCall(array, n, guard) : n == null) { + n = 1; + } + n = length - (+n || 0); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * bound to `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that match the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRightWhile([1, 2, 3], function(n) { + * return n > 1; + * }); + * // => [1] + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); + * // => ['barney', 'fred'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); + * // => ['barney'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.dropRightWhile(users, 'active'), 'user'); + * // => ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate, thisArg) { + return (array && array.length) + ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * bound to `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropWhile([1, 2, 3], function(n) { + * return n < 3; + * }); + * // => [3] + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); + * // => ['fred', 'pebbles'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.dropWhile(users, 'active', false), 'user'); + * // => ['pebbles'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.dropWhile(users, 'active'), 'user'); + * // => ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate, thisArg) { + return (array && array.length) + ? baseWhile(array, getCallback(predicate, thisArg, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8], '*', 1, 2); + * // => [4, '*', 8] + */ + function fill(array, value, start, end) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(chr) { + * return chr.user == 'barney'; + * }); + * // => 0 + * + * // using the `_.matches` callback shorthand + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // using the `_.matchesProperty` callback shorthand + * _.findIndex(users, 'active', false); + * // => 0 + * + * // using the `_.property` callback shorthand + * _.findIndex(users, 'active'); + * // => 2 + */ + var findIndex = createFindIndex(); + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(chr) { + * return chr.user == 'pebbles'; + * }); + * // => 2 + * + * // using the `_.matches` callback shorthand + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // using the `_.matchesProperty` callback shorthand + * _.findLastIndex(users, 'active', false); + * // => 2 + * + * // using the `_.property` callback shorthand + * _.findLastIndex(users, 'active'); + * // => 0 + */ + var findLastIndex = createFindIndex(true); + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @alias head + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([]); + * // => undefined + */ + function first(array) { + return array ? array[0] : undefined; + } + + /** + * Flattens a nested array. If `isDeep` is `true` the array is recursively + * flattened, otherwise it's only flattened a single level. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to flatten. + * @param {boolean} [isDeep] Specify a deep flatten. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, 3, [4]]]); + * // => [1, 2, 3, [4]] + * + * // using `isDeep` + * _.flatten([1, [2, 3, [4]]], true); + * // => [1, 2, 3, 4] + */ + function flatten(array, isDeep, guard) { + var length = array ? array.length : 0; + if (guard && isIterateeCall(array, isDeep, guard)) { + isDeep = false; + } + return length ? baseFlatten(array, isDeep) : []; + } + + /** + * Recursively flattens a nested array. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to recursively flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, 3, [4]]]); + * // => [1, 2, 3, 4] + */ + function flattenDeep(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, true) : []; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the offset + * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` + * performs a faster binary search. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=0] The index to search from or `true` + * to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // using `fromIndex` + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + * + * // performing a binary search + * _.indexOf([1, 1, 2, 2], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; + } else if (fromIndex) { + var index = binaryIndex(array, value); + if (index < length && + (value === value ? (value === array[index]) : (array[index] !== array[index]))) { + return index; + } + return -1; + } + return baseIndexOf(array, value, fromIndex || 0); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + return dropRight(array, 1); + } + + /** + * Creates an array of unique values that are included in all of the provided + * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of shared values. + * @example + * _.intersection([1, 2], [4, 2], [2, 1]); + * // => [2] + */ + var intersection = restParam(function(arrays) { + var othLength = arrays.length, + othIndex = othLength, + caches = Array(length), + indexOf = getIndexOf(), + isCommon = indexOf === baseIndexOf, + result = []; + + while (othIndex--) { + var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; + caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; + } + var array = arrays[0], + index = -1, + length = array ? array.length : 0, + seen = caches[0]; + + outer: + while (++index < length) { + value = array[index]; + if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { + var othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { + continue outer; + } + } + if (seen) { + seen.push(value); + } + result.push(value); + } + } + return result; + }); + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=array.length-1] The index to search from + * or `true` to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // using `fromIndex` + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + * + * // performing a binary search + * _.lastIndexOf([1, 1, 2, 2], 2, true); + * // => 3 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + var index = length; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; + } else if (fromIndex) { + index = binaryIndex(array, value, true) - 1; + var other = array[index]; + if (value === value ? (value === other) : (other !== other)) { + return index; + } + return -1; + } + if (value !== value) { + return indexOfNaN(array, index, true); + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Removes all provided values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */ + function pull() { + var args = arguments, + array = args[0]; + + if (!(array && array.length)) { + return array; + } + var index = 0, + indexOf = getIndexOf(), + length = args.length; + + while (++index < length) { + var fromIndex = 0, + value = args[index]; + + while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * Removes elements from `array` corresponding to the given indexes and returns + * an array of the removed elements. Indexes may be specified as an array of + * indexes or as individual arguments. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove, + * specified as individual indexes or arrays of indexes. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [5, 10, 15, 20]; + * var evens = _.pullAt(array, 1, 3); + * + * console.log(array); + * // => [5, 15] + * + * console.log(evens); + * // => [10, 20] + */ + var pullAt = restParam(function(array, indexes) { + indexes = baseFlatten(indexes); + + var result = baseAt(array, indexes); + basePullAt(array, indexes.sort(baseCompareAscending)); + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is bound to + * `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * **Note:** Unlike `_.filter`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate, thisArg) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getCallback(predicate, thisArg, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @alias tail + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + */ + function rest(array) { + return drop(array, 1); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of `Array#slice` to support node + * lists in IE < 9 and to ensure dense arrays are returned. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. If an iteratee + * function is provided it's invoked for `value` and each element of `array` + * to compute their sort ranking. The iteratee is bound to `thisArg` and + * invoked with one argument; (value). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 4, 5, 5], 5); + * // => 2 + * + * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; + * + * // using an iteratee function + * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { + * return this.data[word]; + * }, dict); + * // => 1 + * + * // using the `_.property` callback shorthand + * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 1 + */ + var sortedIndex = createSortedIndex(); + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 4, 5, 5], 5); + * // => 4 + */ + var sortedLastIndex = createSortedIndex(true); + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (guard ? isIterateeCall(array, n, guard) : n == null) { + n = 1; + } + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (guard ? isIterateeCall(array, n, guard) : n == null) { + n = 1; + } + n = length - (+n || 0); + return baseSlice(array, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is bound to `thisArg` + * and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRightWhile([1, 2, 3], function(n) { + * return n > 1; + * }); + * // => [2, 3] + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); + * // => ['pebbles'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); + * // => ['fred', 'pebbles'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.takeRightWhile(users, 'active'), 'user'); + * // => [] + */ + function takeRightWhile(array, predicate, thisArg) { + return (array && array.length) + ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is bound to + * `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeWhile([1, 2, 3], function(n) { + * return n < 3; + * }); + * // => [1, 2] + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false}, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); + * // => ['barney'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.takeWhile(users, 'active', false), 'user'); + * // => ['barney', 'fred'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.takeWhile(users, 'active'), 'user'); + * // => [] + */ + function takeWhile(array, predicate, thisArg) { + return (array && array.length) + ? baseWhile(array, getCallback(predicate, thisArg, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all of the provided arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([1, 2], [4, 2], [2, 1]); + * // => [1, 2, 4] + */ + var union = restParam(function(arrays) { + return baseUniq(baseFlatten(arrays, false, true)); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurence of each element + * is kept. Providing `true` for `isSorted` performs a faster search algorithm + * for sorted arrays. If an iteratee function is provided it's invoked for + * each element in the array to generate the criterion by which uniqueness + * is computed. The `iteratee` is bound to `thisArg` and invoked with three + * arguments: (value, index, array). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Array + * @param {Array} array The array to inspect. + * @param {boolean} [isSorted] Specify the array is sorted. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new duplicate-value-free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + * + * // using `isSorted` + * _.uniq([1, 1, 2], true); + * // => [1, 2] + * + * // using an iteratee function + * _.uniq([1, 2.5, 1.5, 2], function(n) { + * return this.floor(n); + * }, Math); + * // => [1, 2.5] + * + * // using the `_.property` callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, iteratee, thisArg) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (isSorted != null && typeof isSorted != 'boolean') { + thisArg = iteratee; + iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted; + isSorted = false; + } + var callback = getCallback(); + if (!(iteratee == null && callback === baseCallback)) { + iteratee = callback(iteratee, thisArg, 3); + } + return (isSorted && getIndexOf() === baseIndexOf) + ? sortedUniq(array, iteratee) + : baseUniq(array, iteratee); + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + * + * _.unzip(zipped); + * // => [['fred', 'barney'], [30, 40], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var index = -1, + length = 0; + + array = arrayFilter(array, function(group) { + if (isArrayLike(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + var result = Array(length); + while (++index < length) { + result[index] = arrayMap(array, baseProperty(index)); + } + return result; + } + + /** + * This method is like `_.unzip` except that it accepts an iteratee to specify + * how regrouped values should be combined. The `iteratee` is bound to `thisArg` + * and invoked with four arguments: (accumulator, value, index, group). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee] The function to combine regrouped values. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee, thisArg) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + iteratee = bindCallback(iteratee, thisArg, 4); + return arrayMap(result, function(group) { + return arrayReduce(group, iteratee, undefined, true); + }); + } + + /** + * Creates an array excluding all provided values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to filter. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.without([1, 2, 1, 3], 1, 2); + * // => [3] + */ + var without = restParam(function(array, values) { + return isArrayLike(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the provided arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xor([1, 2], [4, 2]); + * // => [1, 4] + */ + function xor() { + var index = -1, + length = arguments.length; + + while (++index < length) { + var array = arguments[index]; + if (isArrayLike(array)) { + var result = result + ? arrayPush(baseDifference(result, array), baseDifference(array, result)) + : array; + } + } + return result ? baseUniq(result) : []; + } + + /** + * Creates an array of grouped elements, the first of which contains the first + * elements of the given arrays, the second of which contains the second elements + * of the given arrays, and so on. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + */ + var zip = restParam(unzip); + + /** + * The inverse of `_.pairs`; this method returns an object composed from arrays + * of property names and values. Provide either a single two dimensional array, + * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names + * and one of corresponding values. + * + * @static + * @memberOf _ + * @alias object + * @category Array + * @param {Array} props The property names. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + * + * _.zipObject(['fred', 'barney'], [30, 40]); + * // => { 'fred': 30, 'barney': 40 } + */ + function zipObject(props, values) { + var index = -1, + length = props ? props.length : 0, + result = {}; + + if (length && !values && !isArray(props[0])) { + values = []; + } + while (++index < length) { + var key = props[index]; + if (values) { + result[key] = values[index]; + } else if (key) { + result[key[0]] = key[1]; + } + } + return result; + } + + /** + * This method is like `_.zip` except that it accepts an iteratee to specify + * how grouped values should be combined. The `iteratee` is bound to `thisArg` + * and invoked with four arguments: (accumulator, value, index, group). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee] The function to combine grouped values. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], _.add); + * // => [111, 222] + */ + var zipWith = restParam(function(arrays) { + var length = arrays.length, + iteratee = length > 2 ? arrays[length - 2] : undefined, + thisArg = length > 1 ? arrays[length - 1] : undefined; + + if (length > 2 && typeof iteratee == 'function') { + length -= 2; + } else { + iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; + thisArg = undefined; + } + arrays.length = length; + return unzipWith(arrays, iteratee, thisArg); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object that wraps `value` with explicit method + * chaining enabled. + * + * @static + * @memberOf _ + * @category Chain + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _.chain(users) + * .sortBy('age') + * .map(function(chr) { + * return chr.user + ' is ' + chr.age; + * }) + * .first() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor is + * bound to `thisArg` and invoked with one argument; (value). The purpose of + * this method is to "tap into" a method chain in order to perform operations + * on intermediate results within the chain. + * + * @static + * @memberOf _ + * @category Chain + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @param {*} [thisArg] The `this` binding of `interceptor`. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor, thisArg) { + interceptor.call(thisArg, value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * + * @static + * @memberOf _ + * @category Chain + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @param {*} [thisArg] The `this` binding of `interceptor`. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor, thisArg) { + return interceptor.call(thisArg, value); + } + + /** + * Enables explicit method chaining on the wrapper object. + * + * @name chain + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // without explicit chaining + * _(users).first(); + * // => { 'user': 'barney', 'age': 36 } + * + * // with explicit chaining + * _(users).chain() + * .first() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chained sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Creates a new array joining a wrapped array with any additional arrays + * and/or values. + * + * @name concat + * @memberOf _ + * @category Chain + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var wrapped = _(array).concat(2, [3], [[4]]); + * + * console.log(wrapped.value()); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + var wrapperConcat = restParam(function(values) { + values = baseFlatten(values); + return this.thru(function(array) { + return arrayConcat(isArray(array) ? array : [toObject(array)], values); + }); + }); + + /** + * Creates a clone of the chained sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).map(function(value) { + * return Math.pow(value, 2); + * }); + * + * var other = [3, 4]; + * var otherWrapped = wrapped.plant(other); + * + * otherWrapped.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * Reverses the wrapped array so the first element becomes the last, the + * second element becomes the second to last, and so on. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new reversed `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + + var interceptor = function(value) { + return value.reverse(); + }; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(interceptor); + } + + /** + * Produces the result of coercing the unwrapped value to a string. + * + * @name toString + * @memberOf _ + * @category Chain + * @returns {string} Returns the coerced string value. + * @example + * + * _([1, 2, 3]).toString(); + * // => '1,2,3' + */ + function wrapperToString() { + return (this.value() + ''); + } + + /** + * Executes the chained sequence to extract the unwrapped value. + * + * @name value + * @memberOf _ + * @alias run, toJSON, valueOf + * @category Chain + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements corresponding to the given keys, or indexes, + * of `collection`. Keys may be specified as individual arguments or as arrays + * of keys. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(number|number[]|string|string[])} [props] The property names + * or indexes of elements to pick, specified individually or in arrays. + * @returns {Array} Returns the new array of picked elements. + * @example + * + * _.at(['a', 'b', 'c'], [0, 2]); + * // => ['a', 'c'] + * + * _.at(['barney', 'fred', 'pebbles'], 0, 2); + * // => ['barney', 'pebbles'] + */ + var at = restParam(function(collection, props) { + if (isArrayLike(collection)) { + collection = toIterable(collection); + } + return baseAt(collection, baseFlatten(props)); + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through `iteratee`. The corresponding value + * of each key is the number of times the key was returned by `iteratee`. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(n) { + * return Math.floor(n); + * }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(n) { + * return this.floor(n); + * }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * The predicate is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // using the `_.matchesProperty` callback shorthand + * _.every(users, 'active', false); + * // => true + * + * // using the `_.property` callback shorthand + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, thisArg) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (thisArg && isIterateeCall(collection, predicate, thisArg)) { + predicate = undefined; + } + if (typeof predicate != 'function' || thisArg !== undefined) { + predicate = getCallback(predicate, thisArg, 3); + } + return func(collection, predicate); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is bound to `thisArg` and + * invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the new filtered array. + * @example + * + * _.filter([4, 5, 6], function(n) { + * return n % 2 == 0; + * }); + * // => [4, 6] + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); + * // => ['barney'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.filter(users, 'active', false), 'user'); + * // => ['fred'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.filter(users, 'active'), 'user'); + * // => ['barney'] + */ + function filter(collection, predicate, thisArg) { + var func = isArray(collection) ? arrayFilter : baseFilter; + predicate = getCallback(predicate, thisArg, 3); + return func(collection, predicate); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is bound to `thisArg` and + * invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias detect + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.result(_.find(users, function(chr) { + * return chr.age < 40; + * }), 'user'); + * // => 'barney' + * + * // using the `_.matches` callback shorthand + * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); + * // => 'pebbles' + * + * // using the `_.matchesProperty` callback shorthand + * _.result(_.find(users, 'active', false), 'user'); + * // => 'fred' + * + * // using the `_.property` callback shorthand + * _.result(_.find(users, 'active'), 'user'); + * // => 'barney' + */ + var find = createFind(baseEach); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(baseEachRight, true); + + /** + * Performs a deep comparison between each element in `collection` and the + * source object, returning the first element that has equivalent property + * values. + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Object} source The object of property values to match. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); + * // => 'barney' + * + * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); + * // => 'fred' + */ + function findWhere(collection, source) { + return find(collection, baseMatches(source)); + } + + /** + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). Iteratee functions may exit iteration early + * by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" property + * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` + * may be used for object iteration. + * + * @static + * @memberOf _ + * @alias each + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2]).forEach(function(n) { + * console.log(n); + * }).value(); + * // => logs each value from left to right and returns the array + * + * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { + * console.log(n, key); + * }); + * // => logs each value-key pair and returns the object (iteration order is not guaranteed) + */ + var forEach = createForEach(arrayEach, baseEach); + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @alias eachRight + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2]).forEachRight(function(n) { + * console.log(n); + * }).value(); + * // => logs each value from right to left and returns the array + */ + var forEachRight = createForEach(arrayEachRight, baseEachRight); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through `iteratee`. The corresponding value + * of each key is an array of the elements responsible for generating the key. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(n) { + * return Math.floor(n); + * }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(n) { + * return this.floor(n); + * }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using the `_.property` callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + result[key] = [value]; + } + }); + + /** + * Checks if `target` is in `collection` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the offset + * from the end of `collection`. + * + * @static + * @memberOf _ + * @alias contains, include + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {*} target The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. + * @returns {boolean} Returns `true` if a matching element is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.includes('pebbles', 'eb'); + * // => true + */ + function includes(collection, target, fromIndex, guard) { + var length = collection ? getLength(collection) : 0; + if (!isLength(length)) { + collection = values(collection); + length = collection.length; + } + if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { + fromIndex = 0; + } else { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); + } + return (typeof collection == 'string' || !isArray(collection) && isString(collection)) + ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) + : (!!length && getIndexOf(collection, target, fromIndex) > -1); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through `iteratee`. The corresponding value + * of each key is the last element responsible for generating the key. The + * iteratee function is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var keyData = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.indexBy(keyData, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keyData, function(object) { + * return String.fromCharCode(object.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keyData, function(object) { + * return this.fromCharCode(object.code); + * }, String); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + */ + var indexBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `methodName` is a function it's + * invoked for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invoke = restParam(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + isProp = isKey(path), + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); + result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); + }); + return result; + }); + + /** + * Creates an array of values by running each element in `collection` through + * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three + * arguments: (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, + * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, + * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, + * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, + * `sum`, `uniq`, and `words` + * + * @static + * @memberOf _ + * @alias collect + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new mapped array. + * @example + * + * function timesThree(n) { + * return n * 3; + * } + * + * _.map([1, 2], timesThree); + * // => [3, 6] + * + * _.map({ 'a': 1, 'b': 2 }, timesThree); + * // => [3, 6] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // using the `_.property` callback shorthand + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee, thisArg) { + var func = isArray(collection) ? arrayMap : baseMap; + iteratee = getCallback(iteratee, thisArg, 3); + return func(collection, iteratee); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, while the second of which + * contains elements `predicate` returns falsey for. The predicate is bound + * to `thisArg` and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * _.partition([1, 2, 3], function(n) { + * return n % 2; + * }); + * // => [[1, 3], [2]] + * + * _.partition([1.2, 2.3, 3.4], function(n) { + * return this.floor(n) % 2; + * }, Math); + * // => [[1.2, 3.4], [2.3]] + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * var mapper = function(array) { + * return _.pluck(array, 'user'); + * }; + * + * // using the `_.matches` callback shorthand + * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); + * // => [['pebbles'], ['barney', 'fred']] + * + * // using the `_.matchesProperty` callback shorthand + * _.map(_.partition(users, 'active', false), mapper); + * // => [['barney', 'pebbles'], ['fred']] + * + * // using the `_.property` callback shorthand + * _.map(_.partition(users, 'active'), mapper); + * // => [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Gets the property value of `path` from all elements in `collection`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|string} path The path of the property to pluck. + * @returns {Array} Returns the property values. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * _.pluck(users, 'user'); + * // => ['barney', 'fred'] + * + * var userIndex = _.indexBy(users, 'user'); + * _.pluck(userIndex, 'age'); + * // => [36, 40] (iteration order is not guaranteed) + */ + function pluck(collection, path) { + return map(collection, property(path)); + } + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` through `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not provided the first element of `collection` is used as the initial + * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`, + * and `sortByOrder` + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {*} Returns the accumulated value. + * @example + * + * _.reduce([1, 2], function(total, n) { + * return total + n; + * }); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { + * result[key] = n * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) + */ + var reduce = createReduce(arrayReduce, baseEach); + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {*} Returns the accumulated value. + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + var reduceRight = createReduce(arrayReduceRight, baseEachRight); + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the new filtered array. + * @example + * + * _.reject([1, 2, 3, 4], function(n) { + * return n % 2 == 0; + * }); + * // => [1, 3] + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); + * // => ['barney'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.reject(users, 'active', false), 'user'); + * // => ['fred'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.reject(users, 'active'), 'user'); + * // => ['barney'] + */ + function reject(collection, predicate, thisArg) { + var func = isArray(collection) ? arrayFilter : baseFilter; + predicate = getCallback(predicate, thisArg, 3); + return func(collection, function(value, index, collection) { + return !predicate(value, index, collection); + }); + } + + /** + * Gets a random element or `n` random elements from a collection. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to sample. + * @param {number} [n] The number of elements to sample. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {*} Returns the random sample(s). + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + * + * _.sample([1, 2, 3, 4], 2); + * // => [3, 1] + */ + function sample(collection, n, guard) { + if (guard ? isIterateeCall(collection, n, guard) : n == null) { + collection = toIterable(collection); + var length = collection.length; + return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; + } + var index = -1, + result = toArray(collection), + length = result.length, + lastIndex = length - 1; + + n = nativeMin(n < 0 ? 0 : (+n || 0), length); + while (++index < n) { + var rand = baseRandom(index, lastIndex), + value = result[rand]; + + result[rand] = result[index]; + result[index] = value; + } + result.length = n; + return result; + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + return sample(collection, POSITIVE_INFINITY); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the size of `collection`. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + var length = collection ? getLength(collection) : 0; + return isLength(length) ? length : keys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * The function returns as soon as it finds a passing value and does not iterate + * over the entire collection. The predicate is bound to `thisArg` and invoked + * with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // using the `_.matchesProperty` callback shorthand + * _.some(users, 'active', false); + * // => true + * + * // using the `_.property` callback shorthand + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, thisArg) { + var func = isArray(collection) ? arraySome : baseSome; + if (thisArg && isIterateeCall(collection, predicate, thisArg)) { + predicate = undefined; + } + if (typeof predicate != 'function' || thisArg !== undefined) { + predicate = getCallback(predicate, thisArg, 3); + } + return func(collection, predicate); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through `iteratee`. This method performs + * a stable sort, that is, it preserves the original sort order of equal elements. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new sorted array. + * @example + * + * _.sortBy([1, 2, 3], function(n) { + * return Math.sin(n); + * }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(n) { + * return this.sin(n); + * }, Math); + * // => [3, 1, 2] + * + * var users = [ + * { 'user': 'fred' }, + * { 'user': 'pebbles' }, + * { 'user': 'barney' } + * ]; + * + * // using the `_.property` callback shorthand + * _.pluck(_.sortBy(users, 'user'), 'user'); + * // => ['barney', 'fred', 'pebbles'] + */ + function sortBy(collection, iteratee, thisArg) { + if (collection == null) { + return []; + } + if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { + iteratee = undefined; + } + var index = -1; + iteratee = getCallback(iteratee, thisArg, 3); + + var result = baseMap(collection, function(value, key, collection) { + return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; + }); + return baseSortBy(result, compareAscending); + } + + /** + * This method is like `_.sortBy` except that it can sort by multiple iteratees + * or property names. + * + * If a property name is provided for an iteratee the created `_.property` + * style callback returns the property value of the given element. + * + * If an object is provided for an iteratee the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees + * The iteratees to sort by, specified as individual values or arrays of values. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.map(_.sortByAll(users, ['user', 'age']), _.values); + * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * + * _.map(_.sortByAll(users, 'user', function(chr) { + * return Math.floor(chr.age / 10); + * }), _.values); + * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + var sortByAll = restParam(function(collection, iteratees) { + if (collection == null) { + return []; + } + var guard = iteratees[2]; + if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { + iteratees.length = 1; + } + return baseSortByOrder(collection, baseFlatten(iteratees), []); + }); + + /** + * This method is like `_.sortByAll` except that it allows specifying the + * sort orders of the iteratees to sort by. If `orders` is unspecified, all + * values are sorted in ascending order. Otherwise, a value is sorted in + * ascending order if its corresponding order is "asc", and descending if "desc". + * + * If a property name is provided for an iteratee the created `_.property` + * style callback returns the property value of the given element. + * + * If an object is provided for an iteratee the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {boolean[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // sort by `user` in ascending order and by `age` in descending order + * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); + * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + function sortByOrder(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (guard && isIterateeCall(iteratees, orders, guard)) { + orders = undefined; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseSortByOrder(collection, iteratees, orders); + } + + /** + * Performs a deep comparison between each element in `collection` and the + * source object, returning an array of all elements that have equivalent + * property values. + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Object} source The object of property values to match. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, + * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } + * ]; + * + * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); + * // => ['barney'] + * + * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); + * // => ['fred'] + */ + function where(collection, source) { + return filter(collection, baseMatches(source)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch + * (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @category Date + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => logs the number of milliseconds it took for the deferred function to be invoked + */ + var now = nativeNow || function() { + return new Date().getTime(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => logs 'done saving!' after the two async saves have completed + */ + function after(n, func) { + if (typeof func != 'function') { + if (typeof n == 'function') { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } + } + n = nativeIsFinite(n = +n) ? n : 0; + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that accepts up to `n` arguments ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + if (guard && isIterateeCall(func, n, guard)) { + n = undefined; + } + n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); + return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery('#add').on('click', _.before(5, addContactToList)); + * // => allows adding up to 4 contacts to the list + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + if (typeof n == 'function') { + var temp = n; + n = func; + func = temp; + } else { + throw new TypeError(FUNC_ERROR_TEXT); + } + } + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and prepends any additional `_.bind` arguments to those provided to the + * bound function. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind` this method does not set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var greet = function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * }; + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // using placeholders + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = restParam(function(func, thisArg, partials) { + var bitmask = BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, bind.placeholder); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(func, bitmask, thisArg, partials, holders); + }); + + /** + * Binds methods of an object to the object itself, overwriting the existing + * method. Method names may be specified as individual arguments or as arrays + * of method names. If no method names are provided all enumerable function + * properties, own and inherited, of `object` are bound. + * + * **Note:** This method does not set the "length" property of bound functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} [methodNames] The object method names to bind, + * specified as individual method names or arrays of method names. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => logs 'clicked docs' when the element is clicked + */ + var bindAll = restParam(function(object, methodNames) { + methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); + + var index = -1, + length = methodNames.length; + + while (++index < length) { + var key = methodNames[index]; + object[key] = createWrapper(object[key], BIND_FLAG, object); + } + return object; + }); + + /** + * Creates a function that invokes the method at `object[key]` and prepends + * any additional `_.bindKey` arguments to those provided to the bound function. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. + * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @category Function + * @param {Object} object The object the method belongs to. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // using placeholders + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = restParam(function(object, key, partials) { + var bitmask = BIND_FLAG | BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, bindKey.placeholder); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts one or more arguments of `func` that when + * called either invokes `func` returning its result, if all `func` arguments + * have been provided, or returns a function that accepts one or more of the + * remaining `func` arguments, and so on. The arity of `func` may be specified + * if `func.length` is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method does not set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // using placeholders + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + var curry = createCurry(CURRY_FLAG); + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method does not set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // using placeholders + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + var curryRight = createCurry(CURRY_RIGHT_FLAG); + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed invocations. Provide an options object to indicate that `func` + * should be invoked on the leading and/or trailing edge of the `wait` timeout. + * Subsequent calls to the debounced function return the result of the last + * `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify invoking on the leading + * edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be + * delayed before it's invoked. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing + * edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // avoid costly calculations while the window size is in flux + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // invoke `sendMail` when the click event is fired, debouncing subsequent calls + * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // ensure `batchLog` is invoked once after 1 second of debounced calls + * var source = new EventSource('/stream'); + * jQuery(source).on('message', _.debounce(batchLog, 250, { + * 'maxWait': 1000 + * })); + * + * // cancel a debounced call + * var todoChanges = _.debounce(batchLog, 1000); + * Object.observe(models.todo, todoChanges); + * + * Object.observe(models, function(changes) { + * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { + * todoChanges.cancel(); + * } + * }, ['delete']); + * + * // ...at some point `models.todo` is changed + * models.todo.completed = true; + * + * // ...before 1 second has passed `models.todo` is deleted + * // which cancels the debounced `todoChanges` call + * delete models.todo; + */ + function debounce(func, wait, options) { + var args, + maxTimeoutId, + result, + stamp, + thisArg, + timeoutId, + trailingCall, + lastCalled = 0, + maxWait = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = wait < 0 ? 0 : (+wait || 0); + if (options === true) { + var leading = true; + trailing = false; + } else if (isObject(options)) { + leading = !!options.leading; + maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function cancel() { + if (timeoutId) { + clearTimeout(timeoutId); + } + if (maxTimeoutId) { + clearTimeout(maxTimeoutId); + } + lastCalled = 0; + maxTimeoutId = timeoutId = trailingCall = undefined; + } + + function complete(isCalled, id) { + if (id) { + clearTimeout(id); + } + maxTimeoutId = timeoutId = trailingCall = undefined; + if (isCalled) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = undefined; + } + } + } + + function delayed() { + var remaining = wait - (now() - stamp); + if (remaining <= 0 || remaining > wait) { + complete(trailingCall, maxTimeoutId); + } else { + timeoutId = setTimeout(delayed, remaining); + } + } + + function maxDelayed() { + complete(trailing, timeoutId); + } + + function debounced() { + args = arguments; + stamp = now(); + thisArg = this; + trailingCall = trailing && (timeoutId || !leading); + + if (maxWait === false) { + var leadingCall = leading && !timeoutId; + } else { + if (!maxTimeoutId && !leading) { + lastCalled = stamp; + } + var remaining = maxWait - (stamp - lastCalled), + isCalled = remaining <= 0 || remaining > maxWait; + + if (isCalled) { + if (maxTimeoutId) { + maxTimeoutId = clearTimeout(maxTimeoutId); + } + lastCalled = stamp; + result = func.apply(thisArg, args); + } + else if (!maxTimeoutId) { + maxTimeoutId = setTimeout(maxDelayed, remaining); + } + } + if (isCalled && timeoutId) { + timeoutId = clearTimeout(timeoutId); + } + else if (!timeoutId && wait !== maxWait) { + timeoutId = setTimeout(delayed, wait); + } + if (leadingCall) { + isCalled = true; + result = func.apply(thisArg, args); + } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = undefined; + } + return result; + } + debounced.cancel = cancel; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // logs 'deferred' after one or more milliseconds + */ + var defer = restParam(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => logs 'later' after one second + */ + var delay = restParam(function(func, wait, args) { + return baseDelay(func, wait, args); + }); + + /** + * Creates a function that returns the result of invoking the provided + * functions with the `this` binding of the created function, where each + * successive invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @category Function + * @param {...Function} [funcs] Functions to invoke. + * @returns {Function} Returns the new function. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow(_.add, square); + * addSquare(1, 2); + * // => 9 + */ + var flow = createFlow(); + + /** + * This method is like `_.flow` except that it creates a function that + * invokes the provided functions from right to left. + * + * @static + * @memberOf _ + * @alias backflow, compose + * @category Function + * @param {...Function} [funcs] Functions to invoke. + * @returns {Function} Returns the new function. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight(square, _.add); + * addSquare(1, 2); + * // => 9 + */ + var flowRight = createFlow(true); + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is coerced to a string and used as the + * cache key. The `func` is invoked with the `this` binding of the memoized + * function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * method interface of `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var upperCase = _.memoize(function(string) { + * return string.toUpperCase(); + * }); + * + * upperCase('fred'); + * // => 'FRED' + * + * // modifying the result cache + * upperCase.cache.set('fred', 'BARNEY'); + * upperCase('fred'); + * // => 'BARNEY' + * + * // replacing `_.memoize.Cache` + * var object = { 'user': 'fred' }; + * var other = { 'user': 'barney' }; + * var identity = _.memoize(_.identity); + * + * identity(object); + * // => { 'user': 'fred' } + * identity(other); + * // => { 'user': 'fred' } + * + * _.memoize.Cache = WeakMap; + * var identity = _.memoize(_.identity); + * + * identity(object); + * // => { 'user': 'fred' } + * identity(other); + * // => { 'user': 'barney' } + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new memoize.Cache; + return memoized; + } + + /** + * Creates a function that runs each argument through a corresponding + * transform function. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms] The functions to transform + * arguments, specified as individual functions or arrays of functions. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var modded = _.modArgs(function(x, y) { + * return [x, y]; + * }, square, doubled); + * + * modded(1, 2); + * // => [1, 4] + * + * modded(5, 10); + * // => [25, 20] + */ + var modArgs = restParam(function(func, transforms) { + transforms = baseFlatten(transforms); + if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = transforms.length; + return restParam(function(args) { + var index = nativeMin(args.length, length); + while (index--) { + args[index] = transforms[index](args[index]); + } + return func.apply(this, args); + }); + }); + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + return !predicate.apply(this, arguments); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first call. The `func` is invoked + * with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` invokes `createApplication` once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with `partial` arguments prepended + * to those provided to the new function. This method is like `_.bind` except + * it does **not** alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method does not set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // using placeholders + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = createPartial(PARTIAL_FLAG); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to those provided to the new function. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method does not set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // using placeholders + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = createPartial(PARTIAL_RIGHT_FLAG); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified indexes where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes, + * specified as individual indexes or arrays of indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, 2, 0, 1); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + * + * var map = _.rearg(_.map, [1, 0]); + * map(function(n) { + * return n * 3; + * }, [1, 2, 3]); + * // => [3, 6, 9] + */ + var rearg = restParam(function(func, indexes) { + return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes)); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function restParam(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + rest = Array(length); + + while (++index < length) { + rest[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, rest); + case 1: return func.call(this, args[0], rest); + case 2: return func.call(this, args[0], args[1], rest); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = rest; + return func.apply(this, otherArgs); + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of the created + * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). + * + * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/Web/JavaScript/Reference/Operators/Spread_operator). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to spread arguments over. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * // with a Promise + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function(array) { + return func.apply(this, array); + }; + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed invocations. Provide an options object to indicate + * that `func` should be invoked on the leading and/or trailing edge of the + * `wait` timeout. Subsequent calls to the throttled function return the + * result of the last `func` call. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify invoking on the leading + * edge of the timeout. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing + * edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes + * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { + * 'trailing': false + * })); + * + * // cancel a trailing throttled call + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (options === false) { + leading = false; + } else if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing }); + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Any additional arguments provided to the function are + * appended to those provided to the wrapper function. The wrapper is invoked + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Function + * @param {*} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

    ' + func(text) + '

    '; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

    fred, barney, & pebbles

    ' + */ + function wrap(value, wrapper) { + wrapper = wrapper == null ? identity : wrapper; + return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, + * otherwise they are assigned by reference. If `customizer` is provided it's + * invoked to produce the cloned values. If `customizer` returns `undefined` + * cloning is handled by the method instead. The `customizer` is bound to + * `thisArg` and invoked with up to three argument; (value [, index|key, object]). + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). + * The enumerable properties of `arguments` objects and objects created by + * constructors other than `Object` are cloned to plain `Object` objects. An + * empty object is returned for uncloneable values such as functions, DOM nodes, + * Maps, Sets, and WeakMaps. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {*} Returns the cloned value. + * @example + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * var shallow = _.clone(users); + * shallow[0] === users[0]; + * // => true + * + * var deep = _.clone(users, true); + * deep[0] === users[0]; + * // => false + * + * // using a customizer callback + * var el = _.clone(document.body, function(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * }); + * + * el === document.body + * // => false + * el.nodeName + * // => BODY + * el.childNodes.length; + * // => 0 + */ + function clone(value, isDeep, customizer, thisArg) { + if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) { + isDeep = false; + } + else if (typeof isDeep == 'function') { + thisArg = customizer; + customizer = isDeep; + isDeep = false; + } + return typeof customizer == 'function' + ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 3)) + : baseClone(value, isDeep); + } + + /** + * Creates a deep clone of `value`. If `customizer` is provided it's invoked + * to produce the cloned values. If `customizer` returns `undefined` cloning + * is handled by the method instead. The `customizer` is bound to `thisArg` + * and invoked with up to three argument; (value [, index|key, object]). + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). + * The enumerable properties of `arguments` objects and objects created by + * constructors other than `Object` are cloned to plain `Object` objects. An + * empty object is returned for uncloneable values such as functions, DOM nodes, + * Maps, Sets, and WeakMaps. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {*} Returns the deep cloned value. + * @example + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * var deep = _.cloneDeep(users); + * deep[0] === users[0]; + * // => false + * + * // using a customizer callback + * var el = _.cloneDeep(document.body, function(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * }); + * + * el === document.body + * // => false + * el.nodeName + * // => BODY + * el.childNodes.length; + * // => 20 + */ + function cloneDeep(value, customizer, thisArg) { + return typeof customizer == 'function' + ? baseClone(value, true, bindCallback(customizer, thisArg, 3)) + : baseClone(value, true); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + function gt(value, other) { + return value > other; + } + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + function gte(value, other) { + return value >= other; + } + + /** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return isObjectLike(value) && isArrayLike(value) && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; + }; + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag); + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + function isDate(value) { + return isObjectLike(value) && objToString.call(value) == dateTag; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); + } + + /** + * Checks if `value` is empty. A value is considered empty unless it's an + * `arguments` object, array, string, or jQuery-like collection with a length + * greater than `0` or an object with own enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || + (isObjectLike(value) && isFunction(value.splice)))) { + return !value.length; + } + return !keys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. If `customizer` is provided it's invoked to compare values. + * If `customizer` returns `undefined` comparisons are handled by the method + * instead. The `customizer` is bound to `thisArg` and invoked with up to + * three arguments: (value, other [, index|key]). + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. Functions and DOM nodes + * are **not** supported. Provide a customizer function to extend support + * for comparing other values. + * + * @static + * @memberOf _ + * @alias eq + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize value comparisons. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * object == other; + * // => false + * + * _.isEqual(object, other); + * // => true + * + * // using a customizer callback + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqual(array, other, function(value, other) { + * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) { + * return true; + * } + * }); + * // => true + */ + function isEqual(value, other, customizer, thisArg) { + customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag; + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(10); + * // => true + * + * _.isFinite('10'); + * // => false + * + * _.isFinite(true); + * // => false + * + * _.isFinite(Object(10)); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 which returns 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Performs a deep comparison between `object` and `source` to determine if + * `object` contains equivalent property values. If `customizer` is provided + * it's invoked to compare values. If `customizer` returns `undefined` + * comparisons are handled by the method instead. The `customizer` is bound + * to `thisArg` and invoked with three arguments: (value, other, index|key). + * + * **Note:** This method supports comparing properties of arrays, booleans, + * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions + * and DOM nodes are **not** supported. Provide a customizer function to extend + * support for comparing other values. + * + * @static + * @memberOf _ + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize value comparisons. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + * + * // using a customizer callback + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatch(object, source, function(value, other) { + * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; + * }); + * // => true + */ + function isMatch(object, source, customizer, thisArg) { + customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; + return baseIsMatch(object, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) + * which returns `true` for `undefined` and other non-numeric values. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some host objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified + * as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isNumber(8.4); + * // => true + * + * _.isNumber(NaN); + * // => true + * + * _.isNumber('8.4'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * **Note:** This method assumes objects created by the `Object` constructor + * have no inherited enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + var Ctor; + + // Exit early for non `Object` objects. + if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isHostObject(value) && !isArguments(value)) || + (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { + return false; + } + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + var result; + if (lodash.support.ownLast) { + baseForIn(value, function(subValue, key, object) { + result = hasOwnProperty.call(object, key); + return false; + }); + return result !== false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + baseForIn(value, function(subValue, key) { + result = key; + }); + return result === undefined || hasOwnProperty.call(value, result); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + function isRegExp(value) { + return isObject(value) && objToString.call(value) == regexpTag; + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + function isTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + function lt(value, other) { + return value < other; + } + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + function lte(value, other) { + return value <= other; + } + + /** + * Converts `value` to an array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * (function() { + * return _.toArray(arguments).slice(1); + * }(1, 2, 3)); + * // => [2, 3] + */ + function toArray(value) { + var length = value ? getLength(value) : 0; + if (!isLength(length)) { + return values(value); + } + if (!length) { + return []; + } + return (lodash.support.unindexedChars && isString(value)) + ? value.split('') + : arrayCopy(value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable + * properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return baseCopy(value, keysIn(value)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined` into the destination object. Subsequent sources + * overwrite property assignments of previous sources. If `customizer` is + * provided it's invoked to produce the merged values of the destination and + * source properties. If `customizer` returns `undefined` merging is handled + * by the method instead. The `customizer` is bound to `thisArg` and invoked + * with five arguments: (objectValue, sourceValue, key, object, source). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + * + * // using a customizer callback + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(object, other, function(a, b) { + * if (_.isArray(a)) { + * return a.concat(b); + * } + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */ + var merge = createAssigner(baseMerge); + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources overwrite property assignments of previous sources. + * If `customizer` is provided it's invoked to produce the assigned values. + * The `customizer` is bound to `thisArg` and invoked with five arguments: + * (objectValue, sourceValue, key, object, source). + * + * **Note:** This method mutates `object` and is based on + * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign). + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns `object`. + * @example + * + * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); + * // => { 'user': 'fred', 'age': 40 } + * + * // using a customizer callback + * var defaults = _.partialRight(_.assign, function(value, other) { + * return _.isUndefined(value) ? other : value; + * }); + * + * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ + var assign = createAssigner(function(object, source, customizer) { + return customizer + ? assignWith(object, source, customizer) + : baseAssign(object, source); + }); + + /** + * Creates an object that inherits from the given `prototype` object. If a + * `properties` object is provided its own enumerable properties are assigned + * to the created object. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties, guard) { + var result = baseCreate(prototype); + if (guard && isIterateeCall(prototype, properties, guard)) { + properties = undefined; + } + return properties ? baseAssign(result, properties) : result; + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ + var defaults = createDefaults(assign, assignDefaults); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); + * // => { 'user': { 'name': 'barney', 'age': 36 } } + * + */ + var defaultsDeep = createDefaults(merge, mergeDefaults); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(chr) { + * return chr.age < 40; + * }); + * // => 'barney' (iteration order is not guaranteed) + * + * // using the `_.matches` callback shorthand + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // using the `_.matchesProperty` callback shorthand + * _.findKey(users, 'active', false); + * // => 'fred' + * + * // using the `_.property` callback shorthand + * _.findKey(users, 'active'); + * // => 'barney' + */ + var findKey = createFindKey(baseForOwn); + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(chr) { + * return chr.age < 40; + * }); + * // => returns `pebbles` assuming `_.findKey` returns `barney` + * + * // using the `_.matches` callback shorthand + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // using the `_.matchesProperty` callback shorthand + * _.findLastKey(users, 'active', false); + * // => 'fred' + * + * // using the `_.property` callback shorthand + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + var findLastKey = createFindKey(baseForOwnRight); + + /** + * Iterates over own and inherited enumerable properties of an object invoking + * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) + */ + var forIn = createForIn(baseFor); + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' + */ + var forInRight = createForIn(baseForRight); + + /** + * Iterates over own enumerable properties of an object invoking `iteratee` + * for each property. The `iteratee` is bound to `thisArg` and invoked with + * three arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'a' and 'b' (iteration order is not guaranteed) + */ + var forOwn = createForOwn(baseForOwn); + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b' + */ + var forOwnRight = createForOwn(baseForOwnRight); + + /** + * Creates an array of function property names from all enumerable properties, + * own and inherited, of `object`. + * + * @static + * @memberOf _ + * @alias methods + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * _.functions(_); + * // => ['after', 'ary', 'assign', ...] + */ + function functions(object) { + return baseFunctions(object, keysIn(object)); + } + + /** + * Gets the property value at `path` of `object`. If the resolved value is + * `undefined` the `defaultValue` is used in its place. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, toPath(path), (path + '')); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` is a direct property, else `false`. + * @example + * + * var object = { 'a': { 'b': { 'c': 3 } } }; + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b.c'); + * // => true + * + * _.has(object, ['a', 'b', 'c']); + * // => true + */ + function has(object, path) { + if (object == null) { + return false; + } + var result = hasOwnProperty.call(object, path); + if (!result && !isKey(path)) { + path = toPath(path); + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + if (object == null) { + return false; + } + path = last(path); + result = hasOwnProperty.call(object, path); + } + return result || (isLength(object.length) && isIndex(path, object.length) && + (isArray(object) || isArguments(object) || isString(object))); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite property + * assignments of previous values unless `multiValue` is `true`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to invert. + * @param {boolean} [multiValue] Allow multiple values per key. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + * + * // with `multiValue` + * _.invert(object, true); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function invert(object, multiValue, guard) { + if (guard && isIterateeCall(object, multiValue, guard)) { + multiValue = undefined; + } + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index], + value = object[key]; + + if (multiValue) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + } + else { + result[value] = key; + } + } + return result; + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? undefined : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object == 'function' ? lodash.support.enumPrototypes : isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; + }; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length, + support = lodash.support; + + length = (length && isLength(length) && + (isArray(object) || isArguments(object) || isString(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + proto = (isFunction(Ctor) && Ctor.prototype) || objectProto, + isProto = proto === object, + result = Array(length), + skipIndexes = length > 0, + skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error), + skipProto = support.enumPrototypes && isFunction(object); + + while (++index < length) { + result[index] = (index + ''); + } + // lodash skips the `constructor` property when it infers it's iterating + // over a `prototype` object because IE < 9 can't set the `[[Enumerable]]` + // attribute of an existing property and the `constructor` property of a + // prototype defaults to non-enumerable. + for (var key in object) { + if (!(skipProto && key == 'prototype') && + !(skipErrorProps && (key == 'message' || key == 'name')) && + !(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + if (support.nonEnumShadows && object !== objectProto) { + var tag = object === stringProto ? stringTag : (object === errorProto ? errorTag : objToString.call(object)), + nonEnums = nonEnumProps[tag] || nonEnumProps[objectTag]; + + if (tag == objectTag) { + proto = objectProto; + } + length = shadowProps.length; + while (length--) { + key = shadowProps[length]; + var nonEnum = nonEnums[key]; + if (!(isProto && nonEnum) && + (nonEnum ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) { + result.push(key); + } + } + } + return result; + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * property of `object` through `iteratee`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the new mapped object. + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + var mapKeys = createObjectMapper(true); + + /** + * Creates an object with the same keys as `object` and values generated by + * running each own enumerable property of `object` through `iteratee`. The + * iteratee function is bound to `thisArg` and invoked with three arguments: + * (value, key, object). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the new mapped object. + * @example + * + * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { + * return n * 3; + * }); + * // => { 'a': 3, 'b': 6 } + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * // using the `_.property` callback shorthand + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + var mapValues = createObjectMapper(); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that are not omitted. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|...(string|string[])} [predicate] The function invoked per + * iteration or property names to omit, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.omit(object, 'age'); + * // => { 'user': 'fred' } + * + * _.omit(object, _.isNumber); + * // => { 'user': 'fred' } + */ + var omit = restParam(function(object, props) { + if (object == null) { + return {}; + } + if (typeof props[0] != 'function') { + var props = arrayMap(baseFlatten(props), String); + return pickByArray(object, baseDifference(keysIn(object), props)); + } + var predicate = bindCallback(props[0], props[1], 3); + return pickByCallback(object, function(value, key, object) { + return !predicate(value, key, object); + }); + }); + + /** + * Creates a two dimensional array of the key-value pairs for `object`, + * e.g. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) + */ + function pairs(object) { + object = toObject(object); + + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates an object composed of the picked `object` properties. Property + * names may be specified as individual arguments or as arrays of property + * names. If `predicate` is provided it's invoked for each property of `object` + * picking the properties `predicate` returns truthy for. The predicate is + * bound to `thisArg` and invoked with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|...(string|string[])} [predicate] The function invoked per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.pick(object, 'user'); + * // => { 'user': 'fred' } + * + * _.pick(object, _.isString); + * // => { 'user': 'fred' } + */ + var pick = restParam(function(object, props) { + if (object == null) { + return {}; + } + return typeof props[0] == 'function' + ? pickByCallback(object, bindCallback(props[0], props[1], 3)) + : pickByArray(object, baseFlatten(props)); + }); + + /** + * This method is like `_.get` except that if the resolved value is a function + * it's invoked with the `this` binding of its parent object and its result + * is returned. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a.b.c', 'default'); + * // => 'default' + * + * _.result(object, 'a.b.c', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + var result = object == null ? undefined : toObject(object)[path]; + if (result === undefined) { + if (object != null && !isKey(path, object)) { + path = toPath(path); + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + result = object == null ? undefined : toObject(object)[last(path)]; + } + result = result === undefined ? defaultValue : result; + } + return isFunction(result) ? result.call(object) : result; + } + + /** + * Sets the property value of `path` on `object`. If a portion of `path` + * does not exist it's created. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to augment. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, 'x[0].y.z', 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + if (object == null) { + return object; + } + var pathKey = (path + ''); + path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = path[index]; + if (isObject(nested)) { + if (index == lastIndex) { + nested[key] = value; + } else if (nested[key] == null) { + nested[key] = isIndex(path[index + 1]) ? [] : {}; + } + } + nested = nested[key]; + } + return object; + } + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own enumerable + * properties through `iteratee`, with each invocation potentially mutating + * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked + * with four arguments: (accumulator, value, key, object). Iteratee functions + * may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Array|Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { + * result[key] = n * 3; + * }); + * // => { 'a': 3, 'b': 6 } + */ + function transform(object, iteratee, accumulator, thisArg) { + var isArr = isArray(object) || isTypedArray(object); + iteratee = getCallback(iteratee, thisArg, 4); + + if (accumulator == null) { + if (isArr || isObject(object)) { + var Ctor = object.constructor; + if (isArr) { + accumulator = isArray(object) ? new Ctor : []; + } else { + accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); + } + } else { + accumulator = {}; + } + } + (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Creates an array of the own enumerable property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable property values + * of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Checks if `n` is between `start` and up to but not including, `end`. If + * `end` is not specified it's set to `start` with `start` then set to `0`. + * + * @static + * @memberOf _ + * @category Number + * @param {number} n The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `n` is in the range, else `false`. + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + */ + function inRange(value, start, end) { + start = +start || 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = +end || 0; + } + return value >= nativeMin(start, end) && value < nativeMax(start, end); + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is provided a number between `0` and the given number is returned. + * If `floating` is `true`, or either `min` or `max` are floats, a floating-point + * number is returned instead of an integer. + * + * @static + * @memberOf _ + * @category Number + * @param {number} [min=0] The minimum possible value. + * @param {number} [max=1] The maximum possible value. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(min, max, floating) { + if (floating && isIterateeCall(min, max, floating)) { + max = floating = undefined; + } + var noMin = min == null, + noMax = max == null; + + if (floating == null) { + if (noMax && typeof min == 'boolean') { + floating = min; + min = 1; + } + else if (typeof max == 'boolean') { + floating = max; + noMax = true; + } + } + if (noMin && noMax) { + max = 1; + noMax = false; + } + min = +min || 0; + if (noMax) { + max = min; + min = 0; + } else { + max = +max || 0; + } + if (floating || min % 1 || max % 1) { + var rand = nativeRandom(); + return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max); + } + return baseRandom(min, max); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar'); + * // => 'fooBar' + * + * _.camelCase('__foo_bar__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); + }); + + /** + * Capitalizes the first character of `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('fred'); + * // => 'Fred' + */ + function capitalize(string) { + string = baseToString(string); + return string && (string.charAt(0).toUpperCase() + string.slice(1)); + } + + /** + * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = baseToString(string); + return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search from. + * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = baseToString(string); + target = (target + ''); + + var length = string.length; + position = position === undefined + ? length + : nativeMin(position < 0 ? 0 : (+position || 0), length); + + position -= target.length; + return position >= 0 && string.indexOf(target, position) == position; + } + + /** + * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional characters + * use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. + * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in Internet Explorer < 9, they can break out + * of attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) + * for more details. + * + * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) + * to reduce XSS vectors. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + // Reset `lastIndex` because in IE < 9 `String#replace` does not. + string = baseToString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?", + * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https:\/\/lodash\.com\/\)' + */ + function escapeRegExp(string) { + string = baseToString(string); + return (string && reHasRegExpChars.test(string)) + ? string.replace(reRegExpChars, escapeRegExpChar) + : (string || '(?:)'); + } + + /** + * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__foo_bar__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = baseToString(string); + length = +length; + + var strLength = string.length; + if (strLength >= length || !nativeIsFinite(length)) { + return string; + } + var mid = (length - strLength) / 2, + leftLength = nativeFloor(mid), + rightLength = nativeCeil(mid); + + chars = createPadding('', rightLength, chars); + return chars.slice(0, leftLength) + string + chars; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padLeft('abc', 6); + * // => ' abc' + * + * _.padLeft('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padLeft('abc', 3); + * // => 'abc' + */ + var padLeft = createPadDir(); + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padRight('abc', 6); + * // => 'abc ' + * + * _.padRight('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padRight('abc', 3); + * // => 'abc' + */ + var padRight = createPadDir(true); + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, + * in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) + * of `parseInt`. + * + * @static + * @memberOf _ + * @category String + * @param {string} string The string to convert. + * @param {number} [radix] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. + // Chrome fails to trim leading whitespace characters. + // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. + if (guard ? isIterateeCall(string, radix, guard) : radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + string = trim(string); + return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=0] The number of times to repeat the string. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n) { + var result = ''; + string = baseToString(string); + n = +n; + if (n < 1 || !string || !nativeIsFinite(n)) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + string += string; + } while (n); + + return result; + } + + /** + * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--foo-bar'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__foo_bar__'); + * // => 'Foo Bar' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = baseToString(string); + position = position == null + ? 0 + : nativeMin(position < 0 ? 0 : (+position || 0), string.length); + + return string.lastIndexOf(target, position) == position; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is provided it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as free variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. + * @param {string} [options.variable] The data object variable name. + * @param- {Object} [otherOptions] Enables the legacy `options` param signature. + * @returns {Function} Returns the compiled template function. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // using the HTML "escape" delimiter to escape data property values + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' + + + */ + function copy(source, destination, stackSource, stackDest) { + if (isWindow(source) || isScope(source)) { + throw ngMinErr('cpws', + "Can't copy! Making copies of Window or Scope instances is not supported."); + } + if (isTypedArray(destination)) { + throw ngMinErr('cpta', + "Can't copy! TypedArray destination cannot be mutated."); + } + + if (!destination) { + destination = source; + if (isObject(source)) { + var index; + if (stackSource && (index = stackSource.indexOf(source)) !== -1) { + return stackDest[index]; + } + + // TypedArray, Date and RegExp have specific copy functionality and must be + // pushed onto the stack before returning. + // Array and other objects create the base object and recurse to copy child + // objects. The array/object will be pushed onto the stack when recursed. + if (isArray(source)) { + return copy(source, [], stackSource, stackDest); + } else if (isTypedArray(source)) { + destination = new source.constructor(source); + } else if (isDate(source)) { + destination = new Date(source.getTime()); + } else if (isRegExp(source)) { + destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]); + destination.lastIndex = source.lastIndex; + } else if (isFunction(source.cloneNode)) { + destination = source.cloneNode(true); + } else { + var emptyObject = Object.create(getPrototypeOf(source)); + return copy(source, emptyObject, stackSource, stackDest); + } + + if (stackDest) { + stackSource.push(source); + stackDest.push(destination); + } + } + } else { + if (source === destination) throw ngMinErr('cpi', + "Can't copy! Source and destination are identical."); + + stackSource = stackSource || []; + stackDest = stackDest || []; + + if (isObject(source)) { + stackSource.push(source); + stackDest.push(destination); + } + + var result, key; + if (isArray(source)) { + destination.length = 0; + for (var i = 0; i < source.length; i++) { + destination.push(copy(source[i], null, stackSource, stackDest)); + } + } else { + var h = destination.$$hashKey; + if (isArray(destination)) { + destination.length = 0; + } else { + forEach(destination, function(value, key) { + delete destination[key]; + }); + } + if (isBlankObject(source)) { + // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty + for (key in source) { + destination[key] = copy(source[key], null, stackSource, stackDest); + } + } else if (source && typeof source.hasOwnProperty === 'function') { + // Slow path, which must rely on hasOwnProperty + for (key in source) { + if (source.hasOwnProperty(key)) { + destination[key] = copy(source[key], null, stackSource, stackDest); + } + } + } else { + // Slowest path --- hasOwnProperty can't be called as a method + for (key in source) { + if (hasOwnProperty.call(source, key)) { + destination[key] = copy(source[key], null, stackSource, stackDest); + } + } + } + setHashKey(destination,h); + } + } + return destination; + } + + /** + * Creates a shallow copy of an object, an array or a primitive. + * + * Assumes that there are no proto properties for objects. + */ + function shallowCopy(src, dst) { + if (isArray(src)) { + dst = dst || []; + + for (var i = 0, ii = src.length; i < ii; i++) { + dst[i] = src[i]; + } + } else if (isObject(src)) { + dst = dst || {}; + + for (var key in src) { + if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { + dst[key] = src[key]; + } + } + } + + return dst || src; + } + + + /** + * @ngdoc function + * @name angular.equals + * @module ng + * @kind function + * + * @description + * Determines if two objects or two values are equivalent. Supports value types, regular + * expressions, arrays and objects. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties are equal by + * comparing them with `angular.equals`. + * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal) + * * Both values represent the same regular expression (In JavaScript, + * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual + * representation matches). + * + * During a property comparison, properties of `function` type and properties with names + * that begin with `$` are ignored. + * + * Scope and DOMWindow objects are being compared only by identify (`===`). + * + * @param {*} o1 Object or value to compare. + * @param {*} o2 Object or value to compare. + * @returns {boolean} True if arguments are equal. + */ + function equals(o1, o2) { + if (o1 === o2) return true; + if (o1 === null || o2 === null) return false; + if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN + var t1 = typeof o1, t2 = typeof o2, length, key, keySet; + if (t1 == t2) { + if (t1 == 'object') { + if (isArray(o1)) { + if (!isArray(o2)) return false; + if ((length = o1.length) == o2.length) { + for (key = 0; key < length; key++) { + if (!equals(o1[key], o2[key])) return false; + } + return true; + } + } else if (isDate(o1)) { + if (!isDate(o2)) return false; + return equals(o1.getTime(), o2.getTime()); + } else if (isRegExp(o1)) { + return isRegExp(o2) ? o1.toString() == o2.toString() : false; + } else { + if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || + isArray(o2) || isDate(o2) || isRegExp(o2)) return false; + keySet = createMap(); + for (key in o1) { + if (key.charAt(0) === '$' || isFunction(o1[key])) continue; + if (!equals(o1[key], o2[key])) return false; + keySet[key] = true; + } + for (key in o2) { + if (!(key in keySet) && + key.charAt(0) !== '$' && + isDefined(o2[key]) && + !isFunction(o2[key])) return false; + } + return true; + } + } + } + return false; + } + + var csp = function() { + if (!isDefined(csp.rules)) { + + + var ngCspElement = (document.querySelector('[ng-csp]') || + document.querySelector('[data-ng-csp]')); + + if (ngCspElement) { + var ngCspAttribute = ngCspElement.getAttribute('ng-csp') || + ngCspElement.getAttribute('data-ng-csp'); + csp.rules = { + noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1), + noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1) + }; + } else { + csp.rules = { + noUnsafeEval: noUnsafeEval(), + noInlineStyle: false + }; + } + } + + return csp.rules; + + function noUnsafeEval() { + try { + /* jshint -W031, -W054 */ + new Function(''); + /* jshint +W031, +W054 */ + return false; + } catch (e) { + return true; + } + } + }; + + /** + * @ngdoc directive + * @module ng + * @name ngJq + * + * @element ANY + * @param {string=} ngJq the name of the library available under `window` + * to be used for angular.element + * @description + * Use this directive to force the angular.element library. This should be + * used to force either jqLite by leaving ng-jq blank or setting the name of + * the jquery variable under window (eg. jQuery). + * + * Since angular looks for this directive when it is loaded (doesn't wait for the + * DOMContentLoaded event), it must be placed on an element that comes before the script + * which loads angular. Also, only the first instance of `ng-jq` will be used and all + * others ignored. + * + * @example + * This example shows how to force jqLite using the `ngJq` directive to the `html` tag. + ```html + + + ... + ... + + ``` + * @example + * This example shows how to use a jQuery based library of a different name. + * The library name must be available at the top most 'window'. + ```html + + + ... + ... + + ``` + */ + var jq = function() { + if (isDefined(jq.name_)) return jq.name_; + var el; + var i, ii = ngAttrPrefixes.length, prefix, name; + for (i = 0; i < ii; ++i) { + prefix = ngAttrPrefixes[i]; + if (el = document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]')) { + name = el.getAttribute(prefix + 'jq'); + break; + } + } + + return (jq.name_ = name); + }; + + function concat(array1, array2, index) { + return array1.concat(slice.call(array2, index)); + } + + function sliceArgs(args, startIndex) { + return slice.call(args, startIndex || 0); + } + + + /* jshint -W101 */ + /** + * @ngdoc function + * @name angular.bind + * @module ng + * @kind function + * + * @description + * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for + * `fn`). You can supply optional `args` that are prebound to the function. This feature is also + * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as + * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application). + * + * @param {Object} self Context which `fn` should be evaluated in. + * @param {function()} fn Function to be bound. + * @param {...*} args Optional arguments to be prebound to the `fn` function call. + * @returns {function()} Function that wraps the `fn` with all the specified bindings. + */ + /* jshint +W101 */ + function bind(self, fn) { + var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; + if (isFunction(fn) && !(fn instanceof RegExp)) { + return curryArgs.length + ? function() { + return arguments.length + ? fn.apply(self, concat(curryArgs, arguments, 0)) + : fn.apply(self, curryArgs); + } + : function() { + return arguments.length + ? fn.apply(self, arguments) + : fn.call(self); + }; + } else { + // in IE, native methods are not functions so they cannot be bound (note: they don't need to be) + return fn; + } + } + + + function toJsonReplacer(key, value) { + var val = value; + + if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') { + val = undefined; + } else if (isWindow(value)) { + val = '$WINDOW'; + } else if (value && document === value) { + val = '$DOCUMENT'; + } else if (isScope(value)) { + val = '$SCOPE'; + } + + return val; + } + + + /** + * @ngdoc function + * @name angular.toJson + * @module ng + * @kind function + * + * @description + * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be + * stripped since angular uses this notation internally. + * + * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON. + * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace. + * If set to an integer, the JSON output will contain that many spaces per indentation. + * @returns {string|undefined} JSON-ified string representing `obj`. + */ + function toJson(obj, pretty) { + if (typeof obj === 'undefined') return undefined; + if (!isNumber(pretty)) { + pretty = pretty ? 2 : null; + } + return JSON.stringify(obj, toJsonReplacer, pretty); + } + + + /** + * @ngdoc function + * @name angular.fromJson + * @module ng + * @kind function + * + * @description + * Deserializes a JSON string. + * + * @param {string} json JSON string to deserialize. + * @returns {Object|Array|string|number} Deserialized JSON string. + */ + function fromJson(json) { + return isString(json) + ? JSON.parse(json) + : json; + } + + + function timezoneToOffset(timezone, fallback) { + var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; + return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; + } + + + function addDateMinutes(date, minutes) { + date = new Date(date.getTime()); + date.setMinutes(date.getMinutes() + minutes); + return date; + } + + + function convertTimezoneToLocal(date, timezone, reverse) { + reverse = reverse ? -1 : 1; + var timezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset()); + return addDateMinutes(date, reverse * (timezoneOffset - date.getTimezoneOffset())); + } + + + /** + * @returns {string} Returns the string representation of the element. + */ + function startingTag(element) { + element = jqLite(element).clone(); + try { + // turns out IE does not let you set .html() on elements which + // are not allowed to have children. So we just ignore it. + element.empty(); + } catch (e) {} + var elemHtml = jqLite('
    ').append(element).html(); + try { + return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) : + elemHtml. + match(/^(<[^>]+>)/)[1]. + replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); }); + } catch (e) { + return lowercase(elemHtml); + } + + } + + + ///////////////////////////////////////////////// + + /** + * Tries to decode the URI component without throwing an exception. + * + * @private + * @param str value potential URI component to check. + * @returns {boolean} True if `value` can be decoded + * with the decodeURIComponent function. + */ + function tryDecodeURIComponent(value) { + try { + return decodeURIComponent(value); + } catch (e) { + // Ignore any invalid uri component + } + } + + + /** + * Parses an escaped url query string into key-value pairs. + * @returns {Object.} + */ + function parseKeyValue(/**string*/keyValue) { + var obj = {}; + forEach((keyValue || "").split('&'), function(keyValue) { + var splitPoint, key, val; + if (keyValue) { + key = keyValue = keyValue.replace(/\+/g,'%20'); + splitPoint = keyValue.indexOf('='); + if (splitPoint !== -1) { + key = keyValue.substring(0, splitPoint); + val = keyValue.substring(splitPoint + 1); + } + key = tryDecodeURIComponent(key); + if (isDefined(key)) { + val = isDefined(val) ? tryDecodeURIComponent(val) : true; + if (!hasOwnProperty.call(obj, key)) { + obj[key] = val; + } else if (isArray(obj[key])) { + obj[key].push(val); + } else { + obj[key] = [obj[key],val]; + } + } + } + }); + return obj; + } + + function toKeyValue(obj) { + var parts = []; + forEach(obj, function(value, key) { + if (isArray(value)) { + forEach(value, function(arrayValue) { + parts.push(encodeUriQuery(key, true) + + (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true))); + }); + } else { + parts.push(encodeUriQuery(key, true) + + (value === true ? '' : '=' + encodeUriQuery(value, true))); + } + }); + return parts.length ? parts.join('&') : ''; + } + + + /** + * We need our custom method because encodeURIComponent is too aggressive and doesn't follow + * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path + * segments: + * segment = *pchar + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * pct-encoded = "%" HEXDIG HEXDIG + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ + function encodeUriSegment(val) { + return encodeUriQuery(val, true). + replace(/%26/gi, '&'). + replace(/%3D/gi, '='). + replace(/%2B/gi, '+'); + } + + + /** + * This method is intended for encoding *key* or *value* parts of query component. We need a custom + * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be + * encoded per http://tools.ietf.org/html/rfc3986: + * query = *( pchar / "/" / "?" ) + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * pct-encoded = "%" HEXDIG HEXDIG + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ + function encodeUriQuery(val, pctEncodeSpaces) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%3B/gi, ';'). + replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); + } + + var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-']; + + function getNgAttribute(element, ngAttr) { + var attr, i, ii = ngAttrPrefixes.length; + for (i = 0; i < ii; ++i) { + attr = ngAttrPrefixes[i] + ngAttr; + if (isString(attr = element.getAttribute(attr))) { + return attr; + } + } + return null; + } + + /** + * @ngdoc directive + * @name ngApp + * @module ng + * + * @element ANY + * @param {angular.Module} ngApp an optional application + * {@link angular.module module} name to load. + * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be + * created in "strict-di" mode. This means that the application will fail to invoke functions which + * do not use explicit function annotation (and are thus unsuitable for minification), as described + * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in + * tracking down the root of these bugs. + * + * @description + * + * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive + * designates the **root element** of the application and is typically placed near the root element + * of the page - e.g. on the `` or `` tags. + * + * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp` + * found in the document will be used to define the root element to auto-bootstrap as an + * application. To run multiple applications in an HTML document you must manually bootstrap them using + * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other. + * + * You can specify an **AngularJS module** to be used as the root module for the application. This + * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It + * should contain the application code needed or have dependencies on other modules that will + * contain the code. See {@link angular.module} for more information. + * + * In the example below if the `ngApp` directive were not placed on the `html` element then the + * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}` + * would not be resolved to `3`. + * + * `ngApp` is the easiest, and most common way to bootstrap an application. + * + + +
    + I can add: {{a}} + {{b}} = {{ a+b }} +
    +
    + + angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) { + $scope.a = 1; + $scope.b = 2; + }); + +
    + * + * Using `ngStrictDi`, you would see something like this: + * + + +
    +
    + I can add: {{a}} + {{b}} = {{ a+b }} + +

    This renders because the controller does not fail to + instantiate, by using explicit annotation style (see + script.js for details) +

    +
    + +
    + Name:
    + Hello, {{name}}! + +

    This renders because the controller does not fail to + instantiate, by using explicit annotation style + (see script.js for details) +

    +
    + +
    + I can add: {{a}} + {{b}} = {{ a+b }} + +

    The controller could not be instantiated, due to relying + on automatic function annotations (which are disabled in + strict mode). As such, the content of this section is not + interpolated, and there should be an error in your web console. +

    +
    +
    +
    + + angular.module('ngAppStrictDemo', []) + // BadController will fail to instantiate, due to relying on automatic function annotation, + // rather than an explicit annotation + .controller('BadController', function($scope) { + $scope.a = 1; + $scope.b = 2; + }) + // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated, + // due to using explicit annotations using the array style and $inject property, respectively. + .controller('GoodController1', ['$scope', function($scope) { + $scope.a = 1; + $scope.b = 2; + }]) + .controller('GoodController2', GoodController2); + function GoodController2($scope) { + $scope.name = "World"; + } + GoodController2.$inject = ['$scope']; + + + div[ng-controller] { + margin-bottom: 1em; + -webkit-border-radius: 4px; + border-radius: 4px; + border: 1px solid; + padding: .5em; + } + div[ng-controller^=Good] { + border-color: #d6e9c6; + background-color: #dff0d8; + color: #3c763d; + } + div[ng-controller^=Bad] { + border-color: #ebccd1; + background-color: #f2dede; + color: #a94442; + margin-bottom: 0; + } + +
    + */ + function angularInit(element, bootstrap) { + var appElement, + module, + config = {}; + + // The element `element` has priority over any other element + forEach(ngAttrPrefixes, function(prefix) { + var name = prefix + 'app'; + + if (!appElement && element.hasAttribute && element.hasAttribute(name)) { + appElement = element; + module = element.getAttribute(name); + } + }); + forEach(ngAttrPrefixes, function(prefix) { + var name = prefix + 'app'; + var candidate; + + if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { + appElement = candidate; + module = candidate.getAttribute(name); + } + }); + if (appElement) { + config.strictDi = getNgAttribute(appElement, "strict-di") !== null; + bootstrap(appElement, module ? [module] : [], config); + } + } + + /** + * @ngdoc function + * @name angular.bootstrap + * @module ng + * @description + * Use this function to manually start up angular application. + * + * See: {@link guide/bootstrap Bootstrap} + * + * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually. + * They must use {@link ng.directive:ngApp ngApp}. + * + * Angular will detect if it has been loaded into the browser more than once and only allow the + * first loaded script to be bootstrapped and will report a warning to the browser console for + * each of the subsequent scripts. This prevents strange results in applications, where otherwise + * multiple instances of Angular try to work on the DOM. + * + * ```html + * + * + * + *
    + * {{greeting}} + *
    + * + * + * + * + * + * ``` + * + * @param {DOMElement} element DOM element which is the root of angular application. + * @param {Array=} modules an array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a `config` block. + * See: {@link angular.module modules} + * @param {Object=} config an object for defining configuration options for the application. The + * following keys are supported: + * + * * `strictDi` - disable automatic function annotation for the application. This is meant to + * assist in finding bugs which break minified code. Defaults to `false`. + * + * @returns {auto.$injector} Returns the newly created injector for this app. + */ + function bootstrap(element, modules, config) { + if (!isObject(config)) config = {}; + var defaultConfig = { + strictDi: false + }; + config = extend(defaultConfig, config); + var doBootstrap = function() { + element = jqLite(element); + + if (element.injector()) { + var tag = (element[0] === document) ? 'document' : startingTag(element); + //Encode angle brackets to prevent input from being sanitized to empty string #8683 + throw ngMinErr( + 'btstrpd', + "App Already Bootstrapped with this Element '{0}'", + tag.replace(//,'>')); + } + + modules = modules || []; + modules.unshift(['$provide', function($provide) { + $provide.value('$rootElement', element); + }]); + + if (config.debugInfoEnabled) { + // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`. + modules.push(['$compileProvider', function($compileProvider) { + $compileProvider.debugInfoEnabled(true); + }]); + } + + modules.unshift('ng'); + var injector = createInjector(modules, config.strictDi); + injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', + function bootstrapApply(scope, element, compile, injector) { + scope.$apply(function() { + element.data('$injector', injector); + compile(element)(scope); + }); + }] + ); + return injector; + }; + + var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/; + var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; + + if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) { + config.debugInfoEnabled = true; + window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, ''); + } + + if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) { + return doBootstrap(); + } + + window.name = window.name.replace(NG_DEFER_BOOTSTRAP, ''); + angular.resumeBootstrap = function(extraModules) { + forEach(extraModules, function(module) { + modules.push(module); + }); + return doBootstrap(); + }; + + if (isFunction(angular.resumeDeferredBootstrap)) { + angular.resumeDeferredBootstrap(); + } + } + + /** + * @ngdoc function + * @name angular.reloadWithDebugInfo + * @module ng + * @description + * Use this function to reload the current application with debug information turned on. + * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`. + * + * See {@link ng.$compileProvider#debugInfoEnabled} for more. + */ + function reloadWithDebugInfo() { + window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name; + window.location.reload(); + } + + /** + * @name angular.getTestability + * @module ng + * @description + * Get the testability service for the instance of Angular on the given + * element. + * @param {DOMElement} element DOM element which is the root of angular application. + */ + function getTestability(rootElement) { + var injector = angular.element(rootElement).injector(); + if (!injector) { + throw ngMinErr('test', + 'no injector found for element argument to getTestability'); + } + return injector.get('$$testability'); + } + + var SNAKE_CASE_REGEXP = /[A-Z]/g; + function snake_case(name, separator) { + separator = separator || '_'; + return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) { + return (pos ? separator : '') + letter.toLowerCase(); + }); + } + + var bindJQueryFired = false; + var skipDestroyOnNextJQueryCleanData; + function bindJQuery() { + var originalCleanData; + + if (bindJQueryFired) { + return; + } + + // bind to jQuery if present; + var jqName = jq(); + jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present) + !jqName ? undefined : // use jqLite + window[jqName]; // use jQuery specified by `ngJq` + + // Use jQuery if it exists with proper functionality, otherwise default to us. + // Angular 1.2+ requires jQuery 1.7+ for on()/off() support. + // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older + // versions. It will not work for sure with jQuery <1.7, though. + if (jQuery && jQuery.fn.on) { + jqLite = jQuery; + extend(jQuery.fn, { + scope: JQLitePrototype.scope, + isolateScope: JQLitePrototype.isolateScope, + controller: JQLitePrototype.controller, + injector: JQLitePrototype.injector, + inheritedData: JQLitePrototype.inheritedData + }); + + // All nodes removed from the DOM via various jQuery APIs like .remove() + // are passed through jQuery.cleanData. Monkey-patch this method to fire + // the $destroy event on all removed nodes. + originalCleanData = jQuery.cleanData; + jQuery.cleanData = function(elems) { + var events; + if (!skipDestroyOnNextJQueryCleanData) { + for (var i = 0, elem; (elem = elems[i]) != null; i++) { + events = jQuery._data(elem, "events"); + if (events && events.$destroy) { + jQuery(elem).triggerHandler('$destroy'); + } + } + } else { + skipDestroyOnNextJQueryCleanData = false; + } + originalCleanData(elems); + }; + } else { + jqLite = JQLite; + } + + angular.element = jqLite; + + // Prevent double-proxying. + bindJQueryFired = true; + } + + /** + * throw error if the argument is falsy. + */ + function assertArg(arg, name, reason) { + if (!arg) { + throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required")); + } + return arg; + } + + function assertArgFn(arg, name, acceptArrayAnnotation) { + if (acceptArrayAnnotation && isArray(arg)) { + arg = arg[arg.length - 1]; + } + + assertArg(isFunction(arg), name, 'not a function, got ' + + (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg)); + return arg; + } + + /** + * throw error if the name given is hasOwnProperty + * @param {String} name the name to test + * @param {String} context the context in which the name is used, such as module or directive + */ + function assertNotHasOwnProperty(name, context) { + if (name === 'hasOwnProperty') { + throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context); + } + } + + /** + * Return the value accessible from the object by path. Any undefined traversals are ignored + * @param {Object} obj starting object + * @param {String} path path to traverse + * @param {boolean} [bindFnToScope=true] + * @returns {Object} value as accessible by path + */ + //TODO(misko): this function needs to be removed + function getter(obj, path, bindFnToScope) { + if (!path) return obj; + var keys = path.split('.'); + var key; + var lastInstance = obj; + var len = keys.length; + + for (var i = 0; i < len; i++) { + key = keys[i]; + if (obj) { + obj = (lastInstance = obj)[key]; + } + } + if (!bindFnToScope && isFunction(obj)) { + return bind(lastInstance, obj); + } + return obj; + } + + /** + * Return the DOM siblings between the first and last node in the given array. + * @param {Array} array like object + * @returns {Array} the inputted object or a jqLite collection containing the nodes + */ + function getBlockNodes(nodes) { + // TODO(perf): update `nodes` instead of creating a new object? + var node = nodes[0]; + var endNode = nodes[nodes.length - 1]; + var blockNodes; + + for (var i = 1; node !== endNode && (node = node.nextSibling); i++) { + if (blockNodes || nodes[i] !== node) { + if (!blockNodes) { + blockNodes = jqLite(slice.call(nodes, 0, i)); + } + blockNodes.push(node); + } + } + + return blockNodes || nodes; + } + + + /** + * Creates a new object without a prototype. This object is useful for lookup without having to + * guard against prototypically inherited properties via hasOwnProperty. + * + * Related micro-benchmarks: + * - http://jsperf.com/object-create2 + * - http://jsperf.com/proto-map-lookup/2 + * - http://jsperf.com/for-in-vs-object-keys2 + * + * @returns {Object} + */ + function createMap() { + return Object.create(null); + } + + var NODE_TYPE_ELEMENT = 1; + var NODE_TYPE_ATTRIBUTE = 2; + var NODE_TYPE_TEXT = 3; + var NODE_TYPE_COMMENT = 8; + var NODE_TYPE_DOCUMENT = 9; + var NODE_TYPE_DOCUMENT_FRAGMENT = 11; + + /** + * @ngdoc type + * @name angular.Module + * @module ng + * @description + * + * Interface for configuring angular {@link angular.module modules}. + */ + + function setupModuleLoader(window) { + + var $injectorMinErr = minErr('$injector'); + var ngMinErr = minErr('ng'); + + function ensure(obj, name, factory) { + return obj[name] || (obj[name] = factory()); + } + + var angular = ensure(window, 'angular', Object); + + // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap + angular.$$minErr = angular.$$minErr || minErr; + + return ensure(angular, 'module', function() { + /** @type {Object.} */ + var modules = {}; + + /** + * @ngdoc function + * @name angular.module + * @module ng + * @description + * + * The `angular.module` is a global place for creating, registering and retrieving Angular + * modules. + * All modules (angular core or 3rd party) that should be available to an application must be + * registered using this mechanism. + * + * Passing one argument retrieves an existing {@link angular.Module}, + * whereas passing more than one argument creates a new {@link angular.Module} + * + * + * # Module + * + * A module is a collection of services, directives, controllers, filters, and configuration information. + * `angular.module` is used to configure the {@link auto.$injector $injector}. + * + * ```js + * // Create a new module + * var myModule = angular.module('myModule', []); + * + * // register a new service + * myModule.value('appName', 'MyCoolApp'); + * + * // configure existing services inside initialization blocks. + * myModule.config(['$locationProvider', function($locationProvider) { + * // Configure existing providers + * $locationProvider.hashPrefix('!'); + * }]); + * ``` + * + * Then you can create an injector and load your modules like this: + * + * ```js + * var injector = angular.injector(['ng', 'myModule']) + * ``` + * + * However it's more likely that you'll just use + * {@link ng.directive:ngApp ngApp} or + * {@link angular.bootstrap} to simplify this process for you. + * + * @param {!string} name The name of the module to create or retrieve. + * @param {!Array.=} requires If specified then new module is being created. If + * unspecified then the module is being retrieved for further configuration. + * @param {Function=} configFn Optional configuration function for the module. Same as + * {@link angular.Module#config Module#config()}. + * @returns {module} new module with the {@link angular.Module} api. + */ + return function module(name, requires, configFn) { + var assertNotHasOwnProperty = function(name, context) { + if (name === 'hasOwnProperty') { + throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); + } + }; + + assertNotHasOwnProperty(name, 'module'); + if (requires && modules.hasOwnProperty(name)) { + modules[name] = null; + } + return ensure(modules, name, function() { + if (!requires) { + throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " + + "the module name or forgot to load it. If registering a module ensure that you " + + "specify the dependencies as the second argument.", name); + } + + /** @type {!Array.>} */ + var invokeQueue = []; + + /** @type {!Array.} */ + var configBlocks = []; + + /** @type {!Array.} */ + var runBlocks = []; + + var config = invokeLater('$injector', 'invoke', 'push', configBlocks); + + /** @type {angular.Module} */ + var moduleInstance = { + // Private state + _invokeQueue: invokeQueue, + _configBlocks: configBlocks, + _runBlocks: runBlocks, + + /** + * @ngdoc property + * @name angular.Module#requires + * @module ng + * + * @description + * Holds the list of modules which the injector will load before the current module is + * loaded. + */ + requires: requires, + + /** + * @ngdoc property + * @name angular.Module#name + * @module ng + * + * @description + * Name of the module. + */ + name: name, + + + /** + * @ngdoc method + * @name angular.Module#provider + * @module ng + * @param {string} name service name + * @param {Function} providerType Construction function for creating new instance of the + * service. + * @description + * See {@link auto.$provide#provider $provide.provider()}. + */ + provider: invokeLaterAndSetModuleName('$provide', 'provider'), + + /** + * @ngdoc method + * @name angular.Module#factory + * @module ng + * @param {string} name service name + * @param {Function} providerFunction Function for creating new instance of the service. + * @description + * See {@link auto.$provide#factory $provide.factory()}. + */ + factory: invokeLaterAndSetModuleName('$provide', 'factory'), + + /** + * @ngdoc method + * @name angular.Module#service + * @module ng + * @param {string} name service name + * @param {Function} constructor A constructor function that will be instantiated. + * @description + * See {@link auto.$provide#service $provide.service()}. + */ + service: invokeLaterAndSetModuleName('$provide', 'service'), + + /** + * @ngdoc method + * @name angular.Module#value + * @module ng + * @param {string} name service name + * @param {*} object Service instance object. + * @description + * See {@link auto.$provide#value $provide.value()}. + */ + value: invokeLater('$provide', 'value'), + + /** + * @ngdoc method + * @name angular.Module#constant + * @module ng + * @param {string} name constant name + * @param {*} object Constant value. + * @description + * Because the constant are fixed, they get applied before other provide methods. + * See {@link auto.$provide#constant $provide.constant()}. + */ + constant: invokeLater('$provide', 'constant', 'unshift'), + + /** + * @ngdoc method + * @name angular.Module#decorator + * @module ng + * @param {string} The name of the service to decorate. + * @param {Function} This function will be invoked when the service needs to be + * instantiated and should return the decorated service instance. + * @description + * See {@link auto.$provide#decorator $provide.decorator()}. + */ + decorator: invokeLaterAndSetModuleName('$provide', 'decorator'), + + /** + * @ngdoc method + * @name angular.Module#animation + * @module ng + * @param {string} name animation name + * @param {Function} animationFactory Factory function for creating new instance of an + * animation. + * @description + * + * **NOTE**: animations take effect only if the **ngAnimate** module is loaded. + * + * + * Defines an animation hook that can be later used with + * {@link $animate $animate} service and directives that use this service. + * + * ```js + * module.animation('.animation-name', function($inject1, $inject2) { + * return { + * eventName : function(element, done) { + * //code to run the animation + * //once complete, then run done() + * return function cancellationFunction(element) { + * //code to cancel the animation + * } + * } + * } + * }) + * ``` + * + * See {@link ng.$animateProvider#register $animateProvider.register()} and + * {@link ngAnimate ngAnimate module} for more information. + */ + animation: invokeLaterAndSetModuleName('$animateProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#filter + * @module ng + * @param {string} name Filter name - this must be a valid angular expression identifier + * @param {Function} filterFactory Factory function for creating new instance of filter. + * @description + * See {@link ng.$filterProvider#register $filterProvider.register()}. + * + *
    + * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. + * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace + * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores + * (`myapp_subsection_filterx`). + *
    + */ + filter: invokeLaterAndSetModuleName('$filterProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#controller + * @module ng + * @param {string|Object} name Controller name, or an object map of controllers where the + * keys are the names and the values are the constructors. + * @param {Function} constructor Controller constructor function. + * @description + * See {@link ng.$controllerProvider#register $controllerProvider.register()}. + */ + controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#directive + * @module ng + * @param {string|Object} name Directive name, or an object map of directives where the + * keys are the names and the values are the factories. + * @param {Function} directiveFactory Factory function for creating new instance of + * directives. + * @description + * See {@link ng.$compileProvider#directive $compileProvider.directive()}. + */ + directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'), + + /** + * @ngdoc method + * @name angular.Module#config + * @module ng + * @param {Function} configFn Execute this function on module load. Useful for service + * configuration. + * @description + * Use this method to register work which needs to be performed on module loading. + * For more about how to configure services, see + * {@link providers#provider-recipe Provider Recipe}. + */ + config: config, + + /** + * @ngdoc method + * @name angular.Module#run + * @module ng + * @param {Function} initializationFn Execute this function after injector creation. + * Useful for application initialization. + * @description + * Use this method to register work which should be performed when the injector is done + * loading all modules. + */ + run: function(block) { + runBlocks.push(block); + return this; + } + }; + + if (configFn) { + config(configFn); + } + + return moduleInstance; + + /** + * @param {string} provider + * @param {string} method + * @param {String=} insertMethod + * @returns {angular.Module} + */ + function invokeLater(provider, method, insertMethod, queue) { + if (!queue) queue = invokeQueue; + return function() { + queue[insertMethod || 'push']([provider, method, arguments]); + return moduleInstance; + }; + } + + /** + * @param {string} provider + * @param {string} method + * @returns {angular.Module} + */ + function invokeLaterAndSetModuleName(provider, method) { + return function(recipeName, factoryFunction) { + if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name; + invokeQueue.push([provider, method, arguments]); + return moduleInstance; + }; + } + }); + }; + }); + + } + + /* global: toDebugString: true */ + + function serializeObject(obj) { + var seen = []; + + return JSON.stringify(obj, function(key, val) { + val = toJsonReplacer(key, val); + if (isObject(val)) { + + if (seen.indexOf(val) >= 0) return '...'; + + seen.push(val); + } + return val; + }); + } + + function toDebugString(obj) { + if (typeof obj === 'function') { + return obj.toString().replace(/ \{[\s\S]*$/, ''); + } else if (isUndefined(obj)) { + return 'undefined'; + } else if (typeof obj !== 'string') { + return serializeObject(obj); + } + return obj; + } + + /* global angularModule: true, + version: true, + + $CompileProvider, + + htmlAnchorDirective, + inputDirective, + inputDirective, + formDirective, + scriptDirective, + selectDirective, + styleDirective, + optionDirective, + ngBindDirective, + ngBindHtmlDirective, + ngBindTemplateDirective, + ngClassDirective, + ngClassEvenDirective, + ngClassOddDirective, + ngCloakDirective, + ngControllerDirective, + ngFormDirective, + ngHideDirective, + ngIfDirective, + ngIncludeDirective, + ngIncludeFillContentDirective, + ngInitDirective, + ngNonBindableDirective, + ngPluralizeDirective, + ngRepeatDirective, + ngShowDirective, + ngStyleDirective, + ngSwitchDirective, + ngSwitchWhenDirective, + ngSwitchDefaultDirective, + ngOptionsDirective, + ngTranscludeDirective, + ngModelDirective, + ngListDirective, + ngChangeDirective, + patternDirective, + patternDirective, + requiredDirective, + requiredDirective, + minlengthDirective, + minlengthDirective, + maxlengthDirective, + maxlengthDirective, + ngValueDirective, + ngModelOptionsDirective, + ngAttributeAliasDirectives, + ngEventDirectives, + + $AnchorScrollProvider, + $AnimateProvider, + $CoreAnimateCssProvider, + $$CoreAnimateQueueProvider, + $$CoreAnimateRunnerProvider, + $BrowserProvider, + $CacheFactoryProvider, + $ControllerProvider, + $DocumentProvider, + $ExceptionHandlerProvider, + $FilterProvider, + $$ForceReflowProvider, + $InterpolateProvider, + $IntervalProvider, + $$HashMapProvider, + $HttpProvider, + $HttpParamSerializerProvider, + $HttpParamSerializerJQLikeProvider, + $HttpBackendProvider, + $xhrFactoryProvider, + $LocationProvider, + $LogProvider, + $ParseProvider, + $RootScopeProvider, + $QProvider, + $$QProvider, + $$SanitizeUriProvider, + $SceProvider, + $SceDelegateProvider, + $SnifferProvider, + $TemplateCacheProvider, + $TemplateRequestProvider, + $$TestabilityProvider, + $TimeoutProvider, + $$RAFProvider, + $WindowProvider, + $$jqLiteProvider, + $$CookieReaderProvider + */ + + + /** + * @ngdoc object + * @name angular.version + * @module ng + * @description + * An object that contains information about the current AngularJS version. + * + * This object has the following properties: + * + * - `full` – `{string}` – Full version string, such as "0.9.18". + * - `major` – `{number}` – Major version number, such as "0". + * - `minor` – `{number}` – Minor version number, such as "9". + * - `dot` – `{number}` – Dot version number, such as "18". + * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". + */ + var version = { + full: '1.4.7', // all of these placeholder strings will be replaced by grunt's + major: 1, // package task + minor: 4, + dot: 7, + codeName: 'dark-luminescence' + }; + + + function publishExternalAPI(angular) { + extend(angular, { + 'bootstrap': bootstrap, + 'copy': copy, + 'extend': extend, + 'merge': merge, + 'equals': equals, + 'element': jqLite, + 'forEach': forEach, + 'injector': createInjector, + 'noop': noop, + 'bind': bind, + 'toJson': toJson, + 'fromJson': fromJson, + 'identity': identity, + 'isUndefined': isUndefined, + 'isDefined': isDefined, + 'isString': isString, + 'isFunction': isFunction, + 'isObject': isObject, + 'isNumber': isNumber, + 'isElement': isElement, + 'isArray': isArray, + 'version': version, + 'isDate': isDate, + 'lowercase': lowercase, + 'uppercase': uppercase, + 'callbacks': {counter: 0}, + 'getTestability': getTestability, + '$$minErr': minErr, + '$$csp': csp, + 'reloadWithDebugInfo': reloadWithDebugInfo + }); + + angularModule = setupModuleLoader(window); + + angularModule('ng', ['ngLocale'], ['$provide', + function ngModule($provide) { + // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it. + $provide.provider({ + $$sanitizeUri: $$SanitizeUriProvider + }); + $provide.provider('$compile', $CompileProvider). + directive({ + a: htmlAnchorDirective, + input: inputDirective, + textarea: inputDirective, + form: formDirective, + script: scriptDirective, + select: selectDirective, + style: styleDirective, + option: optionDirective, + ngBind: ngBindDirective, + ngBindHtml: ngBindHtmlDirective, + ngBindTemplate: ngBindTemplateDirective, + ngClass: ngClassDirective, + ngClassEven: ngClassEvenDirective, + ngClassOdd: ngClassOddDirective, + ngCloak: ngCloakDirective, + ngController: ngControllerDirective, + ngForm: ngFormDirective, + ngHide: ngHideDirective, + ngIf: ngIfDirective, + ngInclude: ngIncludeDirective, + ngInit: ngInitDirective, + ngNonBindable: ngNonBindableDirective, + ngPluralize: ngPluralizeDirective, + ngRepeat: ngRepeatDirective, + ngShow: ngShowDirective, + ngStyle: ngStyleDirective, + ngSwitch: ngSwitchDirective, + ngSwitchWhen: ngSwitchWhenDirective, + ngSwitchDefault: ngSwitchDefaultDirective, + ngOptions: ngOptionsDirective, + ngTransclude: ngTranscludeDirective, + ngModel: ngModelDirective, + ngList: ngListDirective, + ngChange: ngChangeDirective, + pattern: patternDirective, + ngPattern: patternDirective, + required: requiredDirective, + ngRequired: requiredDirective, + minlength: minlengthDirective, + ngMinlength: minlengthDirective, + maxlength: maxlengthDirective, + ngMaxlength: maxlengthDirective, + ngValue: ngValueDirective, + ngModelOptions: ngModelOptionsDirective + }). + directive({ + ngInclude: ngIncludeFillContentDirective + }). + directive(ngAttributeAliasDirectives). + directive(ngEventDirectives); + $provide.provider({ + $anchorScroll: $AnchorScrollProvider, + $animate: $AnimateProvider, + $animateCss: $CoreAnimateCssProvider, + $$animateQueue: $$CoreAnimateQueueProvider, + $$AnimateRunner: $$CoreAnimateRunnerProvider, + $browser: $BrowserProvider, + $cacheFactory: $CacheFactoryProvider, + $controller: $ControllerProvider, + $document: $DocumentProvider, + $exceptionHandler: $ExceptionHandlerProvider, + $filter: $FilterProvider, + $$forceReflow: $$ForceReflowProvider, + $interpolate: $InterpolateProvider, + $interval: $IntervalProvider, + $http: $HttpProvider, + $httpParamSerializer: $HttpParamSerializerProvider, + $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider, + $httpBackend: $HttpBackendProvider, + $xhrFactory: $xhrFactoryProvider, + $location: $LocationProvider, + $log: $LogProvider, + $parse: $ParseProvider, + $rootScope: $RootScopeProvider, + $q: $QProvider, + $$q: $$QProvider, + $sce: $SceProvider, + $sceDelegate: $SceDelegateProvider, + $sniffer: $SnifferProvider, + $templateCache: $TemplateCacheProvider, + $templateRequest: $TemplateRequestProvider, + $$testability: $$TestabilityProvider, + $timeout: $TimeoutProvider, + $window: $WindowProvider, + $$rAF: $$RAFProvider, + $$jqLite: $$jqLiteProvider, + $$HashMap: $$HashMapProvider, + $$cookieReader: $$CookieReaderProvider + }); + } + ]); + } + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /* global JQLitePrototype: true, + addEventListenerFn: true, + removeEventListenerFn: true, + BOOLEAN_ATTR: true, + ALIASED_ATTR: true, + */ + + ////////////////////////////////// + //JQLite + ////////////////////////////////// + + /** + * @ngdoc function + * @name angular.element + * @module ng + * @kind function + * + * @description + * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. + * + * If jQuery is available, `angular.element` is an alias for the + * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element` + * delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." + * + *
    jqLite is a tiny, API-compatible subset of jQuery that allows + * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most + * commonly needed functionality with the goal of having a very small footprint.
    + * + * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. + * + *
    **Note:** all element references in Angular are always wrapped with jQuery or + * jqLite; they are never raw DOM references.
    + * + * ## Angular's jqLite + * jqLite provides only the following jQuery methods: + * + * - [`addClass()`](http://api.jquery.com/addClass/) + * - [`after()`](http://api.jquery.com/after/) + * - [`append()`](http://api.jquery.com/append/) + * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters + * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData + * - [`children()`](http://api.jquery.com/children/) - Does not support selectors + * - [`clone()`](http://api.jquery.com/clone/) + * - [`contents()`](http://api.jquery.com/contents/) + * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`. As a setter, does not convert numbers to strings or append 'px'. + * - [`data()`](http://api.jquery.com/data/) + * - [`detach()`](http://api.jquery.com/detach/) + * - [`empty()`](http://api.jquery.com/empty/) + * - [`eq()`](http://api.jquery.com/eq/) + * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name + * - [`hasClass()`](http://api.jquery.com/hasClass/) + * - [`html()`](http://api.jquery.com/html/) + * - [`next()`](http://api.jquery.com/next/) - Does not support selectors + * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData + * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter + * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors + * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors + * - [`prepend()`](http://api.jquery.com/prepend/) + * - [`prop()`](http://api.jquery.com/prop/) + * - [`ready()`](http://api.jquery.com/ready/) + * - [`remove()`](http://api.jquery.com/remove/) + * - [`removeAttr()`](http://api.jquery.com/removeAttr/) + * - [`removeClass()`](http://api.jquery.com/removeClass/) + * - [`removeData()`](http://api.jquery.com/removeData/) + * - [`replaceWith()`](http://api.jquery.com/replaceWith/) + * - [`text()`](http://api.jquery.com/text/) + * - [`toggleClass()`](http://api.jquery.com/toggleClass/) + * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers. + * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces or event object as parameter + * - [`val()`](http://api.jquery.com/val/) + * - [`wrap()`](http://api.jquery.com/wrap/) + * + * ## jQuery/jqLite Extras + * Angular also provides the following additional methods and events to both jQuery and jqLite: + * + * ### Events + * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event + * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM + * element before it is removed. + * + * ### Methods + * - `controller(name)` - retrieves the controller of the current element or its parent. By default + * retrieves controller associated with the `ngController` directive. If `name` is provided as + * camelCase directive name, then the controller for this directive will be retrieved (e.g. + * `'ngModel'`). + * - `injector()` - retrieves the injector of the current element or its parent. + * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current + * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to + * be enabled. + * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the + * current element. This getter should be used only on elements that contain a directive which starts a new isolate + * scope. Calling `scope()` on this element always returns the original non-isolate scope. + * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled. + * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top + * parent element is reached. + * + * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. + * @returns {Object} jQuery object. + */ + + JQLite.expando = 'ng339'; + + var jqCache = JQLite.cache = {}, + jqId = 1, + addEventListenerFn = function(element, type, fn) { + element.addEventListener(type, fn, false); + }, + removeEventListenerFn = function(element, type, fn) { + element.removeEventListener(type, fn, false); + }; + + /* + * !!! This is an undocumented "private" function !!! + */ + JQLite._data = function(node) { + //jQuery always returns an object on cache miss + return this.cache[node[this.expando]] || {}; + }; + + function jqNextId() { return ++jqId; } + + + var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; + var MOZ_HACK_REGEXP = /^moz([A-Z])/; + var MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"}; + var jqLiteMinErr = minErr('jqLite'); + + /** + * Converts snake_case to camelCase. + * Also there is special case for Moz prefix starting with upper case letter. + * @param name Name to normalize + */ + function camelCase(name) { + return name. + replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { + return offset ? letter.toUpperCase() : letter; + }). + replace(MOZ_HACK_REGEXP, 'Moz$1'); + } + + var SINGLE_TAG_REGEXP = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/; + var HTML_REGEXP = /<|&#?\w+;/; + var TAG_NAME_REGEXP = /<([\w:-]+)/; + var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi; + + var wrapMap = { + 'option': [1, ''], + + 'thead': [1, '', '
    '], + 'col': [2, '', '
    '], + 'tr': [2, '', '
    '], + 'td': [3, '', '
    '], + '_default': [0, "", ""] + }; + + wrapMap.optgroup = wrapMap.option; + wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; + wrapMap.th = wrapMap.td; + + + function jqLiteIsTextNode(html) { + return !HTML_REGEXP.test(html); + } + + function jqLiteAcceptsData(node) { + // The window object can accept data but has no nodeType + // Otherwise we are only interested in elements (1) and documents (9) + var nodeType = node.nodeType; + return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT; + } + + function jqLiteHasData(node) { + for (var key in jqCache[node.ng339]) { + return true; + } + return false; + } + + function jqLiteBuildFragment(html, context) { + var tmp, tag, wrap, + fragment = context.createDocumentFragment(), + nodes = [], i; + + if (jqLiteIsTextNode(html)) { + // Convert non-html into a text node + nodes.push(context.createTextNode(html)); + } else { + // Convert html into DOM nodes + tmp = tmp || fragment.appendChild(context.createElement("div")); + tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase(); + wrap = wrapMap[tag] || wrapMap._default; + tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1>") + wrap[2]; + + // Descend through wrappers to the right content + i = wrap[0]; + while (i--) { + tmp = tmp.lastChild; + } + + nodes = concat(nodes, tmp.childNodes); + + tmp = fragment.firstChild; + tmp.textContent = ""; + } + + // Remove wrapper from fragment + fragment.textContent = ""; + fragment.innerHTML = ""; // Clear inner HTML + forEach(nodes, function(node) { + fragment.appendChild(node); + }); + + return fragment; + } + + function jqLiteParseHTML(html, context) { + context = context || document; + var parsed; + + if ((parsed = SINGLE_TAG_REGEXP.exec(html))) { + return [context.createElement(parsed[1])]; + } + + if ((parsed = jqLiteBuildFragment(html, context))) { + return parsed.childNodes; + } + + return []; + } + + ///////////////////////////////////////////// + function JQLite(element) { + if (element instanceof JQLite) { + return element; + } + + var argIsString; + + if (isString(element)) { + element = trim(element); + argIsString = true; + } + if (!(this instanceof JQLite)) { + if (argIsString && element.charAt(0) != '<') { + throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element'); + } + return new JQLite(element); + } + + if (argIsString) { + jqLiteAddNodes(this, jqLiteParseHTML(element)); + } else { + jqLiteAddNodes(this, element); + } + } + + function jqLiteClone(element) { + return element.cloneNode(true); + } + + function jqLiteDealoc(element, onlyDescendants) { + if (!onlyDescendants) jqLiteRemoveData(element); + + if (element.querySelectorAll) { + var descendants = element.querySelectorAll('*'); + for (var i = 0, l = descendants.length; i < l; i++) { + jqLiteRemoveData(descendants[i]); + } + } + } + + function jqLiteOff(element, type, fn, unsupported) { + if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument'); + + var expandoStore = jqLiteExpandoStore(element); + var events = expandoStore && expandoStore.events; + var handle = expandoStore && expandoStore.handle; + + if (!handle) return; //no listeners registered + + if (!type) { + for (type in events) { + if (type !== '$destroy') { + removeEventListenerFn(element, type, handle); + } + delete events[type]; + } + } else { + forEach(type.split(' '), function(type) { + if (isDefined(fn)) { + var listenerFns = events[type]; + arrayRemove(listenerFns || [], fn); + if (listenerFns && listenerFns.length > 0) { + return; + } + } + + removeEventListenerFn(element, type, handle); + delete events[type]; + }); + } + } + + function jqLiteRemoveData(element, name) { + var expandoId = element.ng339; + var expandoStore = expandoId && jqCache[expandoId]; + + if (expandoStore) { + if (name) { + delete expandoStore.data[name]; + return; + } + + if (expandoStore.handle) { + if (expandoStore.events.$destroy) { + expandoStore.handle({}, '$destroy'); + } + jqLiteOff(element); + } + delete jqCache[expandoId]; + element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it + } + } + + + function jqLiteExpandoStore(element, createIfNecessary) { + var expandoId = element.ng339, + expandoStore = expandoId && jqCache[expandoId]; + + if (createIfNecessary && !expandoStore) { + element.ng339 = expandoId = jqNextId(); + expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined}; + } + + return expandoStore; + } + + + function jqLiteData(element, key, value) { + if (jqLiteAcceptsData(element)) { + + var isSimpleSetter = isDefined(value); + var isSimpleGetter = !isSimpleSetter && key && !isObject(key); + var massGetter = !key; + var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter); + var data = expandoStore && expandoStore.data; + + if (isSimpleSetter) { // data('key', value) + data[key] = value; + } else { + if (massGetter) { // data() + return data; + } else { + if (isSimpleGetter) { // data('key') + // don't force creation of expandoStore if it doesn't exist yet + return data && data[key]; + } else { // mass-setter: data({key1: val1, key2: val2}) + extend(data, key); + } + } + } + } + } + + function jqLiteHasClass(element, selector) { + if (!element.getAttribute) return false; + return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " "). + indexOf(" " + selector + " ") > -1); + } + + function jqLiteRemoveClass(element, cssClasses) { + if (cssClasses && element.setAttribute) { + forEach(cssClasses.split(' '), function(cssClass) { + element.setAttribute('class', trim( + (" " + (element.getAttribute('class') || '') + " ") + .replace(/[\n\t]/g, " ") + .replace(" " + trim(cssClass) + " ", " ")) + ); + }); + } + } + + function jqLiteAddClass(element, cssClasses) { + if (cssClasses && element.setAttribute) { + var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') + .replace(/[\n\t]/g, " "); + + forEach(cssClasses.split(' '), function(cssClass) { + cssClass = trim(cssClass); + if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) { + existingClasses += cssClass + ' '; + } + }); + + element.setAttribute('class', trim(existingClasses)); + } + } + + + function jqLiteAddNodes(root, elements) { + // THIS CODE IS VERY HOT. Don't make changes without benchmarking. + + if (elements) { + + // if a Node (the most common case) + if (elements.nodeType) { + root[root.length++] = elements; + } else { + var length = elements.length; + + // if an Array or NodeList and not a Window + if (typeof length === 'number' && elements.window !== elements) { + if (length) { + for (var i = 0; i < length; i++) { + root[root.length++] = elements[i]; + } + } + } else { + root[root.length++] = elements; + } + } + } + } + + + function jqLiteController(element, name) { + return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller'); + } + + function jqLiteInheritedData(element, name, value) { + // if element is the document object work with the html element instead + // this makes $(document).scope() possible + if (element.nodeType == NODE_TYPE_DOCUMENT) { + element = element.documentElement; + } + var names = isArray(name) ? name : [name]; + + while (element) { + for (var i = 0, ii = names.length; i < ii; i++) { + if (isDefined(value = jqLite.data(element, names[i]))) return value; + } + + // If dealing with a document fragment node with a host element, and no parent, use the host + // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM + // to lookup parent controllers. + element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host); + } + } + + function jqLiteEmpty(element) { + jqLiteDealoc(element, true); + while (element.firstChild) { + element.removeChild(element.firstChild); + } + } + + function jqLiteRemove(element, keepData) { + if (!keepData) jqLiteDealoc(element); + var parent = element.parentNode; + if (parent) parent.removeChild(element); + } + + + function jqLiteDocumentLoaded(action, win) { + win = win || window; + if (win.document.readyState === 'complete') { + // Force the action to be run async for consistent behaviour + // from the action's point of view + // i.e. it will definitely not be in a $apply + win.setTimeout(action); + } else { + // No need to unbind this handler as load is only ever called once + jqLite(win).on('load', action); + } + } + + ////////////////////////////////////////// + // Functions which are declared directly. + ////////////////////////////////////////// + var JQLitePrototype = JQLite.prototype = { + ready: function(fn) { + var fired = false; + + function trigger() { + if (fired) return; + fired = true; + fn(); + } + + // check if document is already loaded + if (document.readyState === 'complete') { + setTimeout(trigger); + } else { + this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9 + // we can not use jqLite since we are not done loading and jQuery could be loaded later. + // jshint -W064 + JQLite(window).on('load', trigger); // fallback to window.onload for others + // jshint +W064 + } + }, + toString: function() { + var value = []; + forEach(this, function(e) { value.push('' + e);}); + return '[' + value.join(', ') + ']'; + }, + + eq: function(index) { + return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]); + }, + + length: 0, + push: push, + sort: [].sort, + splice: [].splice + }; + + ////////////////////////////////////////// + // Functions iterating getter/setters. + // these functions return self on setter and + // value on get. + ////////////////////////////////////////// + var BOOLEAN_ATTR = {}; + forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) { + BOOLEAN_ATTR[lowercase(value)] = value; + }); + var BOOLEAN_ELEMENTS = {}; + forEach('input,select,option,textarea,button,form,details'.split(','), function(value) { + BOOLEAN_ELEMENTS[value] = true; + }); + var ALIASED_ATTR = { + 'ngMinlength': 'minlength', + 'ngMaxlength': 'maxlength', + 'ngMin': 'min', + 'ngMax': 'max', + 'ngPattern': 'pattern' + }; + + function getBooleanAttrName(element, name) { + // check dom last since we will most likely fail on name + var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; + + // booleanAttr is here twice to minimize DOM access + return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr; + } + + function getAliasedAttrName(name) { + return ALIASED_ATTR[name]; + } + + forEach({ + data: jqLiteData, + removeData: jqLiteRemoveData, + hasData: jqLiteHasData + }, function(fn, name) { + JQLite[name] = fn; + }); + + forEach({ + data: jqLiteData, + inheritedData: jqLiteInheritedData, + + scope: function(element) { + // Can't use jqLiteData here directly so we stay compatible with jQuery! + return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']); + }, + + isolateScope: function(element) { + // Can't use jqLiteData here directly so we stay compatible with jQuery! + return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate'); + }, + + controller: jqLiteController, + + injector: function(element) { + return jqLiteInheritedData(element, '$injector'); + }, + + removeAttr: function(element, name) { + element.removeAttribute(name); + }, + + hasClass: jqLiteHasClass, + + css: function(element, name, value) { + name = camelCase(name); + + if (isDefined(value)) { + element.style[name] = value; + } else { + return element.style[name]; + } + }, + + attr: function(element, name, value) { + var nodeType = element.nodeType; + if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) { + return; + } + var lowercasedName = lowercase(name); + if (BOOLEAN_ATTR[lowercasedName]) { + if (isDefined(value)) { + if (!!value) { + element[name] = true; + element.setAttribute(name, lowercasedName); + } else { + element[name] = false; + element.removeAttribute(lowercasedName); + } + } else { + return (element[name] || + (element.attributes.getNamedItem(name) || noop).specified) + ? lowercasedName + : undefined; + } + } else if (isDefined(value)) { + element.setAttribute(name, value); + } else if (element.getAttribute) { + // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code + // some elements (e.g. Document) don't have get attribute, so return undefined + var ret = element.getAttribute(name, 2); + // normalize non-existing attributes to undefined (as jQuery) + return ret === null ? undefined : ret; + } + }, + + prop: function(element, name, value) { + if (isDefined(value)) { + element[name] = value; + } else { + return element[name]; + } + }, + + text: (function() { + getText.$dv = ''; + return getText; + + function getText(element, value) { + if (isUndefined(value)) { + var nodeType = element.nodeType; + return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : ''; + } + element.textContent = value; + } + })(), + + val: function(element, value) { + if (isUndefined(value)) { + if (element.multiple && nodeName_(element) === 'select') { + var result = []; + forEach(element.options, function(option) { + if (option.selected) { + result.push(option.value || option.text); + } + }); + return result.length === 0 ? null : result; + } + return element.value; + } + element.value = value; + }, + + html: function(element, value) { + if (isUndefined(value)) { + return element.innerHTML; + } + jqLiteDealoc(element, true); + element.innerHTML = value; + }, + + empty: jqLiteEmpty + }, function(fn, name) { + /** + * Properties: writes return selection, reads return first value + */ + JQLite.prototype[name] = function(arg1, arg2) { + var i, key; + var nodeCount = this.length; + + // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it + // in a way that survives minification. + // jqLiteEmpty takes no arguments but is a setter. + if (fn !== jqLiteEmpty && + (isUndefined((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) { + if (isObject(arg1)) { + + // we are a write, but the object properties are the key/values + for (i = 0; i < nodeCount; i++) { + if (fn === jqLiteData) { + // data() takes the whole object in jQuery + fn(this[i], arg1); + } else { + for (key in arg1) { + fn(this[i], key, arg1[key]); + } + } + } + // return self for chaining + return this; + } else { + // we are a read, so read the first child. + // TODO: do we still need this? + var value = fn.$dv; + // Only if we have $dv do we iterate over all, otherwise it is just the first element. + var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount; + for (var j = 0; j < jj; j++) { + var nodeValue = fn(this[j], arg1, arg2); + value = value ? value + nodeValue : nodeValue; + } + return value; + } + } else { + // we are a write, so apply to all children + for (i = 0; i < nodeCount; i++) { + fn(this[i], arg1, arg2); + } + // return self for chaining + return this; + } + }; + }); + + function createEventHandler(element, events) { + var eventHandler = function(event, type) { + // jQuery specific api + event.isDefaultPrevented = function() { + return event.defaultPrevented; + }; + + var eventFns = events[type || event.type]; + var eventFnsLength = eventFns ? eventFns.length : 0; + + if (!eventFnsLength) return; + + if (isUndefined(event.immediatePropagationStopped)) { + var originalStopImmediatePropagation = event.stopImmediatePropagation; + event.stopImmediatePropagation = function() { + event.immediatePropagationStopped = true; + + if (event.stopPropagation) { + event.stopPropagation(); + } + + if (originalStopImmediatePropagation) { + originalStopImmediatePropagation.call(event); + } + }; + } + + event.isImmediatePropagationStopped = function() { + return event.immediatePropagationStopped === true; + }; + + // Copy event handlers in case event handlers array is modified during execution. + if ((eventFnsLength > 1)) { + eventFns = shallowCopy(eventFns); + } + + for (var i = 0; i < eventFnsLength; i++) { + if (!event.isImmediatePropagationStopped()) { + eventFns[i].call(element, event); + } + } + }; + + // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all + // events on `element` + eventHandler.elem = element; + return eventHandler; + } + + ////////////////////////////////////////// + // Functions iterating traversal. + // These functions chain results into a single + // selector. + ////////////////////////////////////////// + forEach({ + removeData: jqLiteRemoveData, + + on: function jqLiteOn(element, type, fn, unsupported) { + if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); + + // Do not add event handlers to non-elements because they will not be cleaned up. + if (!jqLiteAcceptsData(element)) { + return; + } + + var expandoStore = jqLiteExpandoStore(element, true); + var events = expandoStore.events; + var handle = expandoStore.handle; + + if (!handle) { + handle = expandoStore.handle = createEventHandler(element, events); + } + + // http://jsperf.com/string-indexof-vs-split + var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type]; + var i = types.length; + + while (i--) { + type = types[i]; + var eventFns = events[type]; + + if (!eventFns) { + events[type] = []; + + if (type === 'mouseenter' || type === 'mouseleave') { + // Refer to jQuery's implementation of mouseenter & mouseleave + // Read about mouseenter and mouseleave: + // http://www.quirksmode.org/js/events_mouse.html#link8 + + jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) { + var target = this, related = event.relatedTarget; + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if (!related || (related !== target && !target.contains(related))) { + handle(event, type); + } + }); + + } else { + if (type !== '$destroy') { + addEventListenerFn(element, type, handle); + } + } + eventFns = events[type]; + } + eventFns.push(fn); + } + }, + + off: jqLiteOff, + + one: function(element, type, fn) { + element = jqLite(element); + + //add the listener twice so that when it is called + //you can remove the original function and still be + //able to call element.off(ev, fn) normally + element.on(type, function onFn() { + element.off(type, fn); + element.off(type, onFn); + }); + element.on(type, fn); + }, + + replaceWith: function(element, replaceNode) { + var index, parent = element.parentNode; + jqLiteDealoc(element); + forEach(new JQLite(replaceNode), function(node) { + if (index) { + parent.insertBefore(node, index.nextSibling); + } else { + parent.replaceChild(node, element); + } + index = node; + }); + }, + + children: function(element) { + var children = []; + forEach(element.childNodes, function(element) { + if (element.nodeType === NODE_TYPE_ELEMENT) { + children.push(element); + } + }); + return children; + }, + + contents: function(element) { + return element.contentDocument || element.childNodes || []; + }, + + append: function(element, node) { + var nodeType = element.nodeType; + if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return; + + node = new JQLite(node); + + for (var i = 0, ii = node.length; i < ii; i++) { + var child = node[i]; + element.appendChild(child); + } + }, + + prepend: function(element, node) { + if (element.nodeType === NODE_TYPE_ELEMENT) { + var index = element.firstChild; + forEach(new JQLite(node), function(child) { + element.insertBefore(child, index); + }); + } + }, + + wrap: function(element, wrapNode) { + wrapNode = jqLite(wrapNode).eq(0).clone()[0]; + var parent = element.parentNode; + if (parent) { + parent.replaceChild(wrapNode, element); + } + wrapNode.appendChild(element); + }, + + remove: jqLiteRemove, + + detach: function(element) { + jqLiteRemove(element, true); + }, + + after: function(element, newElement) { + var index = element, parent = element.parentNode; + newElement = new JQLite(newElement); + + for (var i = 0, ii = newElement.length; i < ii; i++) { + var node = newElement[i]; + parent.insertBefore(node, index.nextSibling); + index = node; + } + }, + + addClass: jqLiteAddClass, + removeClass: jqLiteRemoveClass, + + toggleClass: function(element, selector, condition) { + if (selector) { + forEach(selector.split(' '), function(className) { + var classCondition = condition; + if (isUndefined(classCondition)) { + classCondition = !jqLiteHasClass(element, className); + } + (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className); + }); + } + }, + + parent: function(element) { + var parent = element.parentNode; + return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null; + }, + + next: function(element) { + return element.nextElementSibling; + }, + + find: function(element, selector) { + if (element.getElementsByTagName) { + return element.getElementsByTagName(selector); + } else { + return []; + } + }, + + clone: jqLiteClone, + + triggerHandler: function(element, event, extraParameters) { + + var dummyEvent, eventFnsCopy, handlerArgs; + var eventName = event.type || event; + var expandoStore = jqLiteExpandoStore(element); + var events = expandoStore && expandoStore.events; + var eventFns = events && events[eventName]; + + if (eventFns) { + // Create a dummy event to pass to the handlers + dummyEvent = { + preventDefault: function() { this.defaultPrevented = true; }, + isDefaultPrevented: function() { return this.defaultPrevented === true; }, + stopImmediatePropagation: function() { this.immediatePropagationStopped = true; }, + isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; }, + stopPropagation: noop, + type: eventName, + target: element + }; + + // If a custom event was provided then extend our dummy event with it + if (event.type) { + dummyEvent = extend(dummyEvent, event); + } + + // Copy event handlers in case event handlers array is modified during execution. + eventFnsCopy = shallowCopy(eventFns); + handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent]; + + forEach(eventFnsCopy, function(fn) { + if (!dummyEvent.isImmediatePropagationStopped()) { + fn.apply(element, handlerArgs); + } + }); + } + } + }, function(fn, name) { + /** + * chaining functions + */ + JQLite.prototype[name] = function(arg1, arg2, arg3) { + var value; + + for (var i = 0, ii = this.length; i < ii; i++) { + if (isUndefined(value)) { + value = fn(this[i], arg1, arg2, arg3); + if (isDefined(value)) { + // any function which returns a value needs to be wrapped + value = jqLite(value); + } + } else { + jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3)); + } + } + return isDefined(value) ? value : this; + }; + + // bind legacy bind/unbind to on/off + JQLite.prototype.bind = JQLite.prototype.on; + JQLite.prototype.unbind = JQLite.prototype.off; + }); + + + // Provider for private $$jqLite service + function $$jqLiteProvider() { + this.$get = function $$jqLite() { + return extend(JQLite, { + hasClass: function(node, classes) { + if (node.attr) node = node[0]; + return jqLiteHasClass(node, classes); + }, + addClass: function(node, classes) { + if (node.attr) node = node[0]; + return jqLiteAddClass(node, classes); + }, + removeClass: function(node, classes) { + if (node.attr) node = node[0]; + return jqLiteRemoveClass(node, classes); + } + }); + }; + } + + /** + * Computes a hash of an 'obj'. + * Hash of a: + * string is string + * number is number as string + * object is either result of calling $$hashKey function on the object or uniquely generated id, + * that is also assigned to the $$hashKey property of the object. + * + * @param obj + * @returns {string} hash string such that the same input will have the same hash string. + * The resulting string key is in 'type:hashKey' format. + */ + function hashKey(obj, nextUidFn) { + var key = obj && obj.$$hashKey; + + if (key) { + if (typeof key === 'function') { + key = obj.$$hashKey(); + } + return key; + } + + var objType = typeof obj; + if (objType == 'function' || (objType == 'object' && obj !== null)) { + key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)(); + } else { + key = objType + ':' + obj; + } + + return key; + } + + /** + * HashMap which can use objects as keys + */ + function HashMap(array, isolatedUid) { + if (isolatedUid) { + var uid = 0; + this.nextUid = function() { + return ++uid; + }; + } + forEach(array, this.put, this); + } + HashMap.prototype = { + /** + * Store key value pair + * @param key key to store can be any type + * @param value value to store can be any type + */ + put: function(key, value) { + this[hashKey(key, this.nextUid)] = value; + }, + + /** + * @param key + * @returns {Object} the value for the key + */ + get: function(key) { + return this[hashKey(key, this.nextUid)]; + }, + + /** + * Remove the key/value pair + * @param key + */ + remove: function(key) { + var value = this[key = hashKey(key, this.nextUid)]; + delete this[key]; + return value; + } + }; + + var $$HashMapProvider = [function() { + this.$get = [function() { + return HashMap; + }]; + }]; + + /** + * @ngdoc function + * @module ng + * @name angular.injector + * @kind function + * + * @description + * Creates an injector object that can be used for retrieving services as well as for + * dependency injection (see {@link guide/di dependency injection}). + * + * @param {Array.} modules A list of module functions or their aliases. See + * {@link angular.module}. The `ng` module must be explicitly added. + * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which + * disallows argument name annotation inference. + * @returns {injector} Injector object. See {@link auto.$injector $injector}. + * + * @example + * Typical usage + * ```js + * // create an injector + * var $injector = angular.injector(['ng']); + * + * // use the injector to kick off your application + * // use the type inference to auto inject arguments, or use implicit injection + * $injector.invoke(function($rootScope, $compile, $document) { + * $compile($document)($rootScope); + * $rootScope.$digest(); + * }); + * ``` + * + * Sometimes you want to get access to the injector of a currently running Angular app + * from outside Angular. Perhaps, you want to inject and compile some markup after the + * application has been bootstrapped. You can do this using the extra `injector()` added + * to JQuery/jqLite elements. See {@link angular.element}. + * + * *This is fairly rare but could be the case if a third party library is injecting the + * markup.* + * + * In the following example a new block of HTML containing a `ng-controller` + * directive is added to the end of the document body by JQuery. We then compile and link + * it into the current AngularJS scope. + * + * ```js + * var $div = $('
    {{content.label}}
    '); + * $(document.body).append($div); + * + * angular.element(document).injector().invoke(function($compile) { + * var scope = angular.element($div).scope(); + * $compile($div)(scope); + * }); + * ``` + */ + + + /** + * @ngdoc module + * @name auto + * @description + * + * Implicit module which gets automatically added to each {@link auto.$injector $injector}. + */ + + var FN_ARGS = /^[^\(]*\(\s*([^\)]*)\)/m; + var FN_ARG_SPLIT = /,/; + var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; + var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; + var $injectorMinErr = minErr('$injector'); + + function anonFn(fn) { + // For anonymous functions, showing at the very least the function signature can help in + // debugging. + var fnText = fn.toString().replace(STRIP_COMMENTS, ''), + args = fnText.match(FN_ARGS); + if (args) { + return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')'; + } + return 'fn'; + } + + function annotate(fn, strictDi, name) { + var $inject, + fnText, + argDecl, + last; + + if (typeof fn === 'function') { + if (!($inject = fn.$inject)) { + $inject = []; + if (fn.length) { + if (strictDi) { + if (!isString(name) || !name) { + name = fn.name || anonFn(fn); + } + throw $injectorMinErr('strictdi', + '{0} is not using explicit annotation and cannot be invoked in strict mode', name); + } + fnText = fn.toString().replace(STRIP_COMMENTS, ''); + argDecl = fnText.match(FN_ARGS); + forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) { + arg.replace(FN_ARG, function(all, underscore, name) { + $inject.push(name); + }); + }); + } + fn.$inject = $inject; + } + } else if (isArray(fn)) { + last = fn.length - 1; + assertArgFn(fn[last], 'fn'); + $inject = fn.slice(0, last); + } else { + assertArgFn(fn, 'fn', true); + } + return $inject; + } + + /////////////////////////////////////// + + /** + * @ngdoc service + * @name $injector + * + * @description + * + * `$injector` is used to retrieve object instances as defined by + * {@link auto.$provide provider}, instantiate types, invoke methods, + * and load modules. + * + * The following always holds true: + * + * ```js + * var $injector = angular.injector(); + * expect($injector.get('$injector')).toBe($injector); + * expect($injector.invoke(function($injector) { + * return $injector; + * })).toBe($injector); + * ``` + * + * # Injection Function Annotation + * + * JavaScript does not have annotations, and annotations are needed for dependency injection. The + * following are all valid ways of annotating function with injection arguments and are equivalent. + * + * ```js + * // inferred (only works if code not minified/obfuscated) + * $injector.invoke(function(serviceA){}); + * + * // annotated + * function explicit(serviceA) {}; + * explicit.$inject = ['serviceA']; + * $injector.invoke(explicit); + * + * // inline + * $injector.invoke(['serviceA', function(serviceA){}]); + * ``` + * + * ## Inference + * + * In JavaScript calling `toString()` on a function returns the function definition. The definition + * can then be parsed and the function arguments can be extracted. This method of discovering + * annotations is disallowed when the injector is in strict mode. + * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the + * argument names. + * + * ## `$inject` Annotation + * By adding an `$inject` property onto a function the injection parameters can be specified. + * + * ## Inline + * As an array of injection names, where the last item in the array is the function to call. + */ + + /** + * @ngdoc method + * @name $injector#get + * + * @description + * Return an instance of the service. + * + * @param {string} name The name of the instance to retrieve. + * @param {string=} caller An optional string to provide the origin of the function call for error messages. + * @return {*} The instance. + */ + + /** + * @ngdoc method + * @name $injector#invoke + * + * @description + * Invoke the method and supply the method arguments from the `$injector`. + * + * @param {Function|Array.} fn The injectable function to invoke. Function parameters are + * injected according to the {@link guide/di $inject Annotation} rules. + * @param {Object=} self The `this` for the invoked method. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + * object first, before the `$injector` is consulted. + * @returns {*} the value returned by the invoked `fn` function. + */ + + /** + * @ngdoc method + * @name $injector#has + * + * @description + * Allows the user to query if the particular service exists. + * + * @param {string} name Name of the service to query. + * @returns {boolean} `true` if injector has given service. + */ + + /** + * @ngdoc method + * @name $injector#instantiate + * @description + * Create a new instance of JS type. The method takes a constructor function, invokes the new + * operator, and supplies all of the arguments to the constructor function as specified by the + * constructor annotation. + * + * @param {Function} Type Annotated constructor function. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + * object first, before the `$injector` is consulted. + * @returns {Object} new instance of `Type`. + */ + + /** + * @ngdoc method + * @name $injector#annotate + * + * @description + * Returns an array of service names which the function is requesting for injection. This API is + * used by the injector to determine which services need to be injected into the function when the + * function is invoked. There are three ways in which the function can be annotated with the needed + * dependencies. + * + * # Argument names + * + * The simplest form is to extract the dependencies from the arguments of the function. This is done + * by converting the function into a string using `toString()` method and extracting the argument + * names. + * ```js + * // Given + * function MyController($scope, $route) { + * // ... + * } + * + * // Then + * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); + * ``` + * + * You can disallow this method by using strict injection mode. + * + * This method does not work with code minification / obfuscation. For this reason the following + * annotation strategies are supported. + * + * # The `$inject` property + * + * If a function has an `$inject` property and its value is an array of strings, then the strings + * represent names of services to be injected into the function. + * ```js + * // Given + * var MyController = function(obfuscatedScope, obfuscatedRoute) { + * // ... + * } + * // Define function dependencies + * MyController['$inject'] = ['$scope', '$route']; + * + * // Then + * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); + * ``` + * + * # The array notation + * + * It is often desirable to inline Injected functions and that's when setting the `$inject` property + * is very inconvenient. In these situations using the array notation to specify the dependencies in + * a way that survives minification is a better choice: + * + * ```js + * // We wish to write this (not minification / obfuscation safe) + * injector.invoke(function($compile, $rootScope) { + * // ... + * }); + * + * // We are forced to write break inlining + * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) { + * // ... + * }; + * tmpFn.$inject = ['$compile', '$rootScope']; + * injector.invoke(tmpFn); + * + * // To better support inline function the inline annotation is supported + * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) { + * // ... + * }]); + * + * // Therefore + * expect(injector.annotate( + * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}]) + * ).toEqual(['$compile', '$rootScope']); + * ``` + * + * @param {Function|Array.} fn Function for which dependent service names need to + * be retrieved as described above. + * + * @param {boolean=} [strictDi=false] Disallow argument name annotation inference. + * + * @returns {Array.} The names of the services which the function requires. + */ + + + + + /** + * @ngdoc service + * @name $provide + * + * @description + * + * The {@link auto.$provide $provide} service has a number of methods for registering components + * with the {@link auto.$injector $injector}. Many of these functions are also exposed on + * {@link angular.Module}. + * + * An Angular **service** is a singleton object created by a **service factory**. These **service + * factories** are functions which, in turn, are created by a **service provider**. + * The **service providers** are constructor functions. When instantiated they must contain a + * property called `$get`, which holds the **service factory** function. + * + * When you request a service, the {@link auto.$injector $injector} is responsible for finding the + * correct **service provider**, instantiating it and then calling its `$get` **service factory** + * function to get the instance of the **service**. + * + * Often services have no configuration options and there is no need to add methods to the service + * provider. The provider will be no more than a constructor function with a `$get` property. For + * these cases the {@link auto.$provide $provide} service has additional helper methods to register + * services without specifying a provider. + * + * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the + * {@link auto.$injector $injector} + * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by + * providers and services. + * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by + * services, not providers. + * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`, + * that will be wrapped in a **service provider** object, whose `$get` property will contain the + * given factory function. + * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class` + * that will be wrapped in a **service provider** object, whose `$get` property will instantiate + * a new object using the given constructor function. + * + * See the individual methods for more information and examples. + */ + + /** + * @ngdoc method + * @name $provide#provider + * @description + * + * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions + * are constructor functions, whose instances are responsible for "providing" a factory for a + * service. + * + * Service provider names start with the name of the service they provide followed by `Provider`. + * For example, the {@link ng.$log $log} service has a provider called + * {@link ng.$logProvider $logProvider}. + * + * Service provider objects can have additional methods which allow configuration of the provider + * and its service. Importantly, you can configure what kind of service is created by the `$get` + * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a + * method {@link ng.$logProvider#debugEnabled debugEnabled} + * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the + * console or not. + * + * @param {string} name The name of the instance. NOTE: the provider will be available under `name + + 'Provider'` key. + * @param {(Object|function())} provider If the provider is: + * + * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using + * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created. + * - `Constructor`: a new instance of the provider will be created using + * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`. + * + * @returns {Object} registered provider instance + + * @example + * + * The following example shows how to create a simple event tracking service and register it using + * {@link auto.$provide#provider $provide.provider()}. + * + * ```js + * // Define the eventTracker provider + * function EventTrackerProvider() { + * var trackingUrl = '/track'; + * + * // A provider method for configuring where the tracked events should been saved + * this.setTrackingUrl = function(url) { + * trackingUrl = url; + * }; + * + * // The service factory function + * this.$get = ['$http', function($http) { + * var trackedEvents = {}; + * return { + * // Call this to track an event + * event: function(event) { + * var count = trackedEvents[event] || 0; + * count += 1; + * trackedEvents[event] = count; + * return count; + * }, + * // Call this to save the tracked events to the trackingUrl + * save: function() { + * $http.post(trackingUrl, trackedEvents); + * } + * }; + * }]; + * } + * + * describe('eventTracker', function() { + * var postSpy; + * + * beforeEach(module(function($provide) { + * // Register the eventTracker provider + * $provide.provider('eventTracker', EventTrackerProvider); + * })); + * + * beforeEach(module(function(eventTrackerProvider) { + * // Configure eventTracker provider + * eventTrackerProvider.setTrackingUrl('/custom-track'); + * })); + * + * it('tracks events', inject(function(eventTracker) { + * expect(eventTracker.event('login')).toEqual(1); + * expect(eventTracker.event('login')).toEqual(2); + * })); + * + * it('saves to the tracking url', inject(function(eventTracker, $http) { + * postSpy = spyOn($http, 'post'); + * eventTracker.event('login'); + * eventTracker.save(); + * expect(postSpy).toHaveBeenCalled(); + * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track'); + * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track'); + * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 }); + * })); + * }); + * ``` + */ + + /** + * @ngdoc method + * @name $provide#factory + * @description + * + * Register a **service factory**, which will be called to return the service instance. + * This is short for registering a service where its provider consists of only a `$get` property, + * which is the given service factory function. + * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to + * configure your service in a provider. + * + * @param {string} name The name of the instance. + * @param {Function|Array.} $getFn The injectable $getFn for the instance creation. + * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`. + * @returns {Object} registered provider instance + * + * @example + * Here is an example of registering a service + * ```js + * $provide.factory('ping', ['$http', function($http) { + * return function ping() { + * return $http.send('/ping'); + * }; + * }]); + * ``` + * You would then inject and use this service like this: + * ```js + * someModule.controller('Ctrl', ['ping', function(ping) { + * ping(); + * }]); + * ``` + */ + + + /** + * @ngdoc method + * @name $provide#service + * @description + * + * Register a **service constructor**, which will be invoked with `new` to create the service + * instance. + * This is short for registering a service where its provider's `$get` property is the service + * constructor function that will be used to instantiate the service instance. + * + * You should use {@link auto.$provide#service $provide.service(class)} if you define your service + * as a type/class. + * + * @param {string} name The name of the instance. + * @param {Function|Array.} constructor An injectable class (constructor function) + * that will be instantiated. + * @returns {Object} registered provider instance + * + * @example + * Here is an example of registering a service using + * {@link auto.$provide#service $provide.service(class)}. + * ```js + * var Ping = function($http) { + * this.$http = $http; + * }; + * + * Ping.$inject = ['$http']; + * + * Ping.prototype.send = function() { + * return this.$http.get('/ping'); + * }; + * $provide.service('ping', Ping); + * ``` + * You would then inject and use this service like this: + * ```js + * someModule.controller('Ctrl', ['ping', function(ping) { + * ping.send(); + * }]); + * ``` + */ + + + /** + * @ngdoc method + * @name $provide#value + * @description + * + * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a + * number, an array, an object or a function. This is short for registering a service where its + * provider's `$get` property is a factory function that takes no arguments and returns the **value + * service**. + * + * Value services are similar to constant services, except that they cannot be injected into a + * module configuration function (see {@link angular.Module#config}) but they can be overridden by + * an Angular + * {@link auto.$provide#decorator decorator}. + * + * @param {string} name The name of the instance. + * @param {*} value The value. + * @returns {Object} registered provider instance + * + * @example + * Here are some examples of creating value services. + * ```js + * $provide.value('ADMIN_USER', 'admin'); + * + * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 }); + * + * $provide.value('halfOf', function(value) { + * return value / 2; + * }); + * ``` + */ + + + /** + * @ngdoc method + * @name $provide#constant + * @description + * + * Register a **constant service**, such as a string, a number, an array, an object or a function, + * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be + * injected into a module configuration function (see {@link angular.Module#config}) and it cannot + * be overridden by an Angular {@link auto.$provide#decorator decorator}. + * + * @param {string} name The name of the constant. + * @param {*} value The constant value. + * @returns {Object} registered instance + * + * @example + * Here a some examples of creating constants: + * ```js + * $provide.constant('SHARD_HEIGHT', 306); + * + * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']); + * + * $provide.constant('double', function(value) { + * return value * 2; + * }); + * ``` + */ + + + /** + * @ngdoc method + * @name $provide#decorator + * @description + * + * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator + * intercepts the creation of a service, allowing it to override or modify the behaviour of the + * service. The object returned by the decorator may be the original service, or a new service + * object which replaces or wraps and delegates to the original service. + * + * @param {string} name The name of the service to decorate. + * @param {Function|Array.} decorator This function will be invoked when the service needs to be + * instantiated and should return the decorated service instance. The function is called using + * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable. + * Local injection arguments: + * + * * `$delegate` - The original service instance, which can be monkey patched, configured, + * decorated or delegated to. + * + * @example + * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting + * calls to {@link ng.$log#error $log.warn()}. + * ```js + * $provide.decorator('$log', ['$delegate', function($delegate) { + * $delegate.warn = $delegate.error; + * return $delegate; + * }]); + * ``` + */ + + + function createInjector(modulesToLoad, strictDi) { + strictDi = (strictDi === true); + var INSTANTIATING = {}, + providerSuffix = 'Provider', + path = [], + loadedModules = new HashMap([], true), + providerCache = { + $provide: { + provider: supportObject(provider), + factory: supportObject(factory), + service: supportObject(service), + value: supportObject(value), + constant: supportObject(constant), + decorator: decorator + } + }, + providerInjector = (providerCache.$injector = + createInternalInjector(providerCache, function(serviceName, caller) { + if (angular.isString(caller)) { + path.push(caller); + } + throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- ')); + })), + instanceCache = {}, + instanceInjector = (instanceCache.$injector = + createInternalInjector(instanceCache, function(serviceName, caller) { + var provider = providerInjector.get(serviceName + providerSuffix, caller); + return instanceInjector.invoke(provider.$get, provider, undefined, serviceName); + })); + + + forEach(loadModules(modulesToLoad), function(fn) { if (fn) instanceInjector.invoke(fn); }); + + return instanceInjector; + + //////////////////////////////////// + // $provider + //////////////////////////////////// + + function supportObject(delegate) { + return function(key, value) { + if (isObject(key)) { + forEach(key, reverseParams(delegate)); + } else { + return delegate(key, value); + } + }; + } + + function provider(name, provider_) { + assertNotHasOwnProperty(name, 'service'); + if (isFunction(provider_) || isArray(provider_)) { + provider_ = providerInjector.instantiate(provider_); + } + if (!provider_.$get) { + throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name); + } + return providerCache[name + providerSuffix] = provider_; + } + + function enforceReturnValue(name, factory) { + return function enforcedReturnValue() { + var result = instanceInjector.invoke(factory, this); + if (isUndefined(result)) { + throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name); + } + return result; + }; + } + + function factory(name, factoryFn, enforce) { + return provider(name, { + $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn + }); + } + + function service(name, constructor) { + return factory(name, ['$injector', function($injector) { + return $injector.instantiate(constructor); + }]); + } + + function value(name, val) { return factory(name, valueFn(val), false); } + + function constant(name, value) { + assertNotHasOwnProperty(name, 'constant'); + providerCache[name] = value; + instanceCache[name] = value; + } + + function decorator(serviceName, decorFn) { + var origProvider = providerInjector.get(serviceName + providerSuffix), + orig$get = origProvider.$get; + + origProvider.$get = function() { + var origInstance = instanceInjector.invoke(orig$get, origProvider); + return instanceInjector.invoke(decorFn, null, {$delegate: origInstance}); + }; + } + + //////////////////////////////////// + // Module Loading + //////////////////////////////////// + function loadModules(modulesToLoad) { + assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array'); + var runBlocks = [], moduleFn; + forEach(modulesToLoad, function(module) { + if (loadedModules.get(module)) return; + loadedModules.put(module, true); + + function runInvokeQueue(queue) { + var i, ii; + for (i = 0, ii = queue.length; i < ii; i++) { + var invokeArgs = queue[i], + provider = providerInjector.get(invokeArgs[0]); + + provider[invokeArgs[1]].apply(provider, invokeArgs[2]); + } + } + + try { + if (isString(module)) { + moduleFn = angularModule(module); + runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); + runInvokeQueue(moduleFn._invokeQueue); + runInvokeQueue(moduleFn._configBlocks); + } else if (isFunction(module)) { + runBlocks.push(providerInjector.invoke(module)); + } else if (isArray(module)) { + runBlocks.push(providerInjector.invoke(module)); + } else { + assertArgFn(module, 'module'); + } + } catch (e) { + if (isArray(module)) { + module = module[module.length - 1]; + } + if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { + // Safari & FF's stack traces don't contain error.message content + // unlike those of Chrome and IE + // So if stack doesn't contain message, we create a new string that contains both. + // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. + /* jshint -W022 */ + e = e.message + '\n' + e.stack; + } + throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", + module, e.stack || e.message || e); + } + }); + return runBlocks; + } + + //////////////////////////////////// + // internal Injector + //////////////////////////////////// + + function createInternalInjector(cache, factory) { + + function getService(serviceName, caller) { + if (cache.hasOwnProperty(serviceName)) { + if (cache[serviceName] === INSTANTIATING) { + throw $injectorMinErr('cdep', 'Circular dependency found: {0}', + serviceName + ' <- ' + path.join(' <- ')); + } + return cache[serviceName]; + } else { + try { + path.unshift(serviceName); + cache[serviceName] = INSTANTIATING; + return cache[serviceName] = factory(serviceName, caller); + } catch (err) { + if (cache[serviceName] === INSTANTIATING) { + delete cache[serviceName]; + } + throw err; + } finally { + path.shift(); + } + } + } + + function invoke(fn, self, locals, serviceName) { + if (typeof locals === 'string') { + serviceName = locals; + locals = null; + } + + var args = [], + $inject = createInjector.$$annotate(fn, strictDi, serviceName), + length, i, + key; + + for (i = 0, length = $inject.length; i < length; i++) { + key = $inject[i]; + if (typeof key !== 'string') { + throw $injectorMinErr('itkn', + 'Incorrect injection token! Expected service name as string, got {0}', key); + } + args.push( + locals && locals.hasOwnProperty(key) + ? locals[key] + : getService(key, serviceName) + ); + } + if (isArray(fn)) { + fn = fn[length]; + } + + // http://jsperf.com/angularjs-invoke-apply-vs-switch + // #5388 + return fn.apply(self, args); + } + + function instantiate(Type, locals, serviceName) { + // Check if Type is annotated and use just the given function at n-1 as parameter + // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); + // Object creation: http://jsperf.com/create-constructor/2 + var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null); + var returnedValue = invoke(Type, instance, locals, serviceName); + + return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; + } + + return { + invoke: invoke, + instantiate: instantiate, + get: getService, + annotate: createInjector.$$annotate, + has: function(name) { + return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); + } + }; + } + } + + createInjector.$$annotate = annotate; + + /** + * @ngdoc provider + * @name $anchorScrollProvider + * + * @description + * Use `$anchorScrollProvider` to disable automatic scrolling whenever + * {@link ng.$location#hash $location.hash()} changes. + */ + function $AnchorScrollProvider() { + + var autoScrollingEnabled = true; + + /** + * @ngdoc method + * @name $anchorScrollProvider#disableAutoScrolling + * + * @description + * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to + * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
    + * Use this method to disable automatic scrolling. + * + * If automatic scrolling is disabled, one must explicitly call + * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the + * current hash. + */ + this.disableAutoScrolling = function() { + autoScrollingEnabled = false; + }; + + /** + * @ngdoc service + * @name $anchorScroll + * @kind function + * @requires $window + * @requires $location + * @requires $rootScope + * + * @description + * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the + * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified + * in the + * [HTML5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document). + * + * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to + * match any anchor whenever it changes. This can be disabled by calling + * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}. + * + * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a + * vertical scroll-offset (either fixed or dynamic). + * + * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of + * {@link ng.$location#hash $location.hash()} will be used. + * + * @property {(number|function|jqLite)} yOffset + * If set, specifies a vertical scroll-offset. This is often useful when there are fixed + * positioned elements at the top of the page, such as navbars, headers etc. + * + * `yOffset` can be specified in various ways: + * - **number**: A fixed number of pixels to be used as offset.

    + * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return + * a number representing the offset (in pixels).

    + * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from + * the top of the page to the element's bottom will be used as offset.
    + * **Note**: The element will be taken into account only as long as its `position` is set to + * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust + * their height and/or positioning according to the viewport's size. + * + *
    + *
    + * In order for `yOffset` to work properly, scrolling should take place on the document's root and + * not some child element. + *
    + * + * @example + + +
    + Go to bottom + You're at the bottom! +
    +
    + + angular.module('anchorScrollExample', []) + .controller('ScrollController', ['$scope', '$location', '$anchorScroll', + function ($scope, $location, $anchorScroll) { + $scope.gotoBottom = function() { + // set the location.hash to the id of + // the element you wish to scroll to. + $location.hash('bottom'); + + // call $anchorScroll() + $anchorScroll(); + }; + }]); + + + #scrollArea { + height: 280px; + overflow: auto; + } + + #bottom { + display: block; + margin-top: 2000px; + } + +
    + * + *
    + * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value). + * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details. + * + * @example + + + +
    + Anchor {{x}} of 5 +
    +
    + + angular.module('anchorScrollOffsetExample', []) + .run(['$anchorScroll', function($anchorScroll) { + $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels + }]) + .controller('headerCtrl', ['$anchorScroll', '$location', '$scope', + function ($anchorScroll, $location, $scope) { + $scope.gotoAnchor = function(x) { + var newHash = 'anchor' + x; + if ($location.hash() !== newHash) { + // set the $location.hash to `newHash` and + // $anchorScroll will automatically scroll to it + $location.hash('anchor' + x); + } else { + // call $anchorScroll() explicitly, + // since $location.hash hasn't changed + $anchorScroll(); + } + }; + } + ]); + + + body { + padding-top: 50px; + } + + .anchor { + border: 2px dashed DarkOrchid; + padding: 10px 10px 200px 10px; + } + + .fixed-header { + background-color: rgba(0, 0, 0, 0.2); + height: 50px; + position: fixed; + top: 0; left: 0; right: 0; + } + + .fixed-header > a { + display: inline-block; + margin: 5px 15px; + } + +
    + */ + this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { + var document = $window.document; + + // Helper function to get first anchor from a NodeList + // (using `Array#some()` instead of `angular#forEach()` since it's more performant + // and working in all supported browsers.) + function getFirstAnchor(list) { + var result = null; + Array.prototype.some.call(list, function(element) { + if (nodeName_(element) === 'a') { + result = element; + return true; + } + }); + return result; + } + + function getYOffset() { + + var offset = scroll.yOffset; + + if (isFunction(offset)) { + offset = offset(); + } else if (isElement(offset)) { + var elem = offset[0]; + var style = $window.getComputedStyle(elem); + if (style.position !== 'fixed') { + offset = 0; + } else { + offset = elem.getBoundingClientRect().bottom; + } + } else if (!isNumber(offset)) { + offset = 0; + } + + return offset; + } + + function scrollTo(elem) { + if (elem) { + elem.scrollIntoView(); + + var offset = getYOffset(); + + if (offset) { + // `offset` is the number of pixels we should scroll UP in order to align `elem` properly. + // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the + // top of the viewport. + // + // IF the number of pixels from the top of `elem` to the end of the page's content is less + // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some + // way down the page. + // + // This is often the case for elements near the bottom of the page. + // + // In such cases we do not need to scroll the whole `offset` up, just the difference between + // the top of the element and the offset, which is enough to align the top of `elem` at the + // desired position. + var elemTop = elem.getBoundingClientRect().top; + $window.scrollBy(0, elemTop - offset); + } + } else { + $window.scrollTo(0, 0); + } + } + + function scroll(hash) { + hash = isString(hash) ? hash : $location.hash(); + var elm; + + // empty hash, scroll to the top of the page + if (!hash) scrollTo(null); + + // element with given id + else if ((elm = document.getElementById(hash))) scrollTo(elm); + + // first anchor with given name :-D + else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm); + + // no element and hash == 'top', scroll to the top of the page + else if (hash === 'top') scrollTo(null); + } + + // does not scroll when user clicks on anchor link that is currently on + // (no url change, no $location.hash() change), browser native does scroll + if (autoScrollingEnabled) { + $rootScope.$watch(function autoScrollWatch() {return $location.hash();}, + function autoScrollWatchAction(newVal, oldVal) { + // skip the initial scroll if $location.hash is empty + if (newVal === oldVal && newVal === '') return; + + jqLiteDocumentLoaded(function() { + $rootScope.$evalAsync(scroll); + }); + }); + } + + return scroll; + }]; + } + + var $animateMinErr = minErr('$animate'); + var ELEMENT_NODE = 1; + var NG_ANIMATE_CLASSNAME = 'ng-animate'; + + function mergeClasses(a,b) { + if (!a && !b) return ''; + if (!a) return b; + if (!b) return a; + if (isArray(a)) a = a.join(' '); + if (isArray(b)) b = b.join(' '); + return a + ' ' + b; + } + + function extractElementNode(element) { + for (var i = 0; i < element.length; i++) { + var elm = element[i]; + if (elm.nodeType === ELEMENT_NODE) { + return elm; + } + } + } + + function splitClasses(classes) { + if (isString(classes)) { + classes = classes.split(' '); + } + + // Use createMap() to prevent class assumptions involving property names in + // Object.prototype + var obj = createMap(); + forEach(classes, function(klass) { + // sometimes the split leaves empty string values + // incase extra spaces were applied to the options + if (klass.length) { + obj[klass] = true; + } + }); + return obj; + } + + // if any other type of options value besides an Object value is + // passed into the $animate.method() animation then this helper code + // will be run which will ignore it. While this patch is not the + // greatest solution to this, a lot of existing plugins depend on + // $animate to either call the callback (< 1.2) or return a promise + // that can be changed. This helper function ensures that the options + // are wiped clean incase a callback function is provided. + function prepareAnimateOptions(options) { + return isObject(options) + ? options + : {}; + } + + var $$CoreAnimateRunnerProvider = function() { + this.$get = ['$q', '$$rAF', function($q, $$rAF) { + function AnimateRunner() {} + AnimateRunner.all = noop; + AnimateRunner.chain = noop; + AnimateRunner.prototype = { + end: noop, + cancel: noop, + resume: noop, + pause: noop, + complete: noop, + then: function(pass, fail) { + return $q(function(resolve) { + $$rAF(function() { + resolve(); + }); + }).then(pass, fail); + } + }; + return AnimateRunner; + }]; + }; + + // this is prefixed with Core since it conflicts with + // the animateQueueProvider defined in ngAnimate/animateQueue.js + var $$CoreAnimateQueueProvider = function() { + var postDigestQueue = new HashMap(); + var postDigestElements = []; + + this.$get = ['$$AnimateRunner', '$rootScope', + function($$AnimateRunner, $rootScope) { + return { + enabled: noop, + on: noop, + off: noop, + pin: noop, + + push: function(element, event, options, domOperation) { + domOperation && domOperation(); + + options = options || {}; + options.from && element.css(options.from); + options.to && element.css(options.to); + + if (options.addClass || options.removeClass) { + addRemoveClassesPostDigest(element, options.addClass, options.removeClass); + } + + return new $$AnimateRunner(); // jshint ignore:line + } + }; + + + function updateData(data, classes, value) { + var changed = false; + if (classes) { + classes = isString(classes) ? classes.split(' ') : + isArray(classes) ? classes : []; + forEach(classes, function(className) { + if (className) { + changed = true; + data[className] = value; + } + }); + } + return changed; + } + + function handleCSSClassChanges() { + forEach(postDigestElements, function(element) { + var data = postDigestQueue.get(element); + if (data) { + var existing = splitClasses(element.attr('class')); + var toAdd = ''; + var toRemove = ''; + forEach(data, function(status, className) { + var hasClass = !!existing[className]; + if (status !== hasClass) { + if (status) { + toAdd += (toAdd.length ? ' ' : '') + className; + } else { + toRemove += (toRemove.length ? ' ' : '') + className; + } + } + }); + + forEach(element, function(elm) { + toAdd && jqLiteAddClass(elm, toAdd); + toRemove && jqLiteRemoveClass(elm, toRemove); + }); + postDigestQueue.remove(element); + } + }); + postDigestElements.length = 0; + } + + + function addRemoveClassesPostDigest(element, add, remove) { + var data = postDigestQueue.get(element) || {}; + + var classesAdded = updateData(data, add, true); + var classesRemoved = updateData(data, remove, false); + + if (classesAdded || classesRemoved) { + + postDigestQueue.put(element, data); + postDigestElements.push(element); + + if (postDigestElements.length === 1) { + $rootScope.$$postDigest(handleCSSClassChanges); + } + } + } + }]; + }; + + /** + * @ngdoc provider + * @name $animateProvider + * + * @description + * Default implementation of $animate that doesn't perform any animations, instead just + * synchronously performs DOM updates and resolves the returned runner promise. + * + * In order to enable animations the `ngAnimate` module has to be loaded. + * + * To see the functional implementation check out `src/ngAnimate/animate.js`. + */ + var $AnimateProvider = ['$provide', function($provide) { + var provider = this; + + this.$$registeredAnimations = Object.create(null); + + /** + * @ngdoc method + * @name $animateProvider#register + * + * @description + * Registers a new injectable animation factory function. The factory function produces the + * animation object which contains callback functions for each event that is expected to be + * animated. + * + * * `eventFn`: `function(element, ... , doneFunction, options)` + * The element to animate, the `doneFunction` and the options fed into the animation. Depending + * on the type of animation additional arguments will be injected into the animation function. The + * list below explains the function signatures for the different animation methods: + * + * - setClass: function(element, addedClasses, removedClasses, doneFunction, options) + * - addClass: function(element, addedClasses, doneFunction, options) + * - removeClass: function(element, removedClasses, doneFunction, options) + * - enter, leave, move: function(element, doneFunction, options) + * - animate: function(element, fromStyles, toStyles, doneFunction, options) + * + * Make sure to trigger the `doneFunction` once the animation is fully complete. + * + * ```js + * return { + * //enter, leave, move signature + * eventFn : function(element, done, options) { + * //code to run the animation + * //once complete, then run done() + * return function endFunction(wasCancelled) { + * //code to cancel the animation + * } + * } + * } + * ``` + * + * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to). + * @param {Function} factory The factory function that will be executed to return the animation + * object. + */ + this.register = function(name, factory) { + if (name && name.charAt(0) !== '.') { + throw $animateMinErr('notcsel', "Expecting class selector starting with '.' got '{0}'.", name); + } + + var key = name + '-animation'; + provider.$$registeredAnimations[name.substr(1)] = key; + $provide.factory(key, factory); + }; + + /** + * @ngdoc method + * @name $animateProvider#classNameFilter + * + * @description + * Sets and/or returns the CSS class regular expression that is checked when performing + * an animation. Upon bootstrap the classNameFilter value is not set at all and will + * therefore enable $animate to attempt to perform an animation on any element that is triggered. + * When setting the `classNameFilter` value, animations will only be performed on elements + * that successfully match the filter expression. This in turn can boost performance + * for low-powered devices as well as applications containing a lot of structural operations. + * @param {RegExp=} expression The className expression which will be checked against all animations + * @return {RegExp} The current CSS className expression value. If null then there is no expression value + */ + this.classNameFilter = function(expression) { + if (arguments.length === 1) { + this.$$classNameFilter = (expression instanceof RegExp) ? expression : null; + if (this.$$classNameFilter) { + var reservedRegex = new RegExp("(\\s+|\\/)" + NG_ANIMATE_CLASSNAME + "(\\s+|\\/)"); + if (reservedRegex.test(this.$$classNameFilter.toString())) { + throw $animateMinErr('nongcls','$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.', NG_ANIMATE_CLASSNAME); + + } + } + } + return this.$$classNameFilter; + }; + + this.$get = ['$$animateQueue', function($$animateQueue) { + function domInsert(element, parentElement, afterElement) { + // if for some reason the previous element was removed + // from the dom sometime before this code runs then let's + // just stick to using the parent element as the anchor + if (afterElement) { + var afterNode = extractElementNode(afterElement); + if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) { + afterElement = null; + } + } + afterElement ? afterElement.after(element) : parentElement.prepend(element); + } + + /** + * @ngdoc service + * @name $animate + * @description The $animate service exposes a series of DOM utility methods that provide support + * for animation hooks. The default behavior is the application of DOM operations, however, + * when an animation is detected (and animations are enabled), $animate will do the heavy lifting + * to ensure that animation runs with the triggered DOM operation. + * + * By default $animate doesn't trigger an animations. This is because the `ngAnimate` module isn't + * included and only when it is active then the animation hooks that `$animate` triggers will be + * functional. Once active then all structural `ng-` directives will trigger animations as they perform + * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`, + * `ngShow`, `ngHide` and `ngMessages` also provide support for animations. + * + * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives. + * + * To learn more about enabling animation support, click here to visit the + * {@link ngAnimate ngAnimate module page}. + */ + return { + // we don't call it directly since non-existant arguments may + // be interpreted as null within the sub enabled function + + /** + * + * @ngdoc method + * @name $animate#on + * @kind function + * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) + * has fired on the given element or among any of its children. Once the listener is fired, the provided callback + * is fired with the following params: + * + * ```js + * $animate.on('enter', container, + * function callback(element, phase) { + * // cool we detected an enter animation within the container + * } + * ); + * ``` + * + * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...) + * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself + * as well as among its children + * @param {Function} callback the callback function that will be fired when the listener is triggered + * + * The arguments present in the callback function are: + * * `element` - The captured DOM element that the animation was fired on. + * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends). + */ + on: $$animateQueue.on, + + /** + * + * @ngdoc method + * @name $animate#off + * @kind function + * @description Deregisters an event listener based on the event which has been associated with the provided element. This method + * can be used in three different ways depending on the arguments: + * + * ```js + * // remove all the animation event listeners listening for `enter` + * $animate.off('enter'); + * + * // remove all the animation event listeners listening for `enter` on the given element and its children + * $animate.off('enter', container); + * + * // remove the event listener function provided by `listenerFn` that is set + * // to listen for `enter` on the given `element` as well as its children + * $animate.off('enter', container, callback); + * ``` + * + * @param {string} event the animation event (e.g. enter, leave, move, addClass, removeClass, etc...) + * @param {DOMElement=} container the container element the event listener was placed on + * @param {Function=} callback the callback function that was registered as the listener + */ + off: $$animateQueue.off, + + /** + * @ngdoc method + * @name $animate#pin + * @kind function + * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists + * outside of the DOM structure of the Angular application. By doing so, any animation triggered via `$animate` can be issued on the + * element despite being outside the realm of the application or within another application. Say for example if the application + * was bootstrapped on an element that is somewhere inside of the `` tag, but we wanted to allow for an element to be situated + * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind + * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association. + * + * Note that this feature is only active when the `ngAnimate` module is used. + * + * @param {DOMElement} element the external element that will be pinned + * @param {DOMElement} parentElement the host parent element that will be associated with the external element + */ + pin: $$animateQueue.pin, + + /** + * + * @ngdoc method + * @name $animate#enabled + * @kind function + * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This + * function can be called in four ways: + * + * ```js + * // returns true or false + * $animate.enabled(); + * + * // changes the enabled state for all animations + * $animate.enabled(false); + * $animate.enabled(true); + * + * // returns true or false if animations are enabled for an element + * $animate.enabled(element); + * + * // changes the enabled state for an element and its children + * $animate.enabled(element, true); + * $animate.enabled(element, false); + * ``` + * + * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state + * @param {boolean=} enabled whether or not the animations will be enabled for the element + * + * @return {boolean} whether or not animations are enabled + */ + enabled: $$animateQueue.enabled, + + /** + * @ngdoc method + * @name $animate#cancel + * @kind function + * @description Cancels the provided animation. + * + * @param {Promise} animationPromise The animation promise that is returned when an animation is started. + */ + cancel: function(runner) { + runner.end && runner.end(); + }, + + /** + * + * @ngdoc method + * @name $animate#enter + * @kind function + * @description Inserts the element into the DOM either after the `after` element (if provided) or + * as the first child within the `parent` element and then triggers an animation. + * A promise is returned that will be resolved during the next digest once the animation + * has completed. + * + * @param {DOMElement} element the element which will be inserted into the DOM + * @param {DOMElement} parent the parent element which will append the element as + * a child (so long as the after element is not present) + * @param {DOMElement=} after the sibling element after which the element will be appended + * @param {object=} options an optional collection of options/styles that will be applied to the element + * + * @return {Promise} the animation callback promise + */ + enter: function(element, parent, after, options) { + parent = parent && jqLite(parent); + after = after && jqLite(after); + parent = parent || after.parent(); + domInsert(element, parent, after); + return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options)); + }, + + /** + * + * @ngdoc method + * @name $animate#move + * @kind function + * @description Inserts (moves) the element into its new position in the DOM either after + * the `after` element (if provided) or as the first child within the `parent` element + * and then triggers an animation. A promise is returned that will be resolved + * during the next digest once the animation has completed. + * + * @param {DOMElement} element the element which will be moved into the new DOM position + * @param {DOMElement} parent the parent element which will append the element as + * a child (so long as the after element is not present) + * @param {DOMElement=} after the sibling element after which the element will be appended + * @param {object=} options an optional collection of options/styles that will be applied to the element + * + * @return {Promise} the animation callback promise + */ + move: function(element, parent, after, options) { + parent = parent && jqLite(parent); + after = after && jqLite(after); + parent = parent || after.parent(); + domInsert(element, parent, after); + return $$animateQueue.push(element, 'move', prepareAnimateOptions(options)); + }, + + /** + * @ngdoc method + * @name $animate#leave + * @kind function + * @description Triggers an animation and then removes the element from the DOM. + * When the function is called a promise is returned that will be resolved during the next + * digest once the animation has completed. + * + * @param {DOMElement} element the element which will be removed from the DOM + * @param {object=} options an optional collection of options/styles that will be applied to the element + * + * @return {Promise} the animation callback promise + */ + leave: function(element, options) { + return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() { + element.remove(); + }); + }, + + /** + * @ngdoc method + * @name $animate#addClass + * @kind function + * + * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon + * execution, the addClass operation will only be handled after the next digest and it will not trigger an + * animation if element already contains the CSS class or if the class is removed at a later step. + * Note that class-based animations are treated differently compared to structural animations + * (like enter, move and leave) since the CSS classes may be added/removed at different points + * depending if CSS or JavaScript animations are used. + * + * @param {DOMElement} element the element which the CSS classes will be applied to + * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces) + * @param {object=} options an optional collection of options/styles that will be applied to the element + * + * @return {Promise} the animation callback promise + */ + addClass: function(element, className, options) { + options = prepareAnimateOptions(options); + options.addClass = mergeClasses(options.addclass, className); + return $$animateQueue.push(element, 'addClass', options); + }, + + /** + * @ngdoc method + * @name $animate#removeClass + * @kind function + * + * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon + * execution, the removeClass operation will only be handled after the next digest and it will not trigger an + * animation if element does not contain the CSS class or if the class is added at a later step. + * Note that class-based animations are treated differently compared to structural animations + * (like enter, move and leave) since the CSS classes may be added/removed at different points + * depending if CSS or JavaScript animations are used. + * + * @param {DOMElement} element the element which the CSS classes will be applied to + * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces) + * @param {object=} options an optional collection of options/styles that will be applied to the element + * + * @return {Promise} the animation callback promise + */ + removeClass: function(element, className, options) { + options = prepareAnimateOptions(options); + options.removeClass = mergeClasses(options.removeClass, className); + return $$animateQueue.push(element, 'removeClass', options); + }, + + /** + * @ngdoc method + * @name $animate#setClass + * @kind function + * + * @description Performs both the addition and removal of a CSS classes on an element and (during the process) + * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and + * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has + * passed. Note that class-based animations are treated differently compared to structural animations + * (like enter, move and leave) since the CSS classes may be added/removed at different points + * depending if CSS or JavaScript animations are used. + * + * @param {DOMElement} element the element which the CSS classes will be applied to + * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces) + * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces) + * @param {object=} options an optional collection of options/styles that will be applied to the element + * + * @return {Promise} the animation callback promise + */ + setClass: function(element, add, remove, options) { + options = prepareAnimateOptions(options); + options.addClass = mergeClasses(options.addClass, add); + options.removeClass = mergeClasses(options.removeClass, remove); + return $$animateQueue.push(element, 'setClass', options); + }, + + /** + * @ngdoc method + * @name $animate#animate + * @kind function + * + * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element. + * If any detected CSS transition, keyframe or JavaScript matches the provided className value then the animation will take + * on the provided styles. For example, if a transition animation is set for the given className then the provided from and + * to styles will be applied alongside the given transition. If a JavaScript animation is detected then the provided styles + * will be given in as function paramters into the `animate` method (or as apart of the `options` parameter). + * + * @param {DOMElement} element the element which the CSS styles will be applied to + * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation. + * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation. + * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If + * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element. + * (Note that if no animation is detected then this value will not be appplied to the element.) + * @param {object=} options an optional collection of options/styles that will be applied to the element + * + * @return {Promise} the animation callback promise + */ + animate: function(element, from, to, className, options) { + options = prepareAnimateOptions(options); + options.from = options.from ? extend(options.from, from) : from; + options.to = options.to ? extend(options.to, to) : to; + + className = className || 'ng-inline-animate'; + options.tempClasses = mergeClasses(options.tempClasses, className); + return $$animateQueue.push(element, 'animate', options); + } + }; + }]; + }]; + + /** + * @ngdoc service + * @name $animateCss + * @kind object + * + * @description + * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included, + * then the `$animateCss` service will actually perform animations. + * + * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}. + */ + var $CoreAnimateCssProvider = function() { + this.$get = ['$$rAF', '$q', function($$rAF, $q) { + + var RAFPromise = function() {}; + RAFPromise.prototype = { + done: function(cancel) { + this.defer && this.defer[cancel === true ? 'reject' : 'resolve'](); + }, + end: function() { + this.done(); + }, + cancel: function() { + this.done(true); + }, + getPromise: function() { + if (!this.defer) { + this.defer = $q.defer(); + } + return this.defer.promise; + }, + then: function(f1,f2) { + return this.getPromise().then(f1,f2); + }, + 'catch': function(f1) { + return this.getPromise()['catch'](f1); + }, + 'finally': function(f1) { + return this.getPromise()['finally'](f1); + } + }; + + return function(element, options) { + // there is no point in applying the styles since + // there is no animation that goes on at all in + // this version of $animateCss. + if (options.cleanupStyles) { + options.from = options.to = null; + } + + if (options.from) { + element.css(options.from); + options.from = null; + } + + var closed, runner = new RAFPromise(); + return { + start: run, + end: run + }; + + function run() { + $$rAF(function() { + close(); + if (!closed) { + runner.done(); + } + closed = true; + }); + return runner; + } + + function close() { + if (options.addClass) { + element.addClass(options.addClass); + options.addClass = null; + } + if (options.removeClass) { + element.removeClass(options.removeClass); + options.removeClass = null; + } + if (options.to) { + element.css(options.to); + options.to = null; + } + } + }; + }]; + }; + + /* global stripHash: true */ + + /** + * ! This is a private undocumented service ! + * + * @name $browser + * @requires $log + * @description + * This object has two goals: + * + * - hide all the global state in the browser caused by the window object + * - abstract away all the browser specific features and inconsistencies + * + * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser` + * service, which can be used for convenient testing of the application without the interaction with + * the real browser apis. + */ + /** + * @param {object} window The global window object. + * @param {object} document jQuery wrapped document. + * @param {object} $log window.console or an object with the same interface. + * @param {object} $sniffer $sniffer service + */ + function Browser(window, document, $log, $sniffer) { + var self = this, + rawDocument = document[0], + location = window.location, + history = window.history, + setTimeout = window.setTimeout, + clearTimeout = window.clearTimeout, + pendingDeferIds = {}; + + self.isMock = false; + + var outstandingRequestCount = 0; + var outstandingRequestCallbacks = []; + + // TODO(vojta): remove this temporary api + self.$$completeOutstandingRequest = completeOutstandingRequest; + self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; + + /** + * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` + * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. + */ + function completeOutstandingRequest(fn) { + try { + fn.apply(null, sliceArgs(arguments, 1)); + } finally { + outstandingRequestCount--; + if (outstandingRequestCount === 0) { + while (outstandingRequestCallbacks.length) { + try { + outstandingRequestCallbacks.pop()(); + } catch (e) { + $log.error(e); + } + } + } + } + } + + function getHash(url) { + var index = url.indexOf('#'); + return index === -1 ? '' : url.substr(index); + } + + /** + * @private + * Note: this method is used only by scenario runner + * TODO(vojta): prefix this method with $$ ? + * @param {function()} callback Function that will be called when no outstanding request + */ + self.notifyWhenNoOutstandingRequests = function(callback) { + if (outstandingRequestCount === 0) { + callback(); + } else { + outstandingRequestCallbacks.push(callback); + } + }; + + ////////////////////////////////////////////////////////////// + // URL API + ////////////////////////////////////////////////////////////// + + var cachedState, lastHistoryState, + lastBrowserUrl = location.href, + baseElement = document.find('base'), + pendingLocation = null; + + cacheState(); + lastHistoryState = cachedState; + + /** + * @name $browser#url + * + * @description + * GETTER: + * Without any argument, this method just returns current value of location.href. + * + * SETTER: + * With at least one argument, this method sets url to new value. + * If html5 history api supported, pushState/replaceState is used, otherwise + * location.href/location.replace is used. + * Returns its own instance to allow chaining + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to change url. + * + * @param {string} url New url (when used as setter) + * @param {boolean=} replace Should new url replace current history record? + * @param {object=} state object to use with pushState/replaceState + */ + self.url = function(url, replace, state) { + // In modern browsers `history.state` is `null` by default; treating it separately + // from `undefined` would cause `$browser.url('/foo')` to change `history.state` + // to undefined via `pushState`. Instead, let's change `undefined` to `null` here. + if (isUndefined(state)) { + state = null; + } + + // Android Browser BFCache causes location, history reference to become stale. + if (location !== window.location) location = window.location; + if (history !== window.history) history = window.history; + + // setter + if (url) { + var sameState = lastHistoryState === state; + + // Don't change anything if previous and current URLs and states match. This also prevents + // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode. + // See https://github.com/angular/angular.js/commit/ffb2701 + if (lastBrowserUrl === url && (!$sniffer.history || sameState)) { + return self; + } + var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url); + lastBrowserUrl = url; + lastHistoryState = state; + // Don't use history API if only the hash changed + // due to a bug in IE10/IE11 which leads + // to not firing a `hashchange` nor `popstate` event + // in some cases (see #9143). + if ($sniffer.history && (!sameBase || !sameState)) { + history[replace ? 'replaceState' : 'pushState'](state, '', url); + cacheState(); + // Do the assignment again so that those two variables are referentially identical. + lastHistoryState = cachedState; + } else { + if (!sameBase || pendingLocation) { + pendingLocation = url; + } + if (replace) { + location.replace(url); + } else if (!sameBase) { + location.href = url; + } else { + location.hash = getHash(url); + } + if (location.href !== url) { + pendingLocation = url; + } + } + return self; + // getter + } else { + // - pendingLocation is needed as browsers don't allow to read out + // the new location.href if a reload happened or if there is a bug like in iOS 9 (see + // https://openradar.appspot.com/22186109). + // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 + return pendingLocation || location.href.replace(/%27/g,"'"); + } + }; + + /** + * @name $browser#state + * + * @description + * This method is a getter. + * + * Return history.state or null if history.state is undefined. + * + * @returns {object} state + */ + self.state = function() { + return cachedState; + }; + + var urlChangeListeners = [], + urlChangeInit = false; + + function cacheStateAndFireUrlChange() { + pendingLocation = null; + cacheState(); + fireUrlChange(); + } + + function getCurrentState() { + try { + return history.state; + } catch (e) { + // MSIE can reportedly throw when there is no state (UNCONFIRMED). + } + } + + // This variable should be used *only* inside the cacheState function. + var lastCachedState = null; + function cacheState() { + // This should be the only place in $browser where `history.state` is read. + cachedState = getCurrentState(); + cachedState = isUndefined(cachedState) ? null : cachedState; + + // Prevent callbacks fo fire twice if both hashchange & popstate were fired. + if (equals(cachedState, lastCachedState)) { + cachedState = lastCachedState; + } + lastCachedState = cachedState; + } + + function fireUrlChange() { + if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { + return; + } + + lastBrowserUrl = self.url(); + lastHistoryState = cachedState; + forEach(urlChangeListeners, function(listener) { + listener(self.url(), cachedState); + }); + } + + /** + * @name $browser#onUrlChange + * + * @description + * Register callback function that will be called, when url changes. + * + * It's only called when the url is changed from outside of angular: + * - user types different url into address bar + * - user clicks on history (forward/back) button + * - user clicks on a link + * + * It's not called when url is changed by $browser.url() method + * + * The listener gets called with new url as parameter. + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to monitor url changes in angular apps. + * + * @param {function(string)} listener Listener function to be called when url changes. + * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. + */ + self.onUrlChange = function(callback) { + // TODO(vojta): refactor to use node's syntax for events + if (!urlChangeInit) { + // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera) + // don't fire popstate when user change the address bar and don't fire hashchange when url + // changed by push/replaceState + + // html5 history api - popstate event + if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange); + // hashchange event + jqLite(window).on('hashchange', cacheStateAndFireUrlChange); + + urlChangeInit = true; + } + + urlChangeListeners.push(callback); + return callback; + }; + + /** + * @private + * Remove popstate and hashchange handler from window. + * + * NOTE: this api is intended for use only by $rootScope. + */ + self.$$applicationDestroyed = function() { + jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange); + }; + + /** + * Checks whether the url has changed outside of Angular. + * Needs to be exported to be able to check for changes that have been done in sync, + * as hashchange/popstate events fire in async. + */ + self.$$checkUrlChange = fireUrlChange; + + ////////////////////////////////////////////////////////////// + // Misc API + ////////////////////////////////////////////////////////////// + + /** + * @name $browser#baseHref + * + * @description + * Returns current + * (always relative - without domain) + * + * @returns {string} The current base href + */ + self.baseHref = function() { + var href = baseElement.attr('href'); + return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : ''; + }; + + /** + * @name $browser#defer + * @param {function()} fn A function, who's execution should be deferred. + * @param {number=} [delay=0] of milliseconds to defer the function execution. + * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`. + * + * @description + * Executes a fn asynchronously via `setTimeout(fn, delay)`. + * + * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using + * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed + * via `$browser.defer.flush()`. + * + */ + self.defer = function(fn, delay) { + var timeoutId; + outstandingRequestCount++; + timeoutId = setTimeout(function() { + delete pendingDeferIds[timeoutId]; + completeOutstandingRequest(fn); + }, delay || 0); + pendingDeferIds[timeoutId] = true; + return timeoutId; + }; + + + /** + * @name $browser#defer.cancel + * + * @description + * Cancels a deferred task identified with `deferId`. + * + * @param {*} deferId Token returned by the `$browser.defer` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully + * canceled. + */ + self.defer.cancel = function(deferId) { + if (pendingDeferIds[deferId]) { + delete pendingDeferIds[deferId]; + clearTimeout(deferId); + completeOutstandingRequest(noop); + return true; + } + return false; + }; + + } + + function $BrowserProvider() { + this.$get = ['$window', '$log', '$sniffer', '$document', + function($window, $log, $sniffer, $document) { + return new Browser($window, $document, $log, $sniffer); + }]; + } + + /** + * @ngdoc service + * @name $cacheFactory + * + * @description + * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to + * them. + * + * ```js + * + * var cache = $cacheFactory('cacheId'); + * expect($cacheFactory.get('cacheId')).toBe(cache); + * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined(); + * + * cache.put("key", "value"); + * cache.put("another key", "another value"); + * + * // We've specified no options on creation + * expect(cache.info()).toEqual({id: 'cacheId', size: 2}); + * + * ``` + * + * + * @param {string} cacheId Name or id of the newly created cache. + * @param {object=} options Options object that specifies the cache behavior. Properties: + * + * - `{number=}` `capacity` — turns the cache into LRU cache. + * + * @returns {object} Newly created cache object with the following set of methods: + * + * - `{object}` `info()` — Returns id, size, and options of cache. + * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns + * it. + * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. + * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. + * - `{void}` `removeAll()` — Removes all cached values. + * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory. + * + * @example + + +
    + + + + +

    Cached Values

    +
    + + : + +
    + +

    Cache Info

    +
    + + : + +
    +
    +
    + + angular.module('cacheExampleApp', []). + controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) { + $scope.keys = []; + $scope.cache = $cacheFactory('cacheId'); + $scope.put = function(key, value) { + if (angular.isUndefined($scope.cache.get(key))) { + $scope.keys.push(key); + } + $scope.cache.put(key, angular.isUndefined(value) ? null : value); + }; + }]); + + + p { + margin: 10px 0 3px; + } + +
    + */ + function $CacheFactoryProvider() { + + this.$get = function() { + var caches = {}; + + function cacheFactory(cacheId, options) { + if (cacheId in caches) { + throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId); + } + + var size = 0, + stats = extend({}, options, {id: cacheId}), + data = {}, + capacity = (options && options.capacity) || Number.MAX_VALUE, + lruHash = {}, + freshEnd = null, + staleEnd = null; + + /** + * @ngdoc type + * @name $cacheFactory.Cache + * + * @description + * A cache object used to store and retrieve data, primarily used by + * {@link $http $http} and the {@link ng.directive:script script} directive to cache + * templates and other data. + * + * ```js + * angular.module('superCache') + * .factory('superCache', ['$cacheFactory', function($cacheFactory) { + * return $cacheFactory('super-cache'); + * }]); + * ``` + * + * Example test: + * + * ```js + * it('should behave like a cache', inject(function(superCache) { + * superCache.put('key', 'value'); + * superCache.put('another key', 'another value'); + * + * expect(superCache.info()).toEqual({ + * id: 'super-cache', + * size: 2 + * }); + * + * superCache.remove('another key'); + * expect(superCache.get('another key')).toBeUndefined(); + * + * superCache.removeAll(); + * expect(superCache.info()).toEqual({ + * id: 'super-cache', + * size: 0 + * }); + * })); + * ``` + */ + return caches[cacheId] = { + + /** + * @ngdoc method + * @name $cacheFactory.Cache#put + * @kind function + * + * @description + * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be + * retrieved later, and incrementing the size of the cache if the key was not already + * present in the cache. If behaving like an LRU cache, it will also remove stale + * entries from the set. + * + * It will not insert undefined values into the cache. + * + * @param {string} key the key under which the cached data is stored. + * @param {*} value the value to store alongside the key. If it is undefined, the key + * will not be stored. + * @returns {*} the value stored. + */ + put: function(key, value) { + if (isUndefined(value)) return; + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); + + refresh(lruEntry); + } + + if (!(key in data)) size++; + data[key] = value; + + if (size > capacity) { + this.remove(staleEnd.key); + } + + return value; + }, + + /** + * @ngdoc method + * @name $cacheFactory.Cache#get + * @kind function + * + * @description + * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object. + * + * @param {string} key the key of the data to be retrieved + * @returns {*} the value stored. + */ + get: function(key) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + refresh(lruEntry); + } + + return data[key]; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#remove + * @kind function + * + * @description + * Removes an entry from the {@link $cacheFactory.Cache Cache} object. + * + * @param {string} key the key of the entry to be removed + */ + remove: function(key) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + if (lruEntry == freshEnd) freshEnd = lruEntry.p; + if (lruEntry == staleEnd) staleEnd = lruEntry.n; + link(lruEntry.n,lruEntry.p); + + delete lruHash[key]; + } + + delete data[key]; + size--; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#removeAll + * @kind function + * + * @description + * Clears the cache object of any entries. + */ + removeAll: function() { + data = {}; + size = 0; + lruHash = {}; + freshEnd = staleEnd = null; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#destroy + * @kind function + * + * @description + * Destroys the {@link $cacheFactory.Cache Cache} object entirely, + * removing it from the {@link $cacheFactory $cacheFactory} set. + */ + destroy: function() { + data = null; + stats = null; + lruHash = null; + delete caches[cacheId]; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#info + * @kind function + * + * @description + * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}. + * + * @returns {object} an object with the following properties: + *
      + *
    • **id**: the id of the cache instance
    • + *
    • **size**: the number of entries kept in the cache instance
    • + *
    • **...**: any additional properties from the options object when creating the + * cache.
    • + *
    + */ + info: function() { + return extend({}, stats, {size: size}); + } + }; + + + /** + * makes the `entry` the freshEnd of the LRU linked list + */ + function refresh(entry) { + if (entry != freshEnd) { + if (!staleEnd) { + staleEnd = entry; + } else if (staleEnd == entry) { + staleEnd = entry.n; + } + + link(entry.n, entry.p); + link(entry, freshEnd); + freshEnd = entry; + freshEnd.n = null; + } + } + + + /** + * bidirectionally links two entries of the LRU linked list + */ + function link(nextEntry, prevEntry) { + if (nextEntry != prevEntry) { + if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify + if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify + } + } + } + + + /** + * @ngdoc method + * @name $cacheFactory#info + * + * @description + * Get information about all the caches that have been created + * + * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info` + */ + cacheFactory.info = function() { + var info = {}; + forEach(caches, function(cache, cacheId) { + info[cacheId] = cache.info(); + }); + return info; + }; + + + /** + * @ngdoc method + * @name $cacheFactory#get + * + * @description + * Get access to a cache object by the `cacheId` used when it was created. + * + * @param {string} cacheId Name or id of a cache to access. + * @returns {object} Cache object identified by the cacheId or undefined if no such cache. + */ + cacheFactory.get = function(cacheId) { + return caches[cacheId]; + }; + + + return cacheFactory; + }; + } + + /** + * @ngdoc service + * @name $templateCache + * + * @description + * The first time a template is used, it is loaded in the template cache for quick retrieval. You + * can load templates directly into the cache in a `script` tag, or by consuming the + * `$templateCache` service directly. + * + * Adding via the `script` tag: + * + * ```html + * + * ``` + * + * **Note:** the `script` tag containing the template does not need to be included in the `head` of + * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE, + * element with ng-app attribute), otherwise the template will be ignored. + * + * Adding via the `$templateCache` service: + * + * ```js + * var myApp = angular.module('myApp', []); + * myApp.run(function($templateCache) { + * $templateCache.put('templateId.html', 'This is the content of the template'); + * }); + * ``` + * + * To retrieve the template later, simply use it in your HTML: + * ```html + *
    + * ``` + * + * or get it via Javascript: + * ```js + * $templateCache.get('templateId.html') + * ``` + * + * See {@link ng.$cacheFactory $cacheFactory}. + * + */ + function $TemplateCacheProvider() { + this.$get = ['$cacheFactory', function($cacheFactory) { + return $cacheFactory('templates'); + }]; + } + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! + * + * DOM-related variables: + * + * - "node" - DOM Node + * - "element" - DOM Element or Node + * - "$node" or "$element" - jqLite-wrapped node or element + * + * + * Compiler related stuff: + * + * - "linkFn" - linking fn of a single directive + * - "nodeLinkFn" - function that aggregates all linking fns for a particular node + * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node + * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList) + */ + + + /** + * @ngdoc service + * @name $compile + * @kind function + * + * @description + * Compiles an HTML string or DOM into a template and produces a template function, which + * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together. + * + * The compilation is a process of walking the DOM tree and matching DOM elements to + * {@link ng.$compileProvider#directive directives}. + * + *
    + * **Note:** This document is an in-depth reference of all directive options. + * For a gentle introduction to directives with examples of common use cases, + * see the {@link guide/directive directive guide}. + *
    + * + * ## Comprehensive Directive API + * + * There are many different options for a directive. + * + * The difference resides in the return value of the factory function. + * You can either return a "Directive Definition Object" (see below) that defines the directive properties, + * or just the `postLink` function (all other properties will have the default values). + * + *
    + * **Best Practice:** It's recommended to use the "directive definition object" form. + *
    + * + * Here's an example directive declared with a Directive Definition Object: + * + * ```js + * var myModule = angular.module(...); + * + * myModule.directive('directiveName', function factory(injectables) { + * var directiveDefinitionObject = { + * priority: 0, + * template: '
    ', // or // function(tElement, tAttrs) { ... }, + * // or + * // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... }, + * transclude: false, + * restrict: 'A', + * templateNamespace: 'html', + * scope: false, + * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, + * controllerAs: 'stringIdentifier', + * bindToController: false, + * require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'], + * compile: function compile(tElement, tAttrs, transclude) { + * return { + * pre: function preLink(scope, iElement, iAttrs, controller) { ... }, + * post: function postLink(scope, iElement, iAttrs, controller) { ... } + * } + * // or + * // return function postLink( ... ) { ... } + * }, + * // or + * // link: { + * // pre: function preLink(scope, iElement, iAttrs, controller) { ... }, + * // post: function postLink(scope, iElement, iAttrs, controller) { ... } + * // } + * // or + * // link: function postLink( ... ) { ... } + * }; + * return directiveDefinitionObject; + * }); + * ``` + * + *
    + * **Note:** Any unspecified options will use the default value. You can see the default values below. + *
    + * + * Therefore the above can be simplified as: + * + * ```js + * var myModule = angular.module(...); + * + * myModule.directive('directiveName', function factory(injectables) { + * var directiveDefinitionObject = { + * link: function postLink(scope, iElement, iAttrs) { ... } + * }; + * return directiveDefinitionObject; + * // or + * // return function postLink(scope, iElement, iAttrs) { ... } + * }); + * ``` + * + * + * + * ### Directive Definition Object + * + * The directive definition object provides instructions to the {@link ng.$compile + * compiler}. The attributes are: + * + * #### `multiElement` + * When this property is set to true, the HTML compiler will collect DOM nodes between + * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them + * together as the directive elements. It is recommended that this feature be used on directives + * which are not strictly behavioural (such as {@link ngClick}), and which + * do not manipulate or replace child nodes (such as {@link ngInclude}). + * + * #### `priority` + * When there are multiple directives defined on a single DOM element, sometimes it + * is necessary to specify the order in which the directives are applied. The `priority` is used + * to sort the directives before their `compile` functions get called. Priority is defined as a + * number. Directives with greater numerical `priority` are compiled first. Pre-link functions + * are also run in priority order, but post-link functions are run in reverse order. The order + * of directives with the same priority is undefined. The default priority is `0`. + * + * #### `terminal` + * If set to true then the current `priority` will be the last set of directives + * which will execute (any directives at the current priority will still execute + * as the order of execution on same `priority` is undefined). Note that expressions + * and other directives used in the directive's template will also be excluded from execution. + * + * #### `scope` + * The scope property can be `true`, an object or a falsy value: + * + * * **falsy:** No scope will be created for the directive. The directive will use its parent's scope. + * + * * **`true`:** A new child scope that prototypically inherits from its parent will be created for + * the directive's element. If multiple directives on the same element request a new scope, + * only one new scope is created. The new scope rule does not apply for the root of the template + * since the root of the template always gets a new scope. + * + * * **`{...}` (an object hash):** A new "isolate" scope is created for the directive's element. The + * 'isolate' scope differs from normal scope in that it does not prototypically inherit from its parent + * scope. This is useful when creating reusable components, which should not accidentally read or modify + * data in the parent scope. + * + * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the + * directive's element. These local properties are useful for aliasing values for templates. The keys in + * the object hash map to the name of the property on the isolate scope; the values define how the property + * is bound to the parent scope, via matching attributes on the directive's element: + * + * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is + * always a string since DOM attributes are strings. If no `attr` name is specified then the + * attribute name is assumed to be the same as the local name. + * Given `` and widget definition + * of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect + * the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the + * `localName` property on the widget scope. The `name` is read from the parent scope (not + * component scope). + * + * * `=` or `=attr` - set up bi-directional binding between a local scope property and the + * parent scope property of name defined via the value of the `attr` attribute. If no `attr` + * name is specified then the attribute name is assumed to be the same as the local name. + * Given `` and widget definition of + * `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the + * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected + * in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent + * scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You + * can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If + * you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use + * `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional). + * + * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. + * If no `attr` name is specified then the attribute name is assumed to be the same as the + * local name. Given `` and widget definition of + * `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to + * a function wrapper for the `count = count + value` expression. Often it's desirable to + * pass data from the isolated scope via an expression to the parent scope, this can be + * done by passing a map of local variable names and values into the expression wrapper fn. + * For example, if the expression is `increment(amount)` then we can specify the amount value + * by calling the `localFn` as `localFn({amount: 22})`. + * + * In general it's possible to apply more than one directive to one element, but there might be limitations + * depending on the type of scope required by the directives. The following points will help explain these limitations. + * For simplicity only two directives are taken into account, but it is also applicable for several directives: + * + * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope + * * **child scope** + **no scope** => Both directives will share one single child scope + * * **child scope** + **child scope** => Both directives will share one single child scope + * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use + * its parent's scope + * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot + * be applied to the same element. + * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives + * cannot be applied to the same element. + * + * + * #### `bindToController` + * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will + * allow a component to have its properties bound to the controller, rather than to scope. When the controller + * is instantiated, the initial values of the isolate scope bindings are already available. + * + * #### `controller` + * Controller constructor function. The controller is instantiated before the + * pre-linking phase and can be accessed by other directives (see + * `require` attribute). This allows the directives to communicate with each other and augment + * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals: + * + * * `$scope` - Current scope associated with the element + * * `$element` - Current element + * * `$attrs` - Current attributes object for the element + * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope: + * `function([scope], cloneLinkingFn, futureParentElement)`. + * * `scope`: optional argument to override the scope. + * * `cloneLinkingFn`: optional argument to create clones of the original transcluded content. + * * `futureParentElement`: + * * defines the parent to which the `cloneLinkingFn` will add the cloned elements. + * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`. + * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements) + * and when the `cloneLinkinFn` is passed, + * as those elements need to created and cloned in a special way when they are defined outside their + * usual containers (e.g. like ``). + * * See also the `directive.templateNamespace` property. + * + * + * #### `require` + * Require another directive and inject its controller as the fourth argument to the linking function. The + * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the + * injected argument will be an array in corresponding order. If no such directive can be + * found, or if the directive does not have a controller, then an error is raised (unless no link function + * is specified, in which case error checking is skipped). The name can be prefixed with: + * + * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. + * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found. + * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found. + * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found. + * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass + * `null` to the `link` fn if not found. + * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass + * `null` to the `link` fn if not found. + * + * + * #### `controllerAs` + * Identifier name for a reference to the controller in the directive's scope. + * This allows the controller to be referenced from the directive template. This is especially + * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible + * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the + * `controllerAs` reference might overwrite a property that already exists on the parent scope. + * + * + * #### `restrict` + * String of subset of `EACM` which restricts the directive to a specific directive + * declaration style. If omitted, the defaults (elements and attributes) are used. + * + * * `E` - Element name (default): `` + * * `A` - Attribute (default): `
    ` + * * `C` - Class: `
    ` + * * `M` - Comment: `` + * + * + * #### `templateNamespace` + * String representing the document type used by the markup in the template. + * AngularJS needs this information as those elements need to be created and cloned + * in a special way when they are defined outside their usual containers like `` and ``. + * + * * `html` - All root nodes in the template are HTML. Root nodes may also be + * top-level elements such as `` or ``. + * * `svg` - The root nodes in the template are SVG elements (excluding ``). + * * `math` - The root nodes in the template are MathML elements (excluding ``). + * + * If no `templateNamespace` is specified, then the namespace is considered to be `html`. + * + * #### `template` + * HTML markup that may: + * * Replace the contents of the directive's element (default). + * * Replace the directive's element itself (if `replace` is true - DEPRECATED). + * * Wrap the contents of the directive's element (if `transclude` is true). + * + * Value may be: + * + * * A string. For example `
    {{delete_str}}
    `. + * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile` + * function api below) and returns a string value. + * + * + * #### `templateUrl` + * This is similar to `template` but the template is loaded from the specified URL, asynchronously. + * + * Because template loading is asynchronous the compiler will suspend compilation of directives on that element + * for later when the template has been resolved. In the meantime it will continue to compile and link + * sibling and parent elements as though this element had not contained any directives. + * + * The compiler does not suspend the entire compilation to wait for templates to be loaded because this + * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the + * case when only one deeply nested directive has `templateUrl`. + * + * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache} + * + * You can specify `templateUrl` as a string representing the URL or as a function which takes two + * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns + * a string value representing the url. In either case, the template URL is passed through {@link + * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. + * + * + * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0) + * specify what the template should replace. Defaults to `false`. + * + * * `true` - the template will replace the directive's element. + * * `false` - the template will replace the contents of the directive's element. + * + * The replacement process migrates all of the attributes / classes from the old element to the new + * one. See the {@link guide/directive#template-expanding-directive + * Directives Guide} for an example. + * + * There are very few scenarios where element replacement is required for the application function, + * the main one being reusable custom components that are used within SVG contexts + * (because SVG doesn't work with custom elements in the DOM tree). + * + * #### `transclude` + * Extract the contents of the element where the directive appears and make it available to the directive. + * The contents are compiled and provided to the directive as a **transclusion function**. See the + * {@link $compile#transclusion Transclusion} section below. + * + * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the + * directive's element or the entire element: + * + * * `true` - transclude the content (i.e. the child nodes) of the directive's element. + * * `'element'` - transclude the whole of the directive's element including any directives on this + * element that defined at a lower priority than this directive. When used, the `template` + * property is ignored. + * + * + * #### `compile` + * + * ```js + * function compile(tElement, tAttrs, transclude) { ... } + * ``` + * + * The compile function deals with transforming the template DOM. Since most directives do not do + * template transformation, it is not used often. The compile function takes the following arguments: + * + * * `tElement` - template element - The element where the directive has been declared. It is + * safe to do template transformation on the element and child elements only. + * + * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared + * between all directive compile functions. + * + * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)` + * + *
    + * **Note:** The template instance and the link instance may be different objects if the template has + * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that + * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration + * should be done in a linking function rather than in a compile function. + *
    + + *
    + * **Note:** The compile function cannot handle directives that recursively use themselves in their + * own templates or compile functions. Compiling these directives results in an infinite loop and a + * stack overflow errors. + * + * This can be avoided by manually using $compile in the postLink function to imperatively compile + * a directive's template instead of relying on automatic template compilation via `template` or + * `templateUrl` declaration or manual compilation inside the compile function. + *
    + * + *
    + * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it + * e.g. does not know about the right outer scope. Please use the transclude function that is passed + * to the link function instead. + *
    + + * A compile function can have a return value which can be either a function or an object. + * + * * returning a (post-link) function - is equivalent to registering the linking function via the + * `link` property of the config object when the compile function is empty. + * + * * returning an object with function(s) registered via `pre` and `post` properties - allows you to + * control when a linking function should be called during the linking phase. See info about + * pre-linking and post-linking functions below. + * + * + * #### `link` + * This property is used only if the `compile` property is not defined. + * + * ```js + * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... } + * ``` + * + * The link function is responsible for registering DOM listeners as well as updating the DOM. It is + * executed after the template has been cloned. This is where most of the directive logic will be + * put. + * + * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the + * directive for registering {@link ng.$rootScope.Scope#$watch watches}. + * + * * `iElement` - instance element - The element where the directive is to be used. It is safe to + * manipulate the children of the element only in `postLink` function since the children have + * already been linked. + * + * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared + * between all directive linking functions. + * + * * `controller` - the directive's required controller instance(s) - Instances are shared + * among all directives, which allows the directives to use the controllers as a communication + * channel. The exact value depends on the directive's `require` property: + * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one + * * `string`: the controller instance + * * `array`: array of controller instances + * + * If a required controller cannot be found, and it is optional, the instance is `null`, + * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown. + * + * Note that you can also require the directive's own controller - it will be made available like + * any other controller. + * + * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope. + * This is the same as the `$transclude` + * parameter of directive controllers, see there for details. + * `function([scope], cloneLinkingFn, futureParentElement)`. + * + * #### Pre-linking function + * + * Executed before the child elements are linked. Not safe to do DOM transformation since the + * compiler linking function will fail to locate the correct elements for linking. + * + * #### Post-linking function + * + * Executed after the child elements are linked. + * + * Note that child elements that contain `templateUrl` directives will not have been compiled + * and linked since they are waiting for their template to load asynchronously and their own + * compilation and linking has been suspended until that occurs. + * + * It is safe to do DOM transformation in the post-linking function on elements that are not waiting + * for their async templates to be resolved. + * + * + * ### Transclusion + * + * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and + * copying them to another part of the DOM, while maintaining their connection to the original AngularJS + * scope from where they were taken. + * + * Transclusion is used (often with {@link ngTransclude}) to insert the + * original contents of a directive's element into a specified place in the template of the directive. + * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded + * content has access to the properties on the scope from which it was taken, even if the directive + * has isolated scope. + * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}. + * + * This makes it possible for the widget to have private state for its template, while the transcluded + * content has access to its originating scope. + * + *
    + * **Note:** When testing an element transclude directive you must not place the directive at the root of the + * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives + * Testing Transclusion Directives}. + *
    + * + * #### Transclusion Functions + * + * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion + * function** to the directive's `link` function and `controller`. This transclusion function is a special + * **linking function** that will return the compiled contents linked to a new transclusion scope. + * + *
    + * If you are just using {@link ngTransclude} then you don't need to worry about this function, since + * ngTransclude will deal with it for us. + *
    + * + * If you want to manually control the insertion and removal of the transcluded content in your directive + * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery + * object that contains the compiled DOM, which is linked to the correct transclusion scope. + * + * When you call a transclusion function you can pass in a **clone attach function**. This function accepts + * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded + * content and the `scope` is the newly created transclusion scope, to which the clone is bound. + * + *
    + * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function + * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope. + *
    + * + * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone + * attach function**: + * + * ```js + * var transcludedContent, transclusionScope; + * + * $transclude(function(clone, scope) { + * element.append(clone); + * transcludedContent = clone; + * transclusionScope = scope; + * }); + * ``` + * + * Later, if you want to remove the transcluded content from your DOM then you should also destroy the + * associated transclusion scope: + * + * ```js + * transcludedContent.remove(); + * transclusionScope.$destroy(); + * ``` + * + *
    + * **Best Practice**: if you intend to add and remove transcluded content manually in your directive + * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it), + * then you are also responsible for calling `$destroy` on the transclusion scope. + *
    + * + * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat} + * automatically destroy their transluded clones as necessary so you do not need to worry about this if + * you are simply using {@link ngTransclude} to inject the transclusion into your directive. + * + * + * #### Transclusion Scopes + * + * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion + * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed + * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it + * was taken. + * + * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look + * like this: + * + * ```html + *
    + *
    + *
    + *
    + *
    + *
    + * ``` + * + * The `$parent` scope hierarchy will look like this: + * + * ``` + * - $rootScope + * - isolate + * - transclusion + * ``` + * + * but the scopes will inherit prototypically from different scopes to their `$parent`. + * + * ``` + * - $rootScope + * - transclusion + * - isolate + * ``` + * + * + * ### Attributes + * + * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the + * `link()` or `compile()` functions. It has a variety of uses. + * + * accessing *Normalized attribute names:* + * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. + * the attributes object allows for normalized access to + * the attributes. + * + * * *Directive inter-communication:* All directives share the same instance of the attributes + * object which allows the directives to use the attributes object as inter directive + * communication. + * + * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object + * allowing other directives to read the interpolated value. + * + * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes + * that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also + * the only way to easily get the actual value because during the linking phase the interpolation + * hasn't been evaluated yet and so the value is at this time set to `undefined`. + * + * ```js + * function linkingFn(scope, elm, attrs, ctrl) { + * // get the attribute value + * console.log(attrs.ngModel); + * + * // change the attribute + * attrs.$set('ngModel', 'new value'); + * + * // observe changes to interpolated attribute + * attrs.$observe('ngModel', function(value) { + * console.log('ngModel has changed value to ' + value); + * }); + * } + * ``` + * + * ## Example + * + *
    + * **Note**: Typically directives are registered with `module.directive`. The example below is + * to illustrate how `$compile` works. + *
    + * + + + +
    +
    +
    +
    +
    +
    + + it('should auto compile', function() { + var textarea = $('textarea'); + var output = $('div[compile]'); + // The initial state reads 'Hello Angular'. + expect(output.getText()).toBe('Hello Angular'); + textarea.clear(); + textarea.sendKeys('{{name}}!'); + expect(output.getText()).toBe('Angular!'); + }); + +
    + + * + * + * @param {string|DOMElement} element Element or HTML string to compile into a template function. + * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED. + * + *
    + * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it + * e.g. will not use the right outer scope. Please pass the transclude function as a + * `parentBoundTranscludeFn` to the link function instead. + *
    + * + * @param {number} maxPriority only apply directives lower than given priority (Only effects the + * root element(s), not their children) + * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template + * (a DOM element/tree) to a scope. Where: + * + * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. + * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the + * `template` and call the `cloneAttachFn` function allowing the caller to attach the + * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is + * called as:
    `cloneAttachFn(clonedElement, scope)` where: + * + * * `clonedElement` - is a clone of the original `element` passed into the compiler. + * * `scope` - is the current scope with which the linking function is working with. + * + * * `options` - An optional object hash with linking options. If `options` is provided, then the following + * keys may be used to control linking behavior: + * + * * `parentBoundTranscludeFn` - the transclude function made available to + * directives; if given, it will be passed through to the link functions of + * directives found in `element` during compilation. + * * `transcludeControllers` - an object hash with keys that map controller names + * to controller instances; if given, it will make the controllers + * available to directives. + * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add + * the cloned elements; only needed for transcludes that are allowed to contain non html + * elements (e.g. SVG elements). See also the directive.controller property. + * + * Calling the linking function returns the element of the template. It is either the original + * element passed in, or the clone of the element if the `cloneAttachFn` is provided. + * + * After linking the view is not updated until after a call to $digest which typically is done by + * Angular automatically. + * + * If you need access to the bound view, there are two ways to do it: + * + * - If you are not asking the linking function to clone the template, create the DOM element(s) + * before you send them to the compiler and keep this reference around. + * ```js + * var element = $compile('

    {{total}}

    ')(scope); + * ``` + * + * - if on the other hand, you need the element to be cloned, the view reference from the original + * example would not point to the clone, but rather to the original template that was cloned. In + * this case, you can access the clone via the cloneAttachFn: + * ```js + * var templateElement = angular.element('

    {{total}}

    '), + * scope = ....; + * + * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) { + * //attach the clone to DOM document at the right place + * }); + * + * //now we have reference to the cloned DOM via `clonedElement` + * ``` + * + * + * For information on how the compiler works, see the + * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide. + */ + + var $compileMinErr = minErr('$compile'); + + /** + * @ngdoc provider + * @name $compileProvider + * + * @description + */ + $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; + function $CompileProvider($provide, $$sanitizeUriProvider) { + var hasDirectives = {}, + Suffix = 'Directive', + COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\w\-]+)\s+(.*)$/, + CLASS_DIRECTIVE_REGEXP = /(([\w\-]+)(?:\:([^;]+))?;?)/, + ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'), + REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; + + // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes + // The assumption is that future DOM event attribute names will begin with + // 'on' and be composed of only English letters. + var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; + + function parseIsolateBindings(scope, directiveName, isController) { + var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/; + + var bindings = {}; + + forEach(scope, function(definition, scopeName) { + var match = definition.match(LOCAL_REGEXP); + + if (!match) { + throw $compileMinErr('iscp', + "Invalid {3} for directive '{0}'." + + " Definition: {... {1}: '{2}' ...}", + directiveName, scopeName, definition, + (isController ? "controller bindings definition" : + "isolate scope definition")); + } + + bindings[scopeName] = { + mode: match[1][0], + collection: match[2] === '*', + optional: match[3] === '?', + attrName: match[4] || scopeName + }; + }); + + return bindings; + } + + function parseDirectiveBindings(directive, directiveName) { + var bindings = { + isolateScope: null, + bindToController: null + }; + if (isObject(directive.scope)) { + if (directive.bindToController === true) { + bindings.bindToController = parseIsolateBindings(directive.scope, + directiveName, true); + bindings.isolateScope = {}; + } else { + bindings.isolateScope = parseIsolateBindings(directive.scope, + directiveName, false); + } + } + if (isObject(directive.bindToController)) { + bindings.bindToController = + parseIsolateBindings(directive.bindToController, directiveName, true); + } + if (isObject(bindings.bindToController)) { + var controller = directive.controller; + var controllerAs = directive.controllerAs; + if (!controller) { + // There is no controller, there may or may not be a controllerAs property + throw $compileMinErr('noctrl', + "Cannot bind to controller without directive '{0}'s controller.", + directiveName); + } else if (!identifierForController(controller, controllerAs)) { + // There is a controller, but no identifier or controllerAs property + throw $compileMinErr('noident', + "Cannot bind to controller without identifier for directive '{0}'.", + directiveName); + } + } + return bindings; + } + + function assertValidDirectiveName(name) { + var letter = name.charAt(0); + if (!letter || letter !== lowercase(letter)) { + throw $compileMinErr('baddir', "Directive name '{0}' is invalid. The first character must be a lowercase letter", name); + } + if (name !== name.trim()) { + throw $compileMinErr('baddir', + "Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces", + name); + } + } + + /** + * @ngdoc method + * @name $compileProvider#directive + * @kind function + * + * @description + * Register a new directive with the compiler. + * + * @param {string|Object} name Name of the directive in camel-case (i.e. ngBind which + * will match as ng-bind), or an object map of directives where the keys are the + * names and the values are the factories. + * @param {Function|Array} directiveFactory An injectable directive factory function. See + * {@link guide/directive} for more info. + * @returns {ng.$compileProvider} Self for chaining. + */ + this.directive = function registerDirective(name, directiveFactory) { + assertNotHasOwnProperty(name, 'directive'); + if (isString(name)) { + assertValidDirectiveName(name); + assertArg(directiveFactory, 'directiveFactory'); + if (!hasDirectives.hasOwnProperty(name)) { + hasDirectives[name] = []; + $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', + function($injector, $exceptionHandler) { + var directives = []; + forEach(hasDirectives[name], function(directiveFactory, index) { + try { + var directive = $injector.invoke(directiveFactory); + if (isFunction(directive)) { + directive = { compile: valueFn(directive) }; + } else if (!directive.compile && directive.link) { + directive.compile = valueFn(directive.link); + } + directive.priority = directive.priority || 0; + directive.index = index; + directive.name = directive.name || name; + directive.require = directive.require || (directive.controller && directive.name); + directive.restrict = directive.restrict || 'EA'; + var bindings = directive.$$bindings = + parseDirectiveBindings(directive, directive.name); + if (isObject(bindings.isolateScope)) { + directive.$$isolateBindings = bindings.isolateScope; + } + directive.$$moduleName = directiveFactory.$$moduleName; + directives.push(directive); + } catch (e) { + $exceptionHandler(e); + } + }); + return directives; + }]); + } + hasDirectives[name].push(directiveFactory); + } else { + forEach(name, reverseParams(registerDirective)); + } + return this; + }; + + + /** + * @ngdoc method + * @name $compileProvider#aHrefSanitizationWhitelist + * @kind function + * + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during a[href] sanitization. + * + * The sanitization is a security measure aimed at preventing XSS attacks via html links. + * + * Any url about to be assigned to a[href] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.aHrefSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp); + return this; + } else { + return $$sanitizeUriProvider.aHrefSanitizationWhitelist(); + } + }; + + + /** + * @ngdoc method + * @name $compileProvider#imgSrcSanitizationWhitelist + * @kind function + * + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during img[src] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to img[src] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.imgSrcSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp); + return this; + } else { + return $$sanitizeUriProvider.imgSrcSanitizationWhitelist(); + } + }; + + /** + * @ngdoc method + * @name $compileProvider#debugInfoEnabled + * + * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the + * current debugInfoEnabled state + * @returns {*} current value if used as getter or itself (chaining) if used as setter + * + * @kind function + * + * @description + * Call this method to enable/disable various debug runtime information in the compiler such as adding + * binding information and a reference to the current scope on to DOM elements. + * If enabled, the compiler will add the following to DOM elements that have been bound to the scope + * * `ng-binding` CSS class + * * `$binding` data property containing an array of the binding expressions + * + * You may want to disable this in production for a significant performance boost. See + * {@link guide/production#disabling-debug-data Disabling Debug Data} for more. + * + * The default value is true. + */ + var debugInfoEnabled = true; + this.debugInfoEnabled = function(enabled) { + if (isDefined(enabled)) { + debugInfoEnabled = enabled; + return this; + } + return debugInfoEnabled; + }; + + this.$get = [ + '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', + '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri', + function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, + $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) { + + var Attributes = function(element, attributesToCopy) { + if (attributesToCopy) { + var keys = Object.keys(attributesToCopy); + var i, l, key; + + for (i = 0, l = keys.length; i < l; i++) { + key = keys[i]; + this[key] = attributesToCopy[key]; + } + } else { + this.$attr = {}; + } + + this.$$element = element; + }; + + Attributes.prototype = { + /** + * @ngdoc method + * @name $compile.directive.Attributes#$normalize + * @kind function + * + * @description + * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or + * `data-`) to its normalized, camelCase form. + * + * Also there is special case for Moz prefix starting with upper case letter. + * + * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives} + * + * @param {string} name Name to normalize + */ + $normalize: directiveNormalize, + + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$addClass + * @kind function + * + * @description + * Adds the CSS class value specified by the classVal parameter to the element. If animations + * are enabled then an animation will be triggered for the class addition. + * + * @param {string} classVal The className value that will be added to the element + */ + $addClass: function(classVal) { + if (classVal && classVal.length > 0) { + $animate.addClass(this.$$element, classVal); + } + }, + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$removeClass + * @kind function + * + * @description + * Removes the CSS class value specified by the classVal parameter from the element. If + * animations are enabled then an animation will be triggered for the class removal. + * + * @param {string} classVal The className value that will be removed from the element + */ + $removeClass: function(classVal) { + if (classVal && classVal.length > 0) { + $animate.removeClass(this.$$element, classVal); + } + }, + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$updateClass + * @kind function + * + * @description + * Adds and removes the appropriate CSS class values to the element based on the difference + * between the new and old CSS class values (specified as newClasses and oldClasses). + * + * @param {string} newClasses The current CSS className value + * @param {string} oldClasses The former CSS className value + */ + $updateClass: function(newClasses, oldClasses) { + var toAdd = tokenDifference(newClasses, oldClasses); + if (toAdd && toAdd.length) { + $animate.addClass(this.$$element, toAdd); + } + + var toRemove = tokenDifference(oldClasses, newClasses); + if (toRemove && toRemove.length) { + $animate.removeClass(this.$$element, toRemove); + } + }, + + /** + * Set a normalized attribute on the element in a way such that all directives + * can share the attribute. This function properly handles boolean attributes. + * @param {string} key Normalized key. (ie ngAttribute) + * @param {string|boolean} value The value to set. If `null` attribute will be deleted. + * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute. + * Defaults to true. + * @param {string=} attrName Optional none normalized name. Defaults to key. + */ + $set: function(key, value, writeAttr, attrName) { + // TODO: decide whether or not to throw an error if "class" + //is set through this function since it may cause $updateClass to + //become unstable. + + var node = this.$$element[0], + booleanKey = getBooleanAttrName(node, key), + aliasedKey = getAliasedAttrName(key), + observer = key, + nodeName; + + if (booleanKey) { + this.$$element.prop(key, value); + attrName = booleanKey; + } else if (aliasedKey) { + this[aliasedKey] = value; + observer = aliasedKey; + } + + this[key] = value; + + // translate normalized key to actual key + if (attrName) { + this.$attr[key] = attrName; + } else { + attrName = this.$attr[key]; + if (!attrName) { + this.$attr[key] = attrName = snake_case(key, '-'); + } + } + + nodeName = nodeName_(this.$$element); + + if ((nodeName === 'a' && key === 'href') || + (nodeName === 'img' && key === 'src')) { + // sanitize a[href] and img[src] values + this[key] = value = $$sanitizeUri(value, key === 'src'); + } else if (nodeName === 'img' && key === 'srcset') { + // sanitize img[srcset] values + var result = ""; + + // first check if there are spaces because it's not the same pattern + var trimmedSrcset = trim(value); + // ( 999x ,| 999w ,| ,|, ) + var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/; + var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/; + + // split srcset into tuple of uri and descriptor except for the last item + var rawUris = trimmedSrcset.split(pattern); + + // for each tuples + var nbrUrisWith2parts = Math.floor(rawUris.length / 2); + for (var i = 0; i < nbrUrisWith2parts; i++) { + var innerIdx = i * 2; + // sanitize the uri + result += $$sanitizeUri(trim(rawUris[innerIdx]), true); + // add the descriptor + result += (" " + trim(rawUris[innerIdx + 1])); + } + + // split the last item into uri and descriptor + var lastTuple = trim(rawUris[i * 2]).split(/\s/); + + // sanitize the last uri + result += $$sanitizeUri(trim(lastTuple[0]), true); + + // and add the last descriptor if any + if (lastTuple.length === 2) { + result += (" " + trim(lastTuple[1])); + } + this[key] = value = result; + } + + if (writeAttr !== false) { + if (value === null || isUndefined(value)) { + this.$$element.removeAttr(attrName); + } else { + this.$$element.attr(attrName, value); + } + } + + // fire observers + var $$observers = this.$$observers; + $$observers && forEach($$observers[observer], function(fn) { + try { + fn(value); + } catch (e) { + $exceptionHandler(e); + } + }); + }, + + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$observe + * @kind function + * + * @description + * Observes an interpolated attribute. + * + * The observer function will be invoked once during the next `$digest` following + * compilation. The observer is then invoked whenever the interpolated value + * changes. + * + * @param {string} key Normalized key. (ie ngAttribute) . + * @param {function(interpolatedValue)} fn Function that will be called whenever + the interpolated value of the attribute changes. + * See the {@link guide/directive#text-and-attribute-bindings Directives} guide for more info. + * @returns {function()} Returns a deregistration function for this observer. + */ + $observe: function(key, fn) { + var attrs = this, + $$observers = (attrs.$$observers || (attrs.$$observers = createMap())), + listeners = ($$observers[key] || ($$observers[key] = [])); + + listeners.push(fn); + $rootScope.$evalAsync(function() { + if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) { + // no one registered attribute interpolation function, so lets call it manually + fn(attrs[key]); + } + }); + + return function() { + arrayRemove(listeners, fn); + }; + } + }; + + + function safeAddClass($element, className) { + try { + $element.addClass(className); + } catch (e) { + // ignore, since it means that we are trying to set class on + // SVG element, where class name is read-only. + } + } + + + var startSymbol = $interpolate.startSymbol(), + endSymbol = $interpolate.endSymbol(), + denormalizeTemplate = (startSymbol == '{{' || endSymbol == '}}') + ? identity + : function denormalizeTemplate(template) { + return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); + }, + NG_ATTR_BINDING = /^ngAttr[A-Z]/; + + compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) { + var bindings = $element.data('$binding') || []; + + if (isArray(binding)) { + bindings = bindings.concat(binding); + } else { + bindings.push(binding); + } + + $element.data('$binding', bindings); + } : noop; + + compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) { + safeAddClass($element, 'ng-binding'); + } : noop; + + compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) { + var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope'; + $element.data(dataName, scope); + } : noop; + + compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) { + safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope'); + } : noop; + + return compile; + + //================================ + + function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, + previousCompileContext) { + if (!($compileNodes instanceof jqLite)) { + // jquery always rewraps, whereas we need to preserve the original selector so that we can + // modify it. + $compileNodes = jqLite($compileNodes); + } + // We can not compile top level text elements since text nodes can be merged and we will + // not be able to attach scope data to them, so we will wrap them in + forEach($compileNodes, function(node, index) { + if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/) /* non-empty */ ) { + $compileNodes[index] = jqLite(node).wrap('').parent()[0]; + } + }); + var compositeLinkFn = + compileNodes($compileNodes, transcludeFn, $compileNodes, + maxPriority, ignoreDirective, previousCompileContext); + compile.$$addScopeClass($compileNodes); + var namespace = null; + return function publicLinkFn(scope, cloneConnectFn, options) { + assertArg(scope, 'scope'); + + options = options || {}; + var parentBoundTranscludeFn = options.parentBoundTranscludeFn, + transcludeControllers = options.transcludeControllers, + futureParentElement = options.futureParentElement; + + // When `parentBoundTranscludeFn` is passed, it is a + // `controllersBoundTransclude` function (it was previously passed + // as `transclude` to directive.link) so we must unwrap it to get + // its `boundTranscludeFn` + if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { + parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; + } + + if (!namespace) { + namespace = detectNamespaceForChildElements(futureParentElement); + } + var $linkNode; + if (namespace !== 'html') { + // When using a directive with replace:true and templateUrl the $compileNodes + // (or a child element inside of them) + // might change, so we need to recreate the namespace adapted compileNodes + // for call to the link function. + // Note: This will already clone the nodes... + $linkNode = jqLite( + wrapTemplate(namespace, jqLite('
    ').append($compileNodes).html()) + ); + } else if (cloneConnectFn) { + // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart + // and sometimes changes the structure of the DOM. + $linkNode = JQLitePrototype.clone.call($compileNodes); + } else { + $linkNode = $compileNodes; + } + + if (transcludeControllers) { + for (var controllerName in transcludeControllers) { + $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); + } + } + + compile.$$addScopeInfo($linkNode, scope); + + if (cloneConnectFn) cloneConnectFn($linkNode, scope); + if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); + return $linkNode; + }; + } + + function detectNamespaceForChildElements(parentElement) { + // TODO: Make this detect MathML as well... + var node = parentElement && parentElement[0]; + if (!node) { + return 'html'; + } else { + return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html'; + } + } + + /** + * Compile function matches each node in nodeList against the directives. Once all directives + * for a particular node are collected their compile functions are executed. The compile + * functions return values - the linking functions - are combined into a composite linking + * function, which is the a linking function for the node. + * + * @param {NodeList} nodeList an array of nodes or NodeList to compile + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the + * scope argument is auto-generated to the new child of the transcluded parent scope. + * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then + * the rootElement must be set the jqLite collection of the compile root. This is + * needed so that the jqLite collection items can be replaced with widgets. + * @param {number=} maxPriority Max directive priority. + * @returns {Function} A composite linking function of all of the matched directives or null. + */ + function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, + previousCompileContext) { + var linkFns = [], + attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; + + for (var i = 0; i < nodeList.length; i++) { + attrs = new Attributes(); + + // we must always refer to nodeList[i] since the nodes can be replaced underneath us. + directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, + ignoreDirective); + + nodeLinkFn = (directives.length) + ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, + null, [], [], previousCompileContext) + : null; + + if (nodeLinkFn && nodeLinkFn.scope) { + compile.$$addScopeClass(attrs.$$element); + } + + childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || + !(childNodes = nodeList[i].childNodes) || + !childNodes.length) + ? null + : compileNodes(childNodes, + nodeLinkFn ? ( + (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) + && nodeLinkFn.transclude) : transcludeFn); + + if (nodeLinkFn || childLinkFn) { + linkFns.push(i, nodeLinkFn, childLinkFn); + linkFnFound = true; + nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn; + } + + //use the previous context only for the first element in the virtual group + previousCompileContext = null; + } + + // return a linking function if we have found anything, null otherwise + return linkFnFound ? compositeLinkFn : null; + + function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { + var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; + var stableNodeList; + + + if (nodeLinkFnFound) { + // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our + // offsets don't get screwed up + var nodeListLength = nodeList.length; + stableNodeList = new Array(nodeListLength); + + // create a sparse array by only copying the elements which have a linkFn + for (i = 0; i < linkFns.length; i+=3) { + idx = linkFns[i]; + stableNodeList[idx] = nodeList[idx]; + } + } else { + stableNodeList = nodeList; + } + + for (i = 0, ii = linkFns.length; i < ii;) { + node = stableNodeList[linkFns[i++]]; + nodeLinkFn = linkFns[i++]; + childLinkFn = linkFns[i++]; + + if (nodeLinkFn) { + if (nodeLinkFn.scope) { + childScope = scope.$new(); + compile.$$addScopeInfo(jqLite(node), childScope); + var destroyBindings = nodeLinkFn.$$destroyBindings; + if (destroyBindings) { + nodeLinkFn.$$destroyBindings = null; + childScope.$on('$destroyed', destroyBindings); + } + } else { + childScope = scope; + } + + if (nodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn( + scope, nodeLinkFn.transclude, parentBoundTranscludeFn); + + } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { + childBoundTranscludeFn = parentBoundTranscludeFn; + + } else if (!parentBoundTranscludeFn && transcludeFn) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); + + } else { + childBoundTranscludeFn = null; + } + + nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn, + nodeLinkFn); + + } else if (childLinkFn) { + childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); + } + } + } + } + + function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) { + + var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) { + + if (!transcludedScope) { + transcludedScope = scope.$new(false, containingScope); + transcludedScope.$$transcluded = true; + } + + return transcludeFn(transcludedScope, cloneFn, { + parentBoundTranscludeFn: previousBoundTranscludeFn, + transcludeControllers: controllers, + futureParentElement: futureParentElement + }); + }; + + return boundTranscludeFn; + } + + /** + * Looks for directives on the given node and adds them to the directive collection which is + * sorted. + * + * @param node Node to search. + * @param directives An array to which the directives are added to. This array is sorted before + * the function returns. + * @param attrs The shared attrs object which is used to populate the normalized attributes. + * @param {number=} maxPriority Max directive priority. + */ + function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) { + var nodeType = node.nodeType, + attrsMap = attrs.$attr, + match, + className; + + switch (nodeType) { + case NODE_TYPE_ELEMENT: /* Element */ + // use the node name: + addDirective(directives, + directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective); + + // iterate over the attributes + for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes, + j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) { + var attrStartName = false; + var attrEndName = false; + + attr = nAttrs[j]; + name = attr.name; + value = trim(attr.value); + + // support ngAttr attribute binding + ngAttrName = directiveNormalize(name); + if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) { + name = name.replace(PREFIX_REGEXP, '') + .substr(8).replace(/_(.)/g, function(match, letter) { + return letter.toUpperCase(); + }); + } + + var directiveNName = ngAttrName.replace(/(Start|End)$/, ''); + if (directiveIsMultiElement(directiveNName)) { + if (ngAttrName === directiveNName + 'Start') { + attrStartName = name; + attrEndName = name.substr(0, name.length - 5) + 'end'; + name = name.substr(0, name.length - 6); + } + } + + nName = directiveNormalize(name.toLowerCase()); + attrsMap[nName] = name; + if (isNgAttr || !attrs.hasOwnProperty(nName)) { + attrs[nName] = value; + if (getBooleanAttrName(node, nName)) { + attrs[nName] = true; // presence means true + } + } + addAttrInterpolateDirective(node, directives, value, nName, isNgAttr); + addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, + attrEndName); + } + + // use class as directive + className = node.className; + if (isObject(className)) { + // Maybe SVGAnimatedString + className = className.animVal; + } + if (isString(className) && className !== '') { + while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) { + nName = directiveNormalize(match[2]); + if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) { + attrs[nName] = trim(match[3]); + } + className = className.substr(match.index + match[0].length); + } + } + break; + case NODE_TYPE_TEXT: /* Text Node */ + if (msie === 11) { + // Workaround for #11781 + while (node.parentNode && node.nextSibling && node.nextSibling.nodeType === NODE_TYPE_TEXT) { + node.nodeValue = node.nodeValue + node.nextSibling.nodeValue; + node.parentNode.removeChild(node.nextSibling); + } + } + addTextInterpolateDirective(directives, node.nodeValue); + break; + case NODE_TYPE_COMMENT: /* Comment */ + try { + match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); + if (match) { + nName = directiveNormalize(match[1]); + if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) { + attrs[nName] = trim(match[2]); + } + } + } catch (e) { + // turns out that under some circumstances IE9 throws errors when one attempts to read + // comment's node value. + // Just ignore it and continue. (Can't seem to reproduce in test case.) + } + break; + } + + directives.sort(byPriority); + return directives; + } + + /** + * Given a node with an directive-start it collects all of the siblings until it finds + * directive-end. + * @param node + * @param attrStart + * @param attrEnd + * @returns {*} + */ + function groupScan(node, attrStart, attrEnd) { + var nodes = []; + var depth = 0; + if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) { + do { + if (!node) { + throw $compileMinErr('uterdir', + "Unterminated attribute, found '{0}' but no matching '{1}' found.", + attrStart, attrEnd); + } + if (node.nodeType == NODE_TYPE_ELEMENT) { + if (node.hasAttribute(attrStart)) depth++; + if (node.hasAttribute(attrEnd)) depth--; + } + nodes.push(node); + node = node.nextSibling; + } while (depth > 0); + } else { + nodes.push(node); + } + + return jqLite(nodes); + } + + /** + * Wrapper for linking function which converts normal linking function into a grouped + * linking function. + * @param linkFn + * @param attrStart + * @param attrEnd + * @returns {Function} + */ + function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) { + return function(scope, element, attrs, controllers, transcludeFn) { + element = groupScan(element[0], attrStart, attrEnd); + return linkFn(scope, element, attrs, controllers, transcludeFn); + }; + } + + /** + * Once the directives have been collected, their compile functions are executed. This method + * is responsible for inlining directive templates as well as terminating the application + * of the directives if the terminal directive has been reached. + * + * @param {Array} directives Array of collected directives to execute their compile function. + * this needs to be pre-sorted by priority order. + * @param {Node} compileNode The raw DOM node to apply the compile functions to + * @param {Object} templateAttrs The shared attribute function + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the + * scope argument is auto-generated to the new + * child of the transcluded parent scope. + * @param {JQLite} jqCollection If we are working on the root of the compile tree then this + * argument has the root jqLite array so that we can replace nodes + * on it. + * @param {Object=} originalReplaceDirective An optional directive that will be ignored when + * compiling the transclusion. + * @param {Array.} preLinkFns + * @param {Array.} postLinkFns + * @param {Object} previousCompileContext Context used for previous compilation of the current + * node + * @returns {Function} linkFn + */ + function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, + jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, + previousCompileContext) { + previousCompileContext = previousCompileContext || {}; + + var terminalPriority = -Number.MAX_VALUE, + newScopeDirective = previousCompileContext.newScopeDirective, + controllerDirectives = previousCompileContext.controllerDirectives, + newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective, + templateDirective = previousCompileContext.templateDirective, + nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective, + hasTranscludeDirective = false, + hasTemplate = false, + hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective, + $compileNode = templateAttrs.$$element = jqLite(compileNode), + directive, + directiveName, + $template, + replaceDirective = originalReplaceDirective, + childTranscludeFn = transcludeFn, + linkFn, + directiveValue; + + // executes all directives on the current element + for (var i = 0, ii = directives.length; i < ii; i++) { + directive = directives[i]; + var attrStart = directive.$$start; + var attrEnd = directive.$$end; + + // collect multiblock sections + if (attrStart) { + $compileNode = groupScan(compileNode, attrStart, attrEnd); + } + $template = undefined; + + if (terminalPriority > directive.priority) { + break; // prevent further processing of directives + } + + if (directiveValue = directive.scope) { + + // skip the check for directives with async templates, we'll check the derived sync + // directive when the template arrives + if (!directive.templateUrl) { + if (isObject(directiveValue)) { + // This directive is trying to add an isolated scope. + // Check that there is no scope of any kind already + assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective, + directive, $compileNode); + newIsolateScopeDirective = directive; + } else { + // This directive is trying to add a child scope. + // Check that there is no isolated scope already + assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, + $compileNode); + } + } + + newScopeDirective = newScopeDirective || directive; + } + + directiveName = directive.name; + + if (!directive.templateUrl && directive.controller) { + directiveValue = directive.controller; + controllerDirectives = controllerDirectives || createMap(); + assertNoDuplicate("'" + directiveName + "' controller", + controllerDirectives[directiveName], directive, $compileNode); + controllerDirectives[directiveName] = directive; + } + + if (directiveValue = directive.transclude) { + hasTranscludeDirective = true; + + // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion. + // This option should only be used by directives that know how to safely handle element transclusion, + // where the transcluded nodes are added or replaced after linking. + if (!directive.$$tlb) { + assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode); + nonTlbTranscludeDirective = directive; + } + + if (directiveValue == 'element') { + hasElementTranscludeDirective = true; + terminalPriority = directive.priority; + $template = $compileNode; + $compileNode = templateAttrs.$$element = + jqLite(document.createComment(' ' + directiveName + ': ' + + templateAttrs[directiveName] + ' ')); + compileNode = $compileNode[0]; + replaceWith(jqCollection, sliceArgs($template), compileNode); + + childTranscludeFn = compile($template, transcludeFn, terminalPriority, + replaceDirective && replaceDirective.name, { + // Don't pass in: + // - controllerDirectives - otherwise we'll create duplicates controllers + // - newIsolateScopeDirective or templateDirective - combining templates with + // element transclusion doesn't make sense. + // + // We need only nonTlbTranscludeDirective so that we prevent putting transclusion + // on the same element more than once. + nonTlbTranscludeDirective: nonTlbTranscludeDirective + }); + } else { + $template = jqLite(jqLiteClone(compileNode)).contents(); + $compileNode.empty(); // clear contents + childTranscludeFn = compile($template, transcludeFn); + } + } + + if (directive.template) { + hasTemplate = true; + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + + directiveValue = (isFunction(directive.template)) + ? directive.template($compileNode, templateAttrs) + : directive.template; + + directiveValue = denormalizeTemplate(directiveValue); + + if (directive.replace) { + replaceDirective = directive; + if (jqLiteIsTextNode(directiveValue)) { + $template = []; + } else { + $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue))); + } + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { + throw $compileMinErr('tplrt', + "Template for directive '{0}' must have exactly one root element. {1}", + directiveName, ''); + } + + replaceWith(jqCollection, $compileNode, compileNode); + + var newTemplateAttrs = {$attr: {}}; + + // combine directives from the original node and from the template: + // - take the array of directives for this element + // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed) + // - collect directives from the template and sort them by priority + // - combine directives as: processed + template + unprocessed + var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs); + var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1)); + + if (newIsolateScopeDirective) { + markDirectivesAsIsolate(templateDirectives); + } + directives = directives.concat(templateDirectives).concat(unprocessedDirectives); + mergeTemplateAttributes(templateAttrs, newTemplateAttrs); + + ii = directives.length; + } else { + $compileNode.html(directiveValue); + } + } + + if (directive.templateUrl) { + hasTemplate = true; + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + + if (directive.replace) { + replaceDirective = directive; + } + + nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode, + templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, { + controllerDirectives: controllerDirectives, + newScopeDirective: (newScopeDirective !== directive) && newScopeDirective, + newIsolateScopeDirective: newIsolateScopeDirective, + templateDirective: templateDirective, + nonTlbTranscludeDirective: nonTlbTranscludeDirective + }); + ii = directives.length; + } else if (directive.compile) { + try { + linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn); + if (isFunction(linkFn)) { + addLinkFns(null, linkFn, attrStart, attrEnd); + } else if (linkFn) { + addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd); + } + } catch (e) { + $exceptionHandler(e, startingTag($compileNode)); + } + } + + if (directive.terminal) { + nodeLinkFn.terminal = true; + terminalPriority = Math.max(terminalPriority, directive.priority); + } + + } + + nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true; + nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective; + nodeLinkFn.templateOnThisElement = hasTemplate; + nodeLinkFn.transclude = childTranscludeFn; + + previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective; + + // might be normal or delayed nodeLinkFn depending on if templateUrl is present + return nodeLinkFn; + + //////////////////// + + function addLinkFns(pre, post, attrStart, attrEnd) { + if (pre) { + if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd); + pre.require = directive.require; + pre.directiveName = directiveName; + if (newIsolateScopeDirective === directive || directive.$$isolateScope) { + pre = cloneAndAnnotateFn(pre, {isolateScope: true}); + } + preLinkFns.push(pre); + } + if (post) { + if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd); + post.require = directive.require; + post.directiveName = directiveName; + if (newIsolateScopeDirective === directive || directive.$$isolateScope) { + post = cloneAndAnnotateFn(post, {isolateScope: true}); + } + postLinkFns.push(post); + } + } + + + function getControllers(directiveName, require, $element, elementControllers) { + var value; + + if (isString(require)) { + var match = require.match(REQUIRE_PREFIX_REGEXP); + var name = require.substring(match[0].length); + var inheritType = match[1] || match[3]; + var optional = match[2] === '?'; + + //If only parents then start at the parent element + if (inheritType === '^^') { + $element = $element.parent(); + //Otherwise attempt getting the controller from elementControllers in case + //the element is transcluded (and has no data) and to avoid .data if possible + } else { + value = elementControllers && elementControllers[name]; + value = value && value.instance; + } + + if (!value) { + var dataName = '$' + name + 'Controller'; + value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName); + } + + if (!value && !optional) { + throw $compileMinErr('ctreq', + "Controller '{0}', required by directive '{1}', can't be found!", + name, directiveName); + } + } else if (isArray(require)) { + value = []; + for (var i = 0, ii = require.length; i < ii; i++) { + value[i] = getControllers(directiveName, require[i], $element, elementControllers); + } + } + + return value || null; + } + + function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope) { + var elementControllers = createMap(); + for (var controllerKey in controllerDirectives) { + var directive = controllerDirectives[controllerKey]; + var locals = { + $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope, + $element: $element, + $attrs: attrs, + $transclude: transcludeFn + }; + + var controller = directive.controller; + if (controller == '@') { + controller = attrs[directive.name]; + } + + var controllerInstance = $controller(controller, locals, true, directive.controllerAs); + + // For directives with element transclusion the element is a comment, + // but jQuery .data doesn't support attaching data to comment nodes as it's hard to + // clean up (http://bugs.jquery.com/ticket/8335). + // Instead, we save the controllers for the element in a local hash and attach to .data + // later, once we have the actual element. + elementControllers[directive.name] = controllerInstance; + if (!hasElementTranscludeDirective) { + $element.data('$' + directive.name + 'Controller', controllerInstance.instance); + } + } + return elementControllers; + } + + function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn, + thisLinkFn) { + var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element, + attrs; + + if (compileNode === linkNode) { + attrs = templateAttrs; + $element = templateAttrs.$$element; + } else { + $element = jqLite(linkNode); + attrs = new Attributes($element, templateAttrs); + } + + if (newIsolateScopeDirective) { + isolateScope = scope.$new(true); + } + + if (boundTranscludeFn) { + // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` + // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` + transcludeFn = controllersBoundTransclude; + transcludeFn.$$boundTransclude = boundTranscludeFn; + } + + if (controllerDirectives) { + elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope); + } + + if (newIsolateScopeDirective) { + // Initialize isolate scope bindings for new isolate scope directive. + compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || + templateDirective === newIsolateScopeDirective.$$originalDirective))); + compile.$$addScopeClass($element, true); + isolateScope.$$isolateBindings = + newIsolateScopeDirective.$$isolateBindings; + initializeDirectiveBindings(scope, attrs, isolateScope, + isolateScope.$$isolateBindings, + newIsolateScopeDirective, isolateScope); + } + if (elementControllers) { + // Initialize bindToController bindings for new/isolate scopes + var scopeDirective = newIsolateScopeDirective || newScopeDirective; + var bindings; + var controllerForBindings; + if (scopeDirective && elementControllers[scopeDirective.name]) { + bindings = scopeDirective.$$bindings.bindToController; + controller = elementControllers[scopeDirective.name]; + + if (controller && controller.identifier && bindings) { + controllerForBindings = controller; + thisLinkFn.$$destroyBindings = + initializeDirectiveBindings(scope, attrs, controller.instance, + bindings, scopeDirective); + } + } + for (i in elementControllers) { + controller = elementControllers[i]; + var controllerResult = controller(); + + if (controllerResult !== controller.instance) { + // If the controller constructor has a return value, overwrite the instance + // from setupControllers and update the element data + controller.instance = controllerResult; + $element.data('$' + i + 'Controller', controllerResult); + if (controller === controllerForBindings) { + // Remove and re-install bindToController bindings + thisLinkFn.$$destroyBindings(); + thisLinkFn.$$destroyBindings = + initializeDirectiveBindings(scope, attrs, controllerResult, bindings, scopeDirective); + } + } + } + } + + // PRELINKING + for (i = 0, ii = preLinkFns.length; i < ii; i++) { + linkFn = preLinkFns[i]; + invokeLinkFn(linkFn, + linkFn.isolateScope ? isolateScope : scope, + $element, + attrs, + linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), + transcludeFn + ); + } + + // RECURSION + // We only pass the isolate scope, if the isolate directive has a template, + // otherwise the child elements do not belong to the isolate directive. + var scopeToChild = scope; + if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) { + scopeToChild = isolateScope; + } + childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn); + + // POSTLINKING + for (i = postLinkFns.length - 1; i >= 0; i--) { + linkFn = postLinkFns[i]; + invokeLinkFn(linkFn, + linkFn.isolateScope ? isolateScope : scope, + $element, + attrs, + linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), + transcludeFn + ); + } + + // This is the function that is injected as `$transclude`. + // Note: all arguments are optional! + function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) { + var transcludeControllers; + + // No scope passed in: + if (!isScope(scope)) { + futureParentElement = cloneAttachFn; + cloneAttachFn = scope; + scope = undefined; + } + + if (hasElementTranscludeDirective) { + transcludeControllers = elementControllers; + } + if (!futureParentElement) { + futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; + } + return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); + } + } + } + + function markDirectivesAsIsolate(directives) { + // mark all directives as needing isolate scope. + for (var j = 0, jj = directives.length; j < jj; j++) { + directives[j] = inherit(directives[j], {$$isolateScope: true}); + } + } + + /** + * looks up the directive and decorates it with exception handling and proper parameters. We + * call this the boundDirective. + * + * @param {string} name name of the directive to look up. + * @param {string} location The directive must be found in specific format. + * String containing any of theses characters: + * + * * `E`: element name + * * `A': attribute + * * `C`: class + * * `M`: comment + * @returns {boolean} true if directive was added. + */ + function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, + endAttrName) { + if (name === ignoreDirective) return null; + var match = null; + if (hasDirectives.hasOwnProperty(name)) { + for (var directive, directives = $injector.get(name + Suffix), + i = 0, ii = directives.length; i < ii; i++) { + try { + directive = directives[i]; + if ((isUndefined(maxPriority) || maxPriority > directive.priority) && + directive.restrict.indexOf(location) != -1) { + if (startAttrName) { + directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); + } + tDirectives.push(directive); + match = directive; + } + } catch (e) { $exceptionHandler(e); } + } + } + return match; + } + + + /** + * looks up the directive and returns true if it is a multi-element directive, + * and therefore requires DOM nodes between -start and -end markers to be grouped + * together. + * + * @param {string} name name of the directive to look up. + * @returns true if directive was registered as multi-element. + */ + function directiveIsMultiElement(name) { + if (hasDirectives.hasOwnProperty(name)) { + for (var directive, directives = $injector.get(name + Suffix), + i = 0, ii = directives.length; i < ii; i++) { + directive = directives[i]; + if (directive.multiElement) { + return true; + } + } + } + return false; + } + + /** + * When the element is replaced with HTML template then the new attributes + * on the template need to be merged with the existing attributes in the DOM. + * The desired effect is to have both of the attributes present. + * + * @param {object} dst destination attributes (original DOM) + * @param {object} src source attributes (from the directive template) + */ + function mergeTemplateAttributes(dst, src) { + var srcAttr = src.$attr, + dstAttr = dst.$attr, + $element = dst.$$element; + + // reapply the old attributes to the new element + forEach(dst, function(value, key) { + if (key.charAt(0) != '$') { + if (src[key] && src[key] !== value) { + value += (key === 'style' ? ';' : ' ') + src[key]; + } + dst.$set(key, value, true, srcAttr[key]); + } + }); + + // copy the new attributes on the old attrs object + forEach(src, function(value, key) { + if (key == 'class') { + safeAddClass($element, value); + dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value; + } else if (key == 'style') { + $element.attr('style', $element.attr('style') + ';' + value); + dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value; + // `dst` will never contain hasOwnProperty as DOM parser won't let it. + // You will get an "InvalidCharacterError: DOM Exception 5" error if you + // have an attribute like "has-own-property" or "data-has-own-property", etc. + } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) { + dst[key] = value; + dstAttr[key] = srcAttr[key]; + } + }); + } + + + function compileTemplateUrl(directives, $compileNode, tAttrs, + $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) { + var linkQueue = [], + afterTemplateNodeLinkFn, + afterTemplateChildLinkFn, + beforeTemplateCompileNode = $compileNode[0], + origAsyncDirective = directives.shift(), + derivedSyncDirective = inherit(origAsyncDirective, { + templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective + }), + templateUrl = (isFunction(origAsyncDirective.templateUrl)) + ? origAsyncDirective.templateUrl($compileNode, tAttrs) + : origAsyncDirective.templateUrl, + templateNamespace = origAsyncDirective.templateNamespace; + + $compileNode.empty(); + + $templateRequest(templateUrl) + .then(function(content) { + var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn; + + content = denormalizeTemplate(content); + + if (origAsyncDirective.replace) { + if (jqLiteIsTextNode(content)) { + $template = []; + } else { + $template = removeComments(wrapTemplate(templateNamespace, trim(content))); + } + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { + throw $compileMinErr('tplrt', + "Template for directive '{0}' must have exactly one root element. {1}", + origAsyncDirective.name, templateUrl); + } + + tempTemplateAttrs = {$attr: {}}; + replaceWith($rootElement, $compileNode, compileNode); + var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs); + + if (isObject(origAsyncDirective.scope)) { + markDirectivesAsIsolate(templateDirectives); + } + directives = templateDirectives.concat(directives); + mergeTemplateAttributes(tAttrs, tempTemplateAttrs); + } else { + compileNode = beforeTemplateCompileNode; + $compileNode.html(content); + } + + directives.unshift(derivedSyncDirective); + + afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, + childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, + previousCompileContext); + forEach($rootElement, function(node, i) { + if (node == compileNode) { + $rootElement[i] = $compileNode[0]; + } + }); + afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn); + + while (linkQueue.length) { + var scope = linkQueue.shift(), + beforeTemplateLinkNode = linkQueue.shift(), + linkRootElement = linkQueue.shift(), + boundTranscludeFn = linkQueue.shift(), + linkNode = $compileNode[0]; + + if (scope.$$destroyed) continue; + + if (beforeTemplateLinkNode !== beforeTemplateCompileNode) { + var oldClasses = beforeTemplateLinkNode.className; + + if (!(previousCompileContext.hasElementTranscludeDirective && + origAsyncDirective.replace)) { + // it was cloned therefore we have to clone as well. + linkNode = jqLiteClone(compileNode); + } + replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode); + + // Copy in CSS classes from original node + safeAddClass(jqLite(linkNode), oldClasses); + } + if (afterTemplateNodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); + } else { + childBoundTranscludeFn = boundTranscludeFn; + } + afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, + childBoundTranscludeFn, afterTemplateNodeLinkFn); + } + linkQueue = null; + }); + + return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) { + var childBoundTranscludeFn = boundTranscludeFn; + if (scope.$$destroyed) return; + if (linkQueue) { + linkQueue.push(scope, + node, + rootElement, + childBoundTranscludeFn); + } else { + if (afterTemplateNodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); + } + afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn, + afterTemplateNodeLinkFn); + } + }; + } + + + /** + * Sorting function for bound directives. + */ + function byPriority(a, b) { + var diff = b.priority - a.priority; + if (diff !== 0) return diff; + if (a.name !== b.name) return (a.name < b.name) ? -1 : 1; + return a.index - b.index; + } + + function assertNoDuplicate(what, previousDirective, directive, element) { + + function wrapModuleNameIfDefined(moduleName) { + return moduleName ? + (' (module: ' + moduleName + ')') : + ''; + } + + if (previousDirective) { + throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}', + previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName), + directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element)); + } + } + + + function addTextInterpolateDirective(directives, text) { + var interpolateFn = $interpolate(text, true); + if (interpolateFn) { + directives.push({ + priority: 0, + compile: function textInterpolateCompileFn(templateNode) { + var templateNodeParent = templateNode.parent(), + hasCompileParent = !!templateNodeParent.length; + + // When transcluding a template that has bindings in the root + // we don't have a parent and thus need to add the class during linking fn. + if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); + + return function textInterpolateLinkFn(scope, node) { + var parent = node.parent(); + if (!hasCompileParent) compile.$$addBindingClass(parent); + compile.$$addBindingInfo(parent, interpolateFn.expressions); + scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { + node[0].nodeValue = value; + }); + }; + } + }); + } + } + + + function wrapTemplate(type, template) { + type = lowercase(type || 'html'); + switch (type) { + case 'svg': + case 'math': + var wrapper = document.createElement('div'); + wrapper.innerHTML = '<' + type + '>' + template + ''; + return wrapper.childNodes[0].childNodes; + default: + return template; + } + } + + + function getTrustedContext(node, attrNormalizedName) { + if (attrNormalizedName == "srcdoc") { + return $sce.HTML; + } + var tag = nodeName_(node); + // maction[xlink:href] can source SVG. It's not limited to . + if (attrNormalizedName == "xlinkHref" || + (tag == "form" && attrNormalizedName == "action") || + (tag != "img" && (attrNormalizedName == "src" || + attrNormalizedName == "ngSrc"))) { + return $sce.RESOURCE_URL; + } + } + + + function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) { + var trustedContext = getTrustedContext(node, name); + allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing; + + var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing); + + // no interpolation found -> ignore + if (!interpolateFn) return; + + + if (name === "multiple" && nodeName_(node) === "select") { + throw $compileMinErr("selmulti", + "Binding to the 'multiple' attribute is not supported. Element: {0}", + startingTag(node)); + } + + directives.push({ + priority: 100, + compile: function() { + return { + pre: function attrInterpolatePreLinkFn(scope, element, attr) { + var $$observers = (attr.$$observers || (attr.$$observers = createMap())); + + if (EVENT_HANDLER_ATTR_REGEXP.test(name)) { + throw $compileMinErr('nodomevents', + "Interpolations for HTML DOM event attributes are disallowed. Please use the " + + "ng- versions (such as ng-click instead of onclick) instead."); + } + + // If the attribute has changed since last $interpolate()ed + var newValue = attr[name]; + if (newValue !== value) { + // we need to interpolate again since the attribute value has been updated + // (e.g. by another directive's compile function) + // ensure unset/empty values make interpolateFn falsy + interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing); + value = newValue; + } + + // if attribute was updated so that there is no interpolation going on we don't want to + // register any observers + if (!interpolateFn) return; + + // initialize attr object so that it's ready in case we need the value for isolate + // scope initialization, otherwise the value would not be available from isolate + // directive's linking fn during linking phase + attr[name] = interpolateFn(scope); + + ($$observers[name] || ($$observers[name] = [])).$$inter = true; + (attr.$$observers && attr.$$observers[name].$$scope || scope). + $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) { + //special case for class attribute addition + removal + //so that class changes can tap into the animation + //hooks provided by the $animate service. Be sure to + //skip animations when the first digest occurs (when + //both the new and the old values are the same) since + //the CSS classes are the non-interpolated values + if (name === 'class' && newValue != oldValue) { + attr.$updateClass(newValue, oldValue); + } else { + attr.$set(name, newValue); + } + }); + } + }; + } + }); + } + + + /** + * This is a special jqLite.replaceWith, which can replace items which + * have no parents, provided that the containing jqLite collection is provided. + * + * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes + * in the root of the tree. + * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep + * the shell, but replace its DOM node reference. + * @param {Node} newNode The new DOM node. + */ + function replaceWith($rootElement, elementsToRemove, newNode) { + var firstElementToRemove = elementsToRemove[0], + removeCount = elementsToRemove.length, + parent = firstElementToRemove.parentNode, + i, ii; + + if ($rootElement) { + for (i = 0, ii = $rootElement.length; i < ii; i++) { + if ($rootElement[i] == firstElementToRemove) { + $rootElement[i++] = newNode; + for (var j = i, j2 = j + removeCount - 1, + jj = $rootElement.length; + j < jj; j++, j2++) { + if (j2 < jj) { + $rootElement[j] = $rootElement[j2]; + } else { + delete $rootElement[j]; + } + } + $rootElement.length -= removeCount - 1; + + // If the replaced element is also the jQuery .context then replace it + // .context is a deprecated jQuery api, so we should set it only when jQuery set it + // http://api.jquery.com/context/ + if ($rootElement.context === firstElementToRemove) { + $rootElement.context = newNode; + } + break; + } + } + } + + if (parent) { + parent.replaceChild(newNode, firstElementToRemove); + } + + // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it? + var fragment = document.createDocumentFragment(); + fragment.appendChild(firstElementToRemove); + + if (jqLite.hasData(firstElementToRemove)) { + // Copy over user data (that includes Angular's $scope etc.). Don't copy private + // data here because there's no public interface in jQuery to do that and copying over + // event listeners (which is the main use of private data) wouldn't work anyway. + jqLite(newNode).data(jqLite(firstElementToRemove).data()); + + // Remove data of the replaced element. We cannot just call .remove() + // on the element it since that would deallocate scope that is needed + // for the new node. Instead, remove the data "manually". + if (!jQuery) { + delete jqLite.cache[firstElementToRemove[jqLite.expando]]; + } else { + // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after + // the replaced element. The cleanData version monkey-patched by Angular would cause + // the scope to be trashed and we do need the very same scope to work with the new + // element. However, we cannot just cache the non-patched version and use it here as + // that would break if another library patches the method after Angular does (one + // example is jQuery UI). Instead, set a flag indicating scope destroying should be + // skipped this one time. + skipDestroyOnNextJQueryCleanData = true; + jQuery.cleanData([firstElementToRemove]); + } + } + + for (var k = 1, kk = elementsToRemove.length; k < kk; k++) { + var element = elementsToRemove[k]; + jqLite(element).remove(); // must do this way to clean up expando + fragment.appendChild(element); + delete elementsToRemove[k]; + } + + elementsToRemove[0] = newNode; + elementsToRemove.length = 1; + } + + + function cloneAndAnnotateFn(fn, annotation) { + return extend(function() { return fn.apply(null, arguments); }, fn, annotation); + } + + + function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) { + try { + linkFn(scope, $element, attrs, controllers, transcludeFn); + } catch (e) { + $exceptionHandler(e, startingTag($element)); + } + } + + + // Set up $watches for isolate scope and controller bindings. This process + // only occurs for isolate scopes and new scopes with controllerAs. + function initializeDirectiveBindings(scope, attrs, destination, bindings, + directive, newScope) { + var onNewScopeDestroyed; + forEach(bindings, function(definition, scopeName) { + var attrName = definition.attrName, + optional = definition.optional, + mode = definition.mode, // @, =, or & + lastValue, + parentGet, parentSet, compare; + + switch (mode) { + + case '@': + if (!optional && !hasOwnProperty.call(attrs, attrName)) { + destination[scopeName] = attrs[attrName] = void 0; + } + attrs.$observe(attrName, function(value) { + if (isString(value)) { + destination[scopeName] = value; + } + }); + attrs.$$observers[attrName].$$scope = scope; + if (isString(attrs[attrName])) { + // If the attribute has been provided then we trigger an interpolation to ensure + // the value is there for use in the link fn + destination[scopeName] = $interpolate(attrs[attrName])(scope); + } + break; + + case '=': + if (!hasOwnProperty.call(attrs, attrName)) { + if (optional) break; + attrs[attrName] = void 0; + } + if (optional && !attrs[attrName]) break; + + parentGet = $parse(attrs[attrName]); + if (parentGet.literal) { + compare = equals; + } else { + compare = function(a, b) { return a === b || (a !== a && b !== b); }; + } + parentSet = parentGet.assign || function() { + // reset the change, or we will throw this exception on every $digest + lastValue = destination[scopeName] = parentGet(scope); + throw $compileMinErr('nonassign', + "Expression '{0}' used with directive '{1}' is non-assignable!", + attrs[attrName], directive.name); + }; + lastValue = destination[scopeName] = parentGet(scope); + var parentValueWatch = function parentValueWatch(parentValue) { + if (!compare(parentValue, destination[scopeName])) { + // we are out of sync and need to copy + if (!compare(parentValue, lastValue)) { + // parent changed and it has precedence + destination[scopeName] = parentValue; + } else { + // if the parent can be assigned then do so + parentSet(scope, parentValue = destination[scopeName]); + } + } + return lastValue = parentValue; + }; + parentValueWatch.$stateful = true; + var unwatch; + if (definition.collection) { + unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch); + } else { + unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); + } + onNewScopeDestroyed = (onNewScopeDestroyed || []); + onNewScopeDestroyed.push(unwatch); + break; + + case '&': + // Don't assign Object.prototype method to scope + parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop; + + // Don't assign noop to destination if expression is not valid + if (parentGet === noop && optional) break; + + destination[scopeName] = function(locals) { + return parentGet(scope, locals); + }; + break; + } + }); + var destroyBindings = onNewScopeDestroyed ? function destroyBindings() { + for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) { + onNewScopeDestroyed[i](); + } + } : noop; + if (newScope && destroyBindings !== noop) { + newScope.$on('$destroy', destroyBindings); + return noop; + } + return destroyBindings; + } + }]; + } + + var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i; + /** + * Converts all accepted directives format into proper directive name. + * @param name Name to normalize + */ + function directiveNormalize(name) { + return camelCase(name.replace(PREFIX_REGEXP, '')); + } + + /** + * @ngdoc type + * @name $compile.directive.Attributes + * + * @description + * A shared object between directive compile / linking functions which contains normalized DOM + * element attributes. The values reflect current binding state `{{ }}`. The normalization is + * needed since all of these are treated as equivalent in Angular: + * + * ``` + * + * ``` + */ + + /** + * @ngdoc property + * @name $compile.directive.Attributes#$attr + * + * @description + * A map of DOM element attribute names to the normalized name. This is + * needed to do reverse lookup from normalized name back to actual name. + */ + + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$set + * @kind function + * + * @description + * Set DOM element attribute value. + * + * + * @param {string} name Normalized element attribute name of the property to modify. The name is + * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr} + * property to the original name. + * @param {string} value Value to set the attribute to. The value can be an interpolated string. + */ + + + + /** + * Closure compiler type information + */ + + function nodesetLinkingFn( + /* angular.Scope */ scope, + /* NodeList */ nodeList, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn + ) {} + + function directiveLinkingFn( + /* nodesetLinkingFn */ nodesetLinkingFn, + /* angular.Scope */ scope, + /* Node */ node, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn + ) {} + + function tokenDifference(str1, str2) { + var values = '', + tokens1 = str1.split(/\s+/), + tokens2 = str2.split(/\s+/); + + outer: + for (var i = 0; i < tokens1.length; i++) { + var token = tokens1[i]; + for (var j = 0; j < tokens2.length; j++) { + if (token == tokens2[j]) continue outer; + } + values += (values.length > 0 ? ' ' : '') + token; + } + return values; + } + + function removeComments(jqNodes) { + jqNodes = jqLite(jqNodes); + var i = jqNodes.length; + + if (i <= 1) { + return jqNodes; + } + + while (i--) { + var node = jqNodes[i]; + if (node.nodeType === NODE_TYPE_COMMENT) { + splice.call(jqNodes, i, 1); + } + } + return jqNodes; + } + + var $controllerMinErr = minErr('$controller'); + + + var CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/; + function identifierForController(controller, ident) { + if (ident && isString(ident)) return ident; + if (isString(controller)) { + var match = CNTRL_REG.exec(controller); + if (match) return match[3]; + } + } + + + /** + * @ngdoc provider + * @name $controllerProvider + * @description + * The {@link ng.$controller $controller service} is used by Angular to create new + * controllers. + * + * This provider allows controller registration via the + * {@link ng.$controllerProvider#register register} method. + */ + function $ControllerProvider() { + var controllers = {}, + globals = false; + + /** + * @ngdoc method + * @name $controllerProvider#register + * @param {string|Object} name Controller name, or an object map of controllers where the keys are + * the names and the values are the constructors. + * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI + * annotations in the array notation). + */ + this.register = function(name, constructor) { + assertNotHasOwnProperty(name, 'controller'); + if (isObject(name)) { + extend(controllers, name); + } else { + controllers[name] = constructor; + } + }; + + /** + * @ngdoc method + * @name $controllerProvider#allowGlobals + * @description If called, allows `$controller` to find controller constructors on `window` + */ + this.allowGlobals = function() { + globals = true; + }; + + + this.$get = ['$injector', '$window', function($injector, $window) { + + /** + * @ngdoc service + * @name $controller + * @requires $injector + * + * @param {Function|string} constructor If called with a function then it's considered to be the + * controller constructor function. Otherwise it's considered to be a string which is used + * to retrieve the controller constructor using the following steps: + * + * * check if a controller with given name is registered via `$controllerProvider` + * * check if evaluating the string on the current scope returns a constructor + * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global + * `window` object (not recommended) + * + * The string can use the `controller as property` syntax, where the controller instance is published + * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this + * to work correctly. + * + * @param {Object} locals Injection locals for Controller. + * @return {Object} Instance of given controller. + * + * @description + * `$controller` service is responsible for instantiating controllers. + * + * It's just a simple call to {@link auto.$injector $injector}, but extracted into + * a service, so that one can override this service with [BC version](https://gist.github.com/1649788). + */ + return function(expression, locals, later, ident) { + // PRIVATE API: + // param `later` --- indicates that the controller's constructor is invoked at a later time. + // If true, $controller will allocate the object with the correct + // prototype chain, but will not invoke the controller until a returned + // callback is invoked. + // param `ident` --- An optional label which overrides the label parsed from the controller + // expression, if any. + var instance, match, constructor, identifier; + later = later === true; + if (ident && isString(ident)) { + identifier = ident; + } + + if (isString(expression)) { + match = expression.match(CNTRL_REG); + if (!match) { + throw $controllerMinErr('ctrlfmt', + "Badly formed controller string '{0}'. " + + "Must match `__name__ as __id__` or `__name__`.", expression); + } + constructor = match[1], + identifier = identifier || match[3]; + expression = controllers.hasOwnProperty(constructor) + ? controllers[constructor] + : getter(locals.$scope, constructor, true) || + (globals ? getter($window, constructor, true) : undefined); + + assertArgFn(expression, constructor, true); + } + + if (later) { + // Instantiate controller later: + // This machinery is used to create an instance of the object before calling the + // controller's constructor itself. + // + // This allows properties to be added to the controller before the constructor is + // invoked. Primarily, this is used for isolate scope bindings in $compile. + // + // This feature is not intended for use by applications, and is thus not documented + // publicly. + // Object creation: http://jsperf.com/create-constructor/2 + var controllerPrototype = (isArray(expression) ? + expression[expression.length - 1] : expression).prototype; + instance = Object.create(controllerPrototype || null); + + if (identifier) { + addIdentifier(locals, identifier, instance, constructor || expression.name); + } + + var instantiate; + return instantiate = extend(function() { + var result = $injector.invoke(expression, instance, locals, constructor); + if (result !== instance && (isObject(result) || isFunction(result))) { + instance = result; + if (identifier) { + // If result changed, re-assign controllerAs value to scope. + addIdentifier(locals, identifier, instance, constructor || expression.name); + } + } + return instance; + }, { + instance: instance, + identifier: identifier + }); + } + + instance = $injector.instantiate(expression, locals, constructor); + + if (identifier) { + addIdentifier(locals, identifier, instance, constructor || expression.name); + } + + return instance; + }; + + function addIdentifier(locals, identifier, instance, name) { + if (!(locals && isObject(locals.$scope))) { + throw minErr('$controller')('noscp', + "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", + name, identifier); + } + + locals.$scope[identifier] = instance; + } + }]; + } + + /** + * @ngdoc service + * @name $document + * @requires $window + * + * @description + * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object. + * + * @example + + +
    +

    $document title:

    +

    window.document title:

    +
    +
    + + angular.module('documentExample', []) + .controller('ExampleController', ['$scope', '$document', function($scope, $document) { + $scope.title = $document[0].title; + $scope.windowTitle = angular.element(window.document)[0].title; + }]); + +
    + */ + function $DocumentProvider() { + this.$get = ['$window', function(window) { + return jqLite(window.document); + }]; + } + + /** + * @ngdoc service + * @name $exceptionHandler + * @requires ng.$log + * + * @description + * Any uncaught exception in angular expressions is delegated to this service. + * The default implementation simply delegates to `$log.error` which logs it into + * the browser console. + * + * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by + * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. + * + * ## Example: + * + * ```js + * angular.module('exceptionOverride', []).factory('$exceptionHandler', function() { + * return function(exception, cause) { + * exception.message += ' (caused by "' + cause + '")'; + * throw exception; + * }; + * }); + * ``` + * + * This example will override the normal action of `$exceptionHandler`, to make angular + * exceptions fail hard when they happen, instead of just logging to the console. + * + *
    + * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind` + * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} + * (unless executed during a digest). + * + * If you wish, you can manually delegate exceptions, e.g. + * `try { ... } catch(e) { $exceptionHandler(e); }` + * + * @param {Error} exception Exception associated with the error. + * @param {string=} cause optional information about the context in which + * the error was thrown. + * + */ + function $ExceptionHandlerProvider() { + this.$get = ['$log', function($log) { + return function(exception, cause) { + $log.error.apply($log, arguments); + }; + }]; + } + + var $$ForceReflowProvider = function() { + this.$get = ['$document', function($document) { + return function(domNode) { + //the line below will force the browser to perform a repaint so + //that all the animated elements within the animation frame will + //be properly updated and drawn on screen. This is required to + //ensure that the preparation animation is properly flushed so that + //the active state picks up from there. DO NOT REMOVE THIS LINE. + //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH + //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND + //WILL TAKE YEARS AWAY FROM YOUR LIFE. + if (domNode) { + if (!domNode.nodeType && domNode instanceof jqLite) { + domNode = domNode[0]; + } + } else { + domNode = $document[0].body; + } + return domNode.offsetWidth + 1; + }; + }]; + }; + + var APPLICATION_JSON = 'application/json'; + var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'}; + var JSON_START = /^\[|^\{(?!\{)/; + var JSON_ENDS = { + '[': /]$/, + '{': /}$/ + }; + var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/; + var $httpMinErr = minErr('$http'); + var $httpMinErrLegacyFn = function(method) { + return function() { + throw $httpMinErr('legacy', 'The method `{0}` on the promise returned from `$http` has been disabled.', method); + }; + }; + + function serializeValue(v) { + if (isObject(v)) { + return isDate(v) ? v.toISOString() : toJson(v); + } + return v; + } + + + function $HttpParamSerializerProvider() { + /** + * @ngdoc service + * @name $httpParamSerializer + * @description + * + * Default {@link $http `$http`} params serializer that converts objects to strings + * according to the following rules: + * + * * `{'foo': 'bar'}` results in `foo=bar` + * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object) + * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element) + * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D"` (stringified and encoded representation of an object) + * + * Note that serializer will sort the request parameters alphabetically. + * */ + + this.$get = function() { + return function ngParamSerializer(params) { + if (!params) return ''; + var parts = []; + forEachSorted(params, function(value, key) { + if (value === null || isUndefined(value)) return; + if (isArray(value)) { + forEach(value, function(v, k) { + parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v))); + }); + } else { + parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value))); + } + }); + + return parts.join('&'); + }; + }; + } + + function $HttpParamSerializerJQLikeProvider() { + /** + * @ngdoc service + * @name $httpParamSerializerJQLike + * @description + * + * Alternative {@link $http `$http`} params serializer that follows + * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic. + * The serializer will also sort the params alphabetically. + * + * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property: + * + * ```js + * $http({ + * url: myUrl, + * method: 'GET', + * params: myParams, + * paramSerializer: '$httpParamSerializerJQLike' + * }); + * ``` + * + * It is also possible to set it as the default `paramSerializer` in the + * {@link $httpProvider#defaults `$httpProvider`}. + * + * Additionally, you can inject the serializer and use it explicitly, for example to serialize + * form data for submission: + * + * ```js + * .controller(function($http, $httpParamSerializerJQLike) { + * //... + * + * $http({ + * url: myUrl, + * method: 'POST', + * data: $httpParamSerializerJQLike(myData), + * headers: { + * 'Content-Type': 'application/x-www-form-urlencoded' + * } + * }); + * + * }); + * ``` + * + * */ + this.$get = function() { + return function jQueryLikeParamSerializer(params) { + if (!params) return ''; + var parts = []; + serialize(params, '', true); + return parts.join('&'); + + function serialize(toSerialize, prefix, topLevel) { + if (toSerialize === null || isUndefined(toSerialize)) return; + if (isArray(toSerialize)) { + forEach(toSerialize, function(value, index) { + serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']'); + }); + } else if (isObject(toSerialize) && !isDate(toSerialize)) { + forEachSorted(toSerialize, function(value, key) { + serialize(value, prefix + + (topLevel ? '' : '[') + + key + + (topLevel ? '' : ']')); + }); + } else { + parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize))); + } + } + }; + }; + } + + function defaultHttpResponseTransform(data, headers) { + if (isString(data)) { + // Strip json vulnerability protection prefix and trim whitespace + var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); + + if (tempData) { + var contentType = headers('Content-Type'); + if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) { + data = fromJson(tempData); + } + } + } + + return data; + } + + function isJsonLike(str) { + var jsonStart = str.match(JSON_START); + return jsonStart && JSON_ENDS[jsonStart[0]].test(str); + } + + /** + * Parse headers into key value object + * + * @param {string} headers Raw headers as a string + * @returns {Object} Parsed headers as key value object + */ + function parseHeaders(headers) { + var parsed = createMap(), i; + + function fillInParsed(key, val) { + if (key) { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + + if (isString(headers)) { + forEach(headers.split('\n'), function(line) { + i = line.indexOf(':'); + fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1))); + }); + } else if (isObject(headers)) { + forEach(headers, function(headerVal, headerKey) { + fillInParsed(lowercase(headerKey), trim(headerVal)); + }); + } + + return parsed; + } + + + /** + * Returns a function that provides access to parsed headers. + * + * Headers are lazy parsed when first requested. + * @see parseHeaders + * + * @param {(string|Object)} headers Headers to provide access to. + * @returns {function(string=)} Returns a getter function which if called with: + * + * - if called with single an argument returns a single header value or null + * - if called with no arguments returns an object containing all headers. + */ + function headersGetter(headers) { + var headersObj; + + return function(name) { + if (!headersObj) headersObj = parseHeaders(headers); + + if (name) { + var value = headersObj[lowercase(name)]; + if (value === void 0) { + value = null; + } + return value; + } + + return headersObj; + }; + } + + + /** + * Chain all given functions + * + * This function is used for both request and response transforming + * + * @param {*} data Data to transform. + * @param {function(string=)} headers HTTP headers getter fn. + * @param {number} status HTTP status code of the response. + * @param {(Function|Array.)} fns Function or an array of functions. + * @returns {*} Transformed data. + */ + function transformData(data, headers, status, fns) { + if (isFunction(fns)) { + return fns(data, headers, status); + } + + forEach(fns, function(fn) { + data = fn(data, headers, status); + }); + + return data; + } + + + function isSuccess(status) { + return 200 <= status && status < 300; + } + + + /** + * @ngdoc provider + * @name $httpProvider + * @description + * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. + * */ + function $HttpProvider() { + /** + * @ngdoc property + * @name $httpProvider#defaults + * @description + * + * Object containing default values for all {@link ng.$http $http} requests. + * + * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`} + * that will provide the cache for all requests who set their `cache` property to `true`. + * If you set the `defaults.cache = false` then only requests that specify their own custom + * cache object will be cached. See {@link $http#caching $http Caching} for more information. + * + * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. + * Defaults value is `'XSRF-TOKEN'`. + * + * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the + * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. + * + * - **`defaults.headers`** - {Object} - Default headers for all $http requests. + * Refer to {@link ng.$http#setting-http-headers $http} for documentation on + * setting default headers. + * - **`defaults.headers.common`** + * - **`defaults.headers.post`** + * - **`defaults.headers.put`** + * - **`defaults.headers.patch`** + * + * + * - **`defaults.paramSerializer`** - `{string|function(Object):string}` - A function + * used to the prepare string representation of request parameters (specified as an object). + * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}. + * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}. + * + **/ + var defaults = this.defaults = { + // transform incoming response data + transformResponse: [defaultHttpResponseTransform], + + // transform outgoing request data + transformRequest: [function(d) { + return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d; + }], + + // default headers + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + }, + post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), + put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), + patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON) + }, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + paramSerializer: '$httpParamSerializer' + }; + + var useApplyAsync = false; + /** + * @ngdoc method + * @name $httpProvider#useApplyAsync + * @description + * + * Configure $http service to combine processing of multiple http responses received at around + * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in + * significant performance improvement for bigger applications that make many HTTP requests + * concurrently (common during application bootstrap). + * + * Defaults to false. If no value is specified, returns the current configured value. + * + * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred + * "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window + * to load and share the same digest cycle. + * + * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. + * otherwise, returns the current configured value. + **/ + this.useApplyAsync = function(value) { + if (isDefined(value)) { + useApplyAsync = !!value; + return this; + } + return useApplyAsync; + }; + + var useLegacyPromise = true; + /** + * @ngdoc method + * @name $httpProvider#useLegacyPromiseExtensions + * @description + * + * Configure `$http` service to return promises without the shorthand methods `success` and `error`. + * This should be used to make sure that applications work without these methods. + * + * Defaults to false. If no value is specified, returns the current configured value. + * + * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods. + * + * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. + * otherwise, returns the current configured value. + **/ + this.useLegacyPromiseExtensions = function(value) { + if (isDefined(value)) { + useLegacyPromise = !!value; + return this; + } + return useLegacyPromise; + }; + + /** + * @ngdoc property + * @name $httpProvider#interceptors + * @description + * + * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http} + * pre-processing of request or postprocessing of responses. + * + * These service factories are ordered by request, i.e. they are applied in the same order as the + * array, on request, but reverse order, on response. + * + * {@link ng.$http#interceptors Interceptors detailed info} + **/ + var interceptorFactories = this.interceptors = []; + + this.$get = ['$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', + function($httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector) { + + var defaultCache = $cacheFactory('$http'); + + /** + * Make sure that default param serializer is exposed as a function + */ + defaults.paramSerializer = isString(defaults.paramSerializer) ? + $injector.get(defaults.paramSerializer) : defaults.paramSerializer; + + /** + * Interceptors stored in reverse order. Inner interceptors before outer interceptors. + * The reversal is needed so that we can build up the interception chain around the + * server request. + */ + var reversedInterceptors = []; + + forEach(interceptorFactories, function(interceptorFactory) { + reversedInterceptors.unshift(isString(interceptorFactory) + ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory)); + }); + + /** + * @ngdoc service + * @kind function + * @name $http + * @requires ng.$httpBackend + * @requires $cacheFactory + * @requires $rootScope + * @requires $q + * @requires $injector + * + * @description + * The `$http` service is a core Angular service that facilitates communication with the remote + * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest) + * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP). + * + * For unit testing applications that use `$http` service, see + * {@link ngMock.$httpBackend $httpBackend mock}. + * + * For a higher level of abstraction, please check out the {@link ngResource.$resource + * $resource} service. + * + * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by + * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage + * it is important to familiarize yourself with these APIs and the guarantees they provide. + * + * + * ## General usage + * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} — + * that is used to generate an HTTP request and returns a {@link ng.$q promise}. + * + * ```js + * // Simple GET request example: + * $http({ + * method: 'GET', + * url: '/someUrl' + * }).then(function successCallback(response) { + * // this callback will be called asynchronously + * // when the response is available + * }, function errorCallback(response) { + * // called asynchronously if an error occurs + * // or server returns response with an error status. + * }); + * ``` + * + * The response object has these properties: + * + * - **data** – `{string|Object}` – The response body transformed with the transform + * functions. + * - **status** – `{number}` – HTTP status code of the response. + * - **headers** – `{function([headerName])}` – Header getter function. + * - **config** – `{Object}` – The configuration object that was used to generate the request. + * - **statusText** – `{string}` – HTTP status text of the response. + * + * A response status code between 200 and 299 is considered a success status and + * will result in the success callback being called. Note that if the response is a redirect, + * XMLHttpRequest will transparently follow it, meaning that the error callback will not be + * called for such responses. + * + * + * ## Shortcut methods + * + * Shortcut methods are also available. All shortcut methods require passing in the URL, and + * request data must be passed in for POST/PUT requests. An optional config can be passed as the + * last argument. + * + * ```js + * $http.get('/someUrl', config).then(successCallback, errorCallback); + * $http.post('/someUrl', data, config).then(successCallback, errorCallback); + * ``` + * + * Complete list of shortcut methods: + * + * - {@link ng.$http#get $http.get} + * - {@link ng.$http#head $http.head} + * - {@link ng.$http#post $http.post} + * - {@link ng.$http#put $http.put} + * - {@link ng.$http#delete $http.delete} + * - {@link ng.$http#jsonp $http.jsonp} + * - {@link ng.$http#patch $http.patch} + * + * + * ## Writing Unit Tests that use $http + * When unit testing (using {@link ngMock ngMock}), it is necessary to call + * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending + * request using trained responses. + * + * ``` + * $httpBackend.expectGET(...); + * $http.get(...); + * $httpBackend.flush(); + * ``` + * + * ## Deprecation Notice + *
    + * The `$http` legacy promise methods `success` and `error` have been deprecated. + * Use the standard `then` method instead. + * If {@link $httpProvider#useLegacyPromiseExtensions `$httpProvider.useLegacyPromiseExtensions`} is set to + * `false` then these methods will throw {@link $http:legacy `$http/legacy`} error. + *
    + * + * ## Setting HTTP Headers + * + * The $http service will automatically add certain HTTP headers to all requests. These defaults + * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration + * object, which currently contains this default configuration: + * + * - `$httpProvider.defaults.headers.common` (headers that are common for all requests): + * - `Accept: application/json, text/plain, * / *` + * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests) + * - `Content-Type: application/json` + * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests) + * - `Content-Type: application/json` + * + * To add or overwrite these defaults, simply add or remove a property from these configuration + * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object + * with the lowercased HTTP method name as the key, e.g. + * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`. + * + * The defaults can also be set at runtime via the `$http.defaults` object in the same + * fashion. For example: + * + * ``` + * module.run(function($http) { + * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w' + * }); + * ``` + * + * In addition, you can supply a `headers` property in the config object passed when + * calling `$http(config)`, which overrides the defaults without changing them globally. + * + * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis, + * Use the `headers` property, setting the desired header to `undefined`. For example: + * + * ```js + * var req = { + * method: 'POST', + * url: 'http://example.com', + * headers: { + * 'Content-Type': undefined + * }, + * data: { test: 'test' } + * } + * + * $http(req).then(function(){...}, function(){...}); + * ``` + * + * ## Transforming Requests and Responses + * + * Both requests and responses can be transformed using transformation functions: `transformRequest` + * and `transformResponse`. These properties can be a single function that returns + * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions, + * which allows you to `push` or `unshift` a new transformation function into the transformation chain. + * + * ### Default Transformations + * + * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and + * `defaults.transformResponse` properties. If a request does not provide its own transformations + * then these will be applied. + * + * You can augment or replace the default transformations by modifying these properties by adding to or + * replacing the array. + * + * Angular provides the following default transformations: + * + * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`): + * + * - If the `data` property of the request configuration object contains an object, serialize it + * into JSON format. + * + * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`): + * + * - If XSRF prefix is detected, strip it (see Security Considerations section below). + * - If JSON response is detected, deserialize it using a JSON parser. + * + * + * ### Overriding the Default Transformations Per Request + * + * If you wish override the request/response transformations only for a single request then provide + * `transformRequest` and/or `transformResponse` properties on the configuration object passed + * into `$http`. + * + * Note that if you provide these properties on the config object the default transformations will be + * overwritten. If you wish to augment the default transformations then you must include them in your + * local transformation array. + * + * The following code demonstrates adding a new response transformation to be run after the default response + * transformations have been run. + * + * ```js + * function appendTransform(defaults, transform) { + * + * // We can't guarantee that the default transformation is an array + * defaults = angular.isArray(defaults) ? defaults : [defaults]; + * + * // Append the new transformation to the defaults + * return defaults.concat(transform); + * } + * + * $http({ + * url: '...', + * method: 'GET', + * transformResponse: appendTransform($http.defaults.transformResponse, function(value) { + * return doTransform(value); + * }) + * }); + * ``` + * + * + * ## Caching + * + * To enable caching, set the request configuration `cache` property to `true` (to use default + * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}). + * When the cache is enabled, `$http` stores the response from the server in the specified + * cache. The next time the same request is made, the response is served from the cache without + * sending a request to the server. + * + * Note that even if the response is served from cache, delivery of the data is asynchronous in + * the same way that real requests are. + * + * If there are multiple GET requests for the same URL that should be cached using the same + * cache, but the cache is not populated yet, only one request to the server will be made and + * the remaining requests will be fulfilled using the response from the first request. + * + * You can change the default cache to a new object (built with + * {@link ng.$cacheFactory `$cacheFactory`}) by updating the + * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set + * their `cache` property to `true` will now use this cache object. + * + * If you set the default cache to `false` then only requests that specify their own custom + * cache object will be cached. + * + * ## Interceptors + * + * Before you start creating interceptors, be sure to understand the + * {@link ng.$q $q and deferred/promise APIs}. + * + * For purposes of global error handling, authentication, or any kind of synchronous or + * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be + * able to intercept requests before they are handed to the server and + * responses before they are handed over to the application code that + * initiated these requests. The interceptors leverage the {@link ng.$q + * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing. + * + * The interceptors are service factories that are registered with the `$httpProvider` by + * adding them to the `$httpProvider.interceptors` array. The factory is called and + * injected with dependencies (if specified) and returns the interceptor. + * + * There are two kinds of interceptors (and two kinds of rejection interceptors): + * + * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to + * modify the `config` object or create a new one. The function needs to return the `config` + * object directly, or a promise containing the `config` or a new `config` object. + * * `requestError`: interceptor gets called when a previous interceptor threw an error or + * resolved with a rejection. + * * `response`: interceptors get called with http `response` object. The function is free to + * modify the `response` object or create a new one. The function needs to return the `response` + * object directly, or as a promise containing the `response` or a new `response` object. + * * `responseError`: interceptor gets called when a previous interceptor threw an error or + * resolved with a rejection. + * + * + * ```js + * // register the interceptor as a service + * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { + * return { + * // optional method + * 'request': function(config) { + * // do something on success + * return config; + * }, + * + * // optional method + * 'requestError': function(rejection) { + * // do something on error + * if (canRecover(rejection)) { + * return responseOrNewPromise + * } + * return $q.reject(rejection); + * }, + * + * + * + * // optional method + * 'response': function(response) { + * // do something on success + * return response; + * }, + * + * // optional method + * 'responseError': function(rejection) { + * // do something on error + * if (canRecover(rejection)) { + * return responseOrNewPromise + * } + * return $q.reject(rejection); + * } + * }; + * }); + * + * $httpProvider.interceptors.push('myHttpInterceptor'); + * + * + * // alternatively, register the interceptor via an anonymous factory + * $httpProvider.interceptors.push(function($q, dependency1, dependency2) { + * return { + * 'request': function(config) { + * // same as above + * }, + * + * 'response': function(response) { + * // same as above + * } + * }; + * }); + * ``` + * + * ## Security Considerations + * + * When designing web applications, consider security threats from: + * + * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) + * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + * + * Both server and the client must cooperate in order to eliminate these threats. Angular comes + * pre-configured with strategies that address these issues, but for this to work backend server + * cooperation is required. + * + * ### JSON Vulnerability Protection + * + * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) + * allows third party website to turn your JSON resource URL into + * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To + * counter this your server can prefix all JSON requests with following string `")]}',\n"`. + * Angular will automatically strip the prefix before processing it as JSON. + * + * For example if your server needs to return: + * ```js + * ['one','two'] + * ``` + * + * which is vulnerable to attack, your server can return: + * ```js + * )]}', + * ['one','two'] + * ``` + * + * Angular will strip the prefix, before processing the JSON. + * + * + * ### Cross Site Request Forgery (XSRF) Protection + * + * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which + * an unauthorized site can gain your user's private data. Angular provides a mechanism + * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie + * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only + * JavaScript that runs on your domain could read the cookie, your server can be assured that + * the XHR came from JavaScript running on your domain. The header will not be set for + * cross-domain requests. + * + * To take advantage of this, your server needs to set a token in a JavaScript readable session + * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the + * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure + * that only JavaScript running on your domain could have sent the request. The token must be + * unique for each user and must be verifiable by the server (to prevent the JavaScript from + * making up its own tokens). We recommend that the token is a digest of your site's + * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) + * for added security. + * + * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName + * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time, + * or the per-request config object. + * + * In order to prevent collisions in environments where multiple Angular apps share the + * same domain or subdomain, we recommend that each application uses unique cookie name. + * + * @param {object} config Object describing the request to be made and how it should be + * processed. The object has following properties: + * + * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) + * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested. + * - **params** – `{Object.}` – Map of strings or objects which will be serialized + * with the `paramSerializer` and appended as GET parameters. + * - **data** – `{string|Object}` – Data to be sent as the request message data. + * - **headers** – `{Object}` – Map of strings or functions which return strings representing + * HTTP headers to send to the server. If the return value of a function is null, the + * header will not be sent. Functions accept a config object as an argument. + * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. + * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. + * - **transformRequest** – + * `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * request body and headers and returns its transformed (typically serialized) version. + * See {@link ng.$http#overriding-the-default-transformations-per-request + * Overriding the Default Transformations} + * - **transformResponse** – + * `{function(data, headersGetter, status)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * response body, headers and status and returns its transformed (typically deserialized) version. + * See {@link ng.$http#overriding-the-default-transformations-per-request + * Overriding the Default TransformationjqLiks} + * - **paramSerializer** - `{string|function(Object):string}` - A function used to + * prepare the string representation of request parameters (specified as an object). + * If specified as string, it is interpreted as function registered with the + * {@link $injector $injector}, which means you can create your own serializer + * by registering it as a {@link auto.$provide#service service}. + * The default serializer is the {@link $httpParamSerializer $httpParamSerializer}; + * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike} + * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the + * GET request, otherwise if a cache instance built with + * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for + * caching. + * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} + * that should abort the request when resolved. + * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the + * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials) + * for more information. + * - **responseType** - `{string}` - see + * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype). + * + * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object + * when the request succeeds or fails. + * + * + * @property {Array.} pendingRequests Array of config objects for currently pending + * requests. This is primarily meant to be used for debugging purposes. + * + * + * @example + + +
    + + +
    + + + +
    http status code: {{status}}
    +
    http response data: {{data}}
    +
    +
    + + angular.module('httpExample', []) + .controller('FetchController', ['$scope', '$http', '$templateCache', + function($scope, $http, $templateCache) { + $scope.method = 'GET'; + $scope.url = 'http-hello.html'; + + $scope.fetch = function() { + $scope.code = null; + $scope.response = null; + + $http({method: $scope.method, url: $scope.url, cache: $templateCache}). + then(function(response) { + $scope.status = response.status; + $scope.data = response.data; + }, function(response) { + $scope.data = response.data || "Request failed"; + $scope.status = response.status; + }); + }; + + $scope.updateModel = function(method, url) { + $scope.method = method; + $scope.url = url; + }; + }]); + + + Hello, $http! + + + var status = element(by.binding('status')); + var data = element(by.binding('data')); + var fetchBtn = element(by.id('fetchbtn')); + var sampleGetBtn = element(by.id('samplegetbtn')); + var sampleJsonpBtn = element(by.id('samplejsonpbtn')); + var invalidJsonpBtn = element(by.id('invalidjsonpbtn')); + + it('should make an xhr GET request', function() { + sampleGetBtn.click(); + fetchBtn.click(); + expect(status.getText()).toMatch('200'); + expect(data.getText()).toMatch(/Hello, \$http!/); + }); + + // Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185 + // it('should make a JSONP request to angularjs.org', function() { + // sampleJsonpBtn.click(); + // fetchBtn.click(); + // expect(status.getText()).toMatch('200'); + // expect(data.getText()).toMatch(/Super Hero!/); + // }); + + it('should make JSONP request to invalid URL and invoke the error handler', + function() { + invalidJsonpBtn.click(); + fetchBtn.click(); + expect(status.getText()).toMatch('0'); + expect(data.getText()).toMatch('Request failed'); + }); + +
    + */ + function $http(requestConfig) { + + if (!angular.isObject(requestConfig)) { + throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig); + } + + var config = extend({ + method: 'get', + transformRequest: defaults.transformRequest, + transformResponse: defaults.transformResponse, + paramSerializer: defaults.paramSerializer + }, requestConfig); + + config.headers = mergeHeaders(requestConfig); + config.method = uppercase(config.method); + config.paramSerializer = isString(config.paramSerializer) ? + $injector.get(config.paramSerializer) : config.paramSerializer; + + var serverRequest = function(config) { + var headers = config.headers; + var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest); + + // strip content-type if data is undefined + if (isUndefined(reqData)) { + forEach(headers, function(value, header) { + if (lowercase(header) === 'content-type') { + delete headers[header]; + } + }); + } + + if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) { + config.withCredentials = defaults.withCredentials; + } + + // send request + return sendReq(config, reqData).then(transformResponse, transformResponse); + }; + + var chain = [serverRequest, undefined]; + var promise = $q.when(config); + + // apply interceptors + forEach(reversedInterceptors, function(interceptor) { + if (interceptor.request || interceptor.requestError) { + chain.unshift(interceptor.request, interceptor.requestError); + } + if (interceptor.response || interceptor.responseError) { + chain.push(interceptor.response, interceptor.responseError); + } + }); + + while (chain.length) { + var thenFn = chain.shift(); + var rejectFn = chain.shift(); + + promise = promise.then(thenFn, rejectFn); + } + + if (useLegacyPromise) { + promise.success = function(fn) { + assertArgFn(fn, 'fn'); + + promise.then(function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + + promise.error = function(fn) { + assertArgFn(fn, 'fn'); + + promise.then(null, function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + } else { + promise.success = $httpMinErrLegacyFn('success'); + promise.error = $httpMinErrLegacyFn('error'); + } + + return promise; + + function transformResponse(response) { + // make a copy since the response must be cacheable + var resp = extend({}, response); + if (!response.data) { + resp.data = response.data; + } else { + resp.data = transformData(response.data, response.headers, response.status, config.transformResponse); + } + return (isSuccess(response.status)) + ? resp + : $q.reject(resp); + } + + function executeHeaderFns(headers, config) { + var headerContent, processedHeaders = {}; + + forEach(headers, function(headerFn, header) { + if (isFunction(headerFn)) { + headerContent = headerFn(config); + if (headerContent != null) { + processedHeaders[header] = headerContent; + } + } else { + processedHeaders[header] = headerFn; + } + }); + + return processedHeaders; + } + + function mergeHeaders(config) { + var defHeaders = defaults.headers, + reqHeaders = extend({}, config.headers), + defHeaderName, lowercaseDefHeaderName, reqHeaderName; + + defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]); + + // using for-in instead of forEach to avoid unecessary iteration after header has been found + defaultHeadersIteration: + for (defHeaderName in defHeaders) { + lowercaseDefHeaderName = lowercase(defHeaderName); + + for (reqHeaderName in reqHeaders) { + if (lowercase(reqHeaderName) === lowercaseDefHeaderName) { + continue defaultHeadersIteration; + } + } + + reqHeaders[defHeaderName] = defHeaders[defHeaderName]; + } + + // execute if header value is a function for merged headers + return executeHeaderFns(reqHeaders, shallowCopy(config)); + } + } + + $http.pendingRequests = []; + + /** + * @ngdoc method + * @name $http#get + * + * @description + * Shortcut method to perform `GET` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#delete + * + * @description + * Shortcut method to perform `DELETE` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#head + * + * @description + * Shortcut method to perform `HEAD` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#jsonp + * + * @description + * Shortcut method to perform `JSONP` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request. + * The name of the callback should be the string `JSON_CALLBACK`. + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethods('get', 'delete', 'head', 'jsonp'); + + /** + * @ngdoc method + * @name $http#post + * + * @description + * Shortcut method to perform `POST` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#put + * + * @description + * Shortcut method to perform `PUT` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#patch + * + * @description + * Shortcut method to perform `PATCH` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethodsWithData('post', 'put', 'patch'); + + /** + * @ngdoc property + * @name $http#defaults + * + * @description + * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of + * default headers, withCredentials as well as request and response transformations. + * + * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above. + */ + $http.defaults = defaults; + + + return $http; + + + function createShortMethods(names) { + forEach(arguments, function(name) { + $http[name] = function(url, config) { + return $http(extend({}, config || {}, { + method: name, + url: url + })); + }; + }); + } + + + function createShortMethodsWithData(name) { + forEach(arguments, function(name) { + $http[name] = function(url, data, config) { + return $http(extend({}, config || {}, { + method: name, + url: url, + data: data + })); + }; + }); + } + + + /** + * Makes the request. + * + * !!! ACCESSES CLOSURE VARS: + * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests + */ + function sendReq(config, reqData) { + var deferred = $q.defer(), + promise = deferred.promise, + cache, + cachedResp, + reqHeaders = config.headers, + url = buildUrl(config.url, config.paramSerializer(config.params)); + + $http.pendingRequests.push(config); + promise.then(removePendingReq, removePendingReq); + + + if ((config.cache || defaults.cache) && config.cache !== false && + (config.method === 'GET' || config.method === 'JSONP')) { + cache = isObject(config.cache) ? config.cache + : isObject(defaults.cache) ? defaults.cache + : defaultCache; + } + + if (cache) { + cachedResp = cache.get(url); + if (isDefined(cachedResp)) { + if (isPromiseLike(cachedResp)) { + // cached request has already been sent, but there is no response yet + cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); + } else { + // serving from cache + if (isArray(cachedResp)) { + resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); + } else { + resolvePromise(cachedResp, 200, {}, 'OK'); + } + } + } else { + // put the promise for the non-transformed response into cache as a placeholder + cache.put(url, promise); + } + } + + + // if we won't have the response in cache, set the xsrf headers and + // send the request to the backend + if (isUndefined(cachedResp)) { + var xsrfValue = urlIsSameOrigin(config.url) + ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] + : undefined; + if (xsrfValue) { + reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; + } + + $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, + config.withCredentials, config.responseType); + } + + return promise; + + + /** + * Callback registered to $httpBackend(): + * - caches the response if desired + * - resolves the raw $http promise + * - calls $apply + */ + function done(status, response, headersString, statusText) { + if (cache) { + if (isSuccess(status)) { + cache.put(url, [status, response, parseHeaders(headersString), statusText]); + } else { + // remove promise from the cache + cache.remove(url); + } + } + + function resolveHttpPromise() { + resolvePromise(response, status, headersString, statusText); + } + + if (useApplyAsync) { + $rootScope.$applyAsync(resolveHttpPromise); + } else { + resolveHttpPromise(); + if (!$rootScope.$$phase) $rootScope.$apply(); + } + } + + + /** + * Resolves the raw $http promise. + */ + function resolvePromise(response, status, headers, statusText) { + //status: HTTP response status code, 0, -1 (aborted by timeout / promise) + status = status >= -1 ? status : 0; + + (isSuccess(status) ? deferred.resolve : deferred.reject)({ + data: response, + status: status, + headers: headersGetter(headers), + config: config, + statusText: statusText + }); + } + + function resolvePromiseWithResult(result) { + resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText); + } + + function removePendingReq() { + var idx = $http.pendingRequests.indexOf(config); + if (idx !== -1) $http.pendingRequests.splice(idx, 1); + } + } + + + function buildUrl(url, serializedParams) { + if (serializedParams.length > 0) { + url += ((url.indexOf('?') == -1) ? '?' : '&') + serializedParams; + } + return url; + } + }]; + } + + /** + * @ngdoc service + * @name $xhrFactory + * + * @description + * Factory function used to create XMLHttpRequest objects. + * + * Replace or decorate this service to create your own custom XMLHttpRequest objects. + * + * ``` + * angular.module('myApp', []) + * .factory('$xhrFactory', function() { + * return function createXhr(method, url) { + * return new window.XMLHttpRequest({mozSystem: true}); + * }; + * }); + * ``` + * + * @param {string} method HTTP method of the request (GET, POST, PUT, ..) + * @param {string} url URL of the request. + */ + function $xhrFactoryProvider() { + this.$get = function() { + return function createXhr() { + return new window.XMLHttpRequest(); + }; + }; + } + + /** + * @ngdoc service + * @name $httpBackend + * @requires $window + * @requires $document + * @requires $xhrFactory + * + * @description + * HTTP backend used by the {@link ng.$http service} that delegates to + * XMLHttpRequest object or JSONP and deals with browser incompatibilities. + * + * You should never need to use this service directly, instead use the higher-level abstractions: + * {@link ng.$http $http} or {@link ngResource.$resource $resource}. + * + * During testing this implementation is swapped with {@link ngMock.$httpBackend mock + * $httpBackend} which can be trained with responses. + */ + function $HttpBackendProvider() { + this.$get = ['$browser', '$window', '$document', '$xhrFactory', function($browser, $window, $document, $xhrFactory) { + return createHttpBackend($browser, $xhrFactory, $browser.defer, $window.angular.callbacks, $document[0]); + }]; + } + + function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) { + // TODO(vojta): fix the signature + return function(method, url, post, callback, headers, timeout, withCredentials, responseType) { + $browser.$$incOutstandingRequestCount(); + url = url || $browser.url(); + + if (lowercase(method) == 'jsonp') { + var callbackId = '_' + (callbacks.counter++).toString(36); + callbacks[callbackId] = function(data) { + callbacks[callbackId].data = data; + callbacks[callbackId].called = true; + }; + + var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId), + callbackId, function(status, text) { + completeRequest(callback, status, callbacks[callbackId].data, "", text); + callbacks[callbackId] = noop; + }); + } else { + + var xhr = createXhr(method, url); + + xhr.open(method, url, true); + forEach(headers, function(value, key) { + if (isDefined(value)) { + xhr.setRequestHeader(key, value); + } + }); + + xhr.onload = function requestLoaded() { + var statusText = xhr.statusText || ''; + + // responseText is the old-school way of retrieving response (supported by IE9) + // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) + var response = ('response' in xhr) ? xhr.response : xhr.responseText; + + // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) + var status = xhr.status === 1223 ? 204 : xhr.status; + + // fix status code when it is 0 (0 status is undocumented). + // Occurs when accessing file resources or on Android 4.1 stock browser + // while retrieving files from application cache. + if (status === 0) { + status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0; + } + + completeRequest(callback, + status, + response, + xhr.getAllResponseHeaders(), + statusText); + }; + + var requestError = function() { + // The response is always empty + // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error + completeRequest(callback, -1, null, null, ''); + }; + + xhr.onerror = requestError; + xhr.onabort = requestError; + + if (withCredentials) { + xhr.withCredentials = true; + } + + if (responseType) { + try { + xhr.responseType = responseType; + } catch (e) { + // WebKit added support for the json responseType value on 09/03/2013 + // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are + // known to throw when setting the value "json" as the response type. Other older + // browsers implementing the responseType + // + // The json response type can be ignored if not supported, because JSON payloads are + // parsed on the client-side regardless. + if (responseType !== 'json') { + throw e; + } + } + } + + xhr.send(isUndefined(post) ? null : post); + } + + if (timeout > 0) { + var timeoutId = $browserDefer(timeoutRequest, timeout); + } else if (isPromiseLike(timeout)) { + timeout.then(timeoutRequest); + } + + + function timeoutRequest() { + jsonpDone && jsonpDone(); + xhr && xhr.abort(); + } + + function completeRequest(callback, status, response, headersString, statusText) { + // cancel timeout and subsequent timeout promise resolution + if (isDefined(timeoutId)) { + $browserDefer.cancel(timeoutId); + } + jsonpDone = xhr = null; + + callback(status, response, headersString, statusText); + $browser.$$completeOutstandingRequest(noop); + } + }; + + function jsonpReq(url, callbackId, done) { + // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.: + // - fetches local scripts via XHR and evals them + // - adds and immediately removes script elements from the document + var script = rawDocument.createElement('script'), callback = null; + script.type = "text/javascript"; + script.src = url; + script.async = true; + + callback = function(event) { + removeEventListenerFn(script, "load", callback); + removeEventListenerFn(script, "error", callback); + rawDocument.body.removeChild(script); + script = null; + var status = -1; + var text = "unknown"; + + if (event) { + if (event.type === "load" && !callbacks[callbackId].called) { + event = { type: "error" }; + } + text = event.type; + status = event.type === "error" ? 404 : 200; + } + + if (done) { + done(status, text); + } + }; + + addEventListenerFn(script, "load", callback); + addEventListenerFn(script, "error", callback); + rawDocument.body.appendChild(script); + return callback; + } + } + + var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate'); + $interpolateMinErr.throwNoconcat = function(text) { + throw $interpolateMinErr('noconcat', + "Error while interpolating: {0}\nStrict Contextual Escaping disallows " + + "interpolations that concatenate multiple expressions when a trusted value is " + + "required. See http://docs.angularjs.org/api/ng.$sce", text); + }; + + $interpolateMinErr.interr = function(text, err) { + return $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, err.toString()); + }; + + /** + * @ngdoc provider + * @name $interpolateProvider + * + * @description + * + * Used for configuring the interpolation markup. Defaults to `{{` and `}}`. + * + * @example + + + +
    + //demo.label// +
    +
    + + it('should interpolate binding with custom symbols', function() { + expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.'); + }); + +
    + */ + function $InterpolateProvider() { + var startSymbol = '{{'; + var endSymbol = '}}'; + + /** + * @ngdoc method + * @name $interpolateProvider#startSymbol + * @description + * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. + * + * @param {string=} value new value to set the starting symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.startSymbol = function(value) { + if (value) { + startSymbol = value; + return this; + } else { + return startSymbol; + } + }; + + /** + * @ngdoc method + * @name $interpolateProvider#endSymbol + * @description + * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. + * + * @param {string=} value new value to set the ending symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.endSymbol = function(value) { + if (value) { + endSymbol = value; + return this; + } else { + return endSymbol; + } + }; + + + this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) { + var startSymbolLength = startSymbol.length, + endSymbolLength = endSymbol.length, + escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'), + escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g'); + + function escape(ch) { + return '\\\\\\' + ch; + } + + function unescapeText(text) { + return text.replace(escapedStartRegexp, startSymbol). + replace(escapedEndRegexp, endSymbol); + } + + function stringify(value) { + if (value == null) { // null || undefined + return ''; + } + switch (typeof value) { + case 'string': + break; + case 'number': + value = '' + value; + break; + default: + value = toJson(value); + } + + return value; + } + + /** + * @ngdoc service + * @name $interpolate + * @kind function + * + * @requires $parse + * @requires $sce + * + * @description + * + * Compiles a string with markup into an interpolation function. This service is used by the + * HTML {@link ng.$compile $compile} service for data binding. See + * {@link ng.$interpolateProvider $interpolateProvider} for configuring the + * interpolation markup. + * + * + * ```js + * var $interpolate = ...; // injected + * var exp = $interpolate('Hello {{name | uppercase}}!'); + * expect(exp({name:'Angular'})).toEqual('Hello ANGULAR!'); + * ``` + * + * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is + * `true`, the interpolation function will return `undefined` unless all embedded expressions + * evaluate to a value other than `undefined`. + * + * ```js + * var $interpolate = ...; // injected + * var context = {greeting: 'Hello', name: undefined }; + * + * // default "forgiving" mode + * var exp = $interpolate('{{greeting}} {{name}}!'); + * expect(exp(context)).toEqual('Hello !'); + * + * // "allOrNothing" mode + * exp = $interpolate('{{greeting}} {{name}}!', false, null, true); + * expect(exp(context)).toBeUndefined(); + * context.name = 'Angular'; + * expect(exp(context)).toEqual('Hello Angular!'); + * ``` + * + * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior. + * + * ####Escaped Interpolation + * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers + * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash). + * It will be rendered as a regular start/end marker, and will not be interpreted as an expression + * or binding. + * + * This enables web-servers to prevent script injection attacks and defacing attacks, to some + * degree, while also enabling code examples to work without relying on the + * {@link ng.directive:ngNonBindable ngNonBindable} directive. + * + * **For security purposes, it is strongly encouraged that web servers escape user-supplied data, + * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all + * interpolation start/end markers with their escaped counterparts.** + * + * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered + * output when the $interpolate service processes the text. So, for HTML elements interpolated + * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter + * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such, + * this is typically useful only when user-data is used in rendering a template from the server, or + * when otherwise untrusted data is used by a directive. + * + * + * + *
    + *

    {{apptitle}}: \{\{ username = "defaced value"; \}\} + *

    + *

    {{username}} attempts to inject code which will deface the + * application, but fails to accomplish their task, because the server has correctly + * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash) + * characters.

    + *

    Instead, the result of the attempted script injection is visible, and can be removed + * from the database by an administrator.

    + *
    + *
    + *
    + * + * @param {string} text The text with markup to interpolate. + * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have + * embedded expression in order to return an interpolation function. Strings with no + * embedded expression will return null for the interpolation function. + * @param {string=} trustedContext when provided, the returned function passes the interpolated + * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult, + * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that + * provides Strict Contextual Escaping for details. + * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined + * unless all embedded expressions evaluate to a value other than `undefined`. + * @returns {function(context)} an interpolation function which is used to compute the + * interpolated string. The function has these parameters: + * + * - `context`: evaluation context for all expressions embedded in the interpolated text + */ + function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { + allOrNothing = !!allOrNothing; + var startIndex, + endIndex, + index = 0, + expressions = [], + parseFns = [], + textLength = text.length, + exp, + concat = [], + expressionPositions = []; + + while (index < textLength) { + if (((startIndex = text.indexOf(startSymbol, index)) != -1) && + ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) { + if (index !== startIndex) { + concat.push(unescapeText(text.substring(index, startIndex))); + } + exp = text.substring(startIndex + startSymbolLength, endIndex); + expressions.push(exp); + parseFns.push($parse(exp, parseStringifyInterceptor)); + index = endIndex + endSymbolLength; + expressionPositions.push(concat.length); + concat.push(''); + } else { + // we did not find an interpolation, so we have to add the remainder to the separators array + if (index !== textLength) { + concat.push(unescapeText(text.substring(index))); + } + break; + } + } + + // Concatenating expressions makes it hard to reason about whether some combination of + // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a + // single expression be used for iframe[src], object[src], etc., we ensure that the value + // that's used is assigned or constructed by some JS code somewhere that is more testable or + // make it obvious that you bound the value to some user controlled value. This helps reduce + // the load when auditing for XSS issues. + if (trustedContext && concat.length > 1) { + $interpolateMinErr.throwNoconcat(text); + } + + if (!mustHaveExpression || expressions.length) { + var compute = function(values) { + for (var i = 0, ii = expressions.length; i < ii; i++) { + if (allOrNothing && isUndefined(values[i])) return; + concat[expressionPositions[i]] = values[i]; + } + return concat.join(''); + }; + + var getValue = function(value) { + return trustedContext ? + $sce.getTrusted(trustedContext, value) : + $sce.valueOf(value); + }; + + return extend(function interpolationFn(context) { + var i = 0; + var ii = expressions.length; + var values = new Array(ii); + + try { + for (; i < ii; i++) { + values[i] = parseFns[i](context); + } + + return compute(values); + } catch (err) { + $exceptionHandler($interpolateMinErr.interr(text, err)); + } + + }, { + // all of these properties are undocumented for now + exp: text, //just for compatibility with regular watchers created via $watch + expressions: expressions, + $$watchDelegate: function(scope, listener) { + var lastValue; + return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) { + var currValue = compute(values); + if (isFunction(listener)) { + listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope); + } + lastValue = currValue; + }); + } + }); + } + + function parseStringifyInterceptor(value) { + try { + value = getValue(value); + return allOrNothing && !isDefined(value) ? value : stringify(value); + } catch (err) { + $exceptionHandler($interpolateMinErr.interr(text, err)); + } + } + } + + + /** + * @ngdoc method + * @name $interpolate#startSymbol + * @description + * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`. + * + * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change + * the symbol. + * + * @returns {string} start symbol. + */ + $interpolate.startSymbol = function() { + return startSymbol; + }; + + + /** + * @ngdoc method + * @name $interpolate#endSymbol + * @description + * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. + * + * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change + * the symbol. + * + * @returns {string} end symbol. + */ + $interpolate.endSymbol = function() { + return endSymbol; + }; + + return $interpolate; + }]; + } + + function $IntervalProvider() { + this.$get = ['$rootScope', '$window', '$q', '$$q', + function($rootScope, $window, $q, $$q) { + var intervals = {}; + + + /** + * @ngdoc service + * @name $interval + * + * @description + * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay` + * milliseconds. + * + * The return value of registering an interval function is a promise. This promise will be + * notified upon each tick of the interval, and will be resolved after `count` iterations, or + * run indefinitely if `count` is not defined. The value of the notification will be the + * number of iterations that have run. + * To cancel an interval, call `$interval.cancel(promise)`. + * + * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to + * move forward by `millis` milliseconds and trigger any functions scheduled to run in that + * time. + * + *
    + * **Note**: Intervals created by this service must be explicitly destroyed when you are finished + * with them. In particular they are not automatically destroyed when a controller's scope or a + * directive's element are destroyed. + * You should take this into consideration and make sure to always cancel the interval at the + * appropriate moment. See the example below for more details on how and when to do this. + *
    + * + * @param {function()} fn A function that should be called repeatedly. + * @param {number} delay Number of milliseconds between each function call. + * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat + * indefinitely. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @param {...*=} Pass additional parameters to the executed function. + * @returns {promise} A promise which will be notified on each iteration. + * + * @example + * + * + * + * + *
    + *
    + *
    + * Current time is: + *
    + * Blood 1 : {{blood_1}} + * Blood 2 : {{blood_2}} + * + * + * + *
    + *
    + * + *
    + *
    + */ + function interval(fn, delay, count, invokeApply) { + var hasParams = arguments.length > 4, + args = hasParams ? sliceArgs(arguments, 4) : [], + setInterval = $window.setInterval, + clearInterval = $window.clearInterval, + iteration = 0, + skipApply = (isDefined(invokeApply) && !invokeApply), + deferred = (skipApply ? $$q : $q).defer(), + promise = deferred.promise; + + count = isDefined(count) ? count : 0; + + promise.then(null, null, (!hasParams) ? fn : function() { + fn.apply(null, args); + }); + + promise.$$intervalId = setInterval(function tick() { + deferred.notify(iteration++); + + if (count > 0 && iteration >= count) { + deferred.resolve(iteration); + clearInterval(promise.$$intervalId); + delete intervals[promise.$$intervalId]; + } + + if (!skipApply) $rootScope.$apply(); + + }, delay); + + intervals[promise.$$intervalId] = deferred; + + return promise; + } + + + /** + * @ngdoc method + * @name $interval#cancel + * + * @description + * Cancels a task associated with the `promise`. + * + * @param {Promise=} promise returned by the `$interval` function. + * @returns {boolean} Returns `true` if the task was successfully canceled. + */ + interval.cancel = function(promise) { + if (promise && promise.$$intervalId in intervals) { + intervals[promise.$$intervalId].reject('canceled'); + $window.clearInterval(promise.$$intervalId); + delete intervals[promise.$$intervalId]; + return true; + } + return false; + }; + + return interval; + }]; + } + + /** + * @ngdoc service + * @name $locale + * + * @description + * $locale service provides localization rules for various Angular components. As of right now the + * only public api is: + * + * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) + */ + + var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/, + DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21}; + var $locationMinErr = minErr('$location'); + + + /** + * Encode path using encodeUriSegment, ignoring forward slashes + * + * @param {string} path Path to encode + * @returns {string} + */ + function encodePath(path) { + var segments = path.split('/'), + i = segments.length; + + while (i--) { + segments[i] = encodeUriSegment(segments[i]); + } + + return segments.join('/'); + } + + function parseAbsoluteUrl(absoluteUrl, locationObj) { + var parsedUrl = urlResolve(absoluteUrl); + + locationObj.$$protocol = parsedUrl.protocol; + locationObj.$$host = parsedUrl.hostname; + locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; + } + + + function parseAppUrl(relativeUrl, locationObj) { + var prefixed = (relativeUrl.charAt(0) !== '/'); + if (prefixed) { + relativeUrl = '/' + relativeUrl; + } + var match = urlResolve(relativeUrl); + locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ? + match.pathname.substring(1) : match.pathname); + locationObj.$$search = parseKeyValue(match.search); + locationObj.$$hash = decodeURIComponent(match.hash); + + // make sure path starts with '/'; + if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') { + locationObj.$$path = '/' + locationObj.$$path; + } + } + + + /** + * + * @param {string} begin + * @param {string} whole + * @returns {string} returns text from whole after begin or undefined if it does not begin with + * expected string. + */ + function beginsWith(begin, whole) { + if (whole.indexOf(begin) === 0) { + return whole.substr(begin.length); + } + } + + + function stripHash(url) { + var index = url.indexOf('#'); + return index == -1 ? url : url.substr(0, index); + } + + function trimEmptyHash(url) { + return url.replace(/(#.+)|#$/, '$1'); + } + + + function stripFile(url) { + return url.substr(0, stripHash(url).lastIndexOf('/') + 1); + } + + /* return the server only (scheme://host:port) */ + function serverBase(url) { + return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); + } + + + /** + * LocationHtml5Url represents an url + * This object is exposed as $location service when HTML5 mode is enabled and supported + * + * @constructor + * @param {string} appBase application base URL + * @param {string} appBaseNoFile application base URL stripped of any filename + * @param {string} basePrefix url path prefix + */ + function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) { + this.$$html5 = true; + basePrefix = basePrefix || ''; + parseAbsoluteUrl(appBase, this); + + + /** + * Parse given html5 (regular) url string into properties + * @param {string} url HTML5 url + * @private + */ + this.$$parse = function(url) { + var pathUrl = beginsWith(appBaseNoFile, url); + if (!isString(pathUrl)) { + throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, + appBaseNoFile); + } + + parseAppUrl(pathUrl, this); + + if (!this.$$path) { + this.$$path = '/'; + } + + this.$$compose(); + }; + + /** + * Compose url and update `absUrl` property + * @private + */ + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/' + }; + + this.$$parseLinkUrl = function(url, relHref) { + if (relHref && relHref[0] === '#') { + // special case for links to hash fragments: + // keep the old url and only replace the hash fragment + this.hash(relHref.slice(1)); + return true; + } + var appUrl, prevAppUrl; + var rewrittenUrl; + + if (isDefined(appUrl = beginsWith(appBase, url))) { + prevAppUrl = appUrl; + if (isDefined(appUrl = beginsWith(basePrefix, appUrl))) { + rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl); + } else { + rewrittenUrl = appBase + prevAppUrl; + } + } else if (isDefined(appUrl = beginsWith(appBaseNoFile, url))) { + rewrittenUrl = appBaseNoFile + appUrl; + } else if (appBaseNoFile == url + '/') { + rewrittenUrl = appBaseNoFile; + } + if (rewrittenUrl) { + this.$$parse(rewrittenUrl); + } + return !!rewrittenUrl; + }; + } + + + /** + * LocationHashbangUrl represents url + * This object is exposed as $location service when developer doesn't opt into html5 mode. + * It also serves as the base class for html5 mode fallback on legacy browsers. + * + * @constructor + * @param {string} appBase application base URL + * @param {string} appBaseNoFile application base URL stripped of any filename + * @param {string} hashPrefix hashbang prefix + */ + function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) { + + parseAbsoluteUrl(appBase, this); + + + /** + * Parse given hashbang url into properties + * @param {string} url Hashbang url + * @private + */ + this.$$parse = function(url) { + var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url); + var withoutHashUrl; + + if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') { + + // The rest of the url starts with a hash so we have + // got either a hashbang path or a plain hash fragment + withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl); + if (isUndefined(withoutHashUrl)) { + // There was no hashbang prefix so we just have a hash fragment + withoutHashUrl = withoutBaseUrl; + } + + } else { + // There was no hashbang path nor hash fragment: + // If we are in HTML5 mode we use what is left as the path; + // Otherwise we ignore what is left + if (this.$$html5) { + withoutHashUrl = withoutBaseUrl; + } else { + withoutHashUrl = ''; + if (isUndefined(withoutBaseUrl)) { + appBase = url; + this.replace(); + } + } + } + + parseAppUrl(withoutHashUrl, this); + + this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase); + + this.$$compose(); + + /* + * In Windows, on an anchor node on documents loaded from + * the filesystem, the browser will return a pathname + * prefixed with the drive name ('/C:/path') when a + * pathname without a drive is set: + * * a.setAttribute('href', '/foo') + * * a.pathname === '/C:/foo' //true + * + * Inside of Angular, we're always using pathnames that + * do not include drive names for routing. + */ + function removeWindowsDriveName(path, url, base) { + /* + Matches paths for file protocol on windows, + such as /C:/foo/bar, and captures only /foo/bar. + */ + var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; + + var firstPathSegmentMatch; + + //Get the relative path from the input URL. + if (url.indexOf(base) === 0) { + url = url.replace(base, ''); + } + + // The input URL intentionally contains a first path segment that ends with a colon. + if (windowsFilePathExp.exec(url)) { + return path; + } + + firstPathSegmentMatch = windowsFilePathExp.exec(path); + return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; + } + }; + + /** + * Compose hashbang url and update `absUrl` property + * @private + */ + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : ''); + }; + + this.$$parseLinkUrl = function(url, relHref) { + if (stripHash(appBase) == stripHash(url)) { + this.$$parse(url); + return true; + } + return false; + }; + } + + + /** + * LocationHashbangUrl represents url + * This object is exposed as $location service when html5 history api is enabled but the browser + * does not support it. + * + * @constructor + * @param {string} appBase application base URL + * @param {string} appBaseNoFile application base URL stripped of any filename + * @param {string} hashPrefix hashbang prefix + */ + function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) { + this.$$html5 = true; + LocationHashbangUrl.apply(this, arguments); + + this.$$parseLinkUrl = function(url, relHref) { + if (relHref && relHref[0] === '#') { + // special case for links to hash fragments: + // keep the old url and only replace the hash fragment + this.hash(relHref.slice(1)); + return true; + } + + var rewrittenUrl; + var appUrl; + + if (appBase == stripHash(url)) { + rewrittenUrl = url; + } else if ((appUrl = beginsWith(appBaseNoFile, url))) { + rewrittenUrl = appBase + hashPrefix + appUrl; + } else if (appBaseNoFile === url + '/') { + rewrittenUrl = appBaseNoFile; + } + if (rewrittenUrl) { + this.$$parse(rewrittenUrl); + } + return !!rewrittenUrl; + }; + + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#' + this.$$absUrl = appBase + hashPrefix + this.$$url; + }; + + } + + + var locationPrototype = { + + /** + * Are we in html5 mode? + * @private + */ + $$html5: false, + + /** + * Has any change been replacing? + * @private + */ + $$replace: false, + + /** + * @ngdoc method + * @name $location#absUrl + * + * @description + * This method is getter only. + * + * Return full url representation with all segments encoded according to rules specified in + * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt). + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var absUrl = $location.absUrl(); + * // => "http://example.com/#/some/path?foo=bar&baz=xoxo" + * ``` + * + * @return {string} full url + */ + absUrl: locationGetter('$$absUrl'), + + /** + * @ngdoc method + * @name $location#url + * + * @description + * This method is getter / setter. + * + * Return url (e.g. `/path?a=b#hash`) when called without any parameter. + * + * Change path, search and hash, when called with parameter and return `$location`. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var url = $location.url(); + * // => "/some/path?foo=bar&baz=xoxo" + * ``` + * + * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`) + * @return {string} url + */ + url: function(url) { + if (isUndefined(url)) { + return this.$$url; + } + + var match = PATH_MATCH.exec(url); + if (match[1] || url === '') this.path(decodeURIComponent(match[1])); + if (match[2] || match[1] || url === '') this.search(match[3] || ''); + this.hash(match[5] || ''); + + return this; + }, + + /** + * @ngdoc method + * @name $location#protocol + * + * @description + * This method is getter only. + * + * Return protocol of current url. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var protocol = $location.protocol(); + * // => "http" + * ``` + * + * @return {string} protocol of current url + */ + protocol: locationGetter('$$protocol'), + + /** + * @ngdoc method + * @name $location#host + * + * @description + * This method is getter only. + * + * Return host of current url. + * + * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var host = $location.host(); + * // => "example.com" + * + * // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo + * host = $location.host(); + * // => "example.com" + * host = location.host; + * // => "example.com:8080" + * ``` + * + * @return {string} host of current url. + */ + host: locationGetter('$$host'), + + /** + * @ngdoc method + * @name $location#port + * + * @description + * This method is getter only. + * + * Return port of current url. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var port = $location.port(); + * // => 80 + * ``` + * + * @return {Number} port + */ + port: locationGetter('$$port'), + + /** + * @ngdoc method + * @name $location#path + * + * @description + * This method is getter / setter. + * + * Return path of current url when called without any parameter. + * + * Change path when called with parameter and return `$location`. + * + * Note: Path should always begin with forward slash (/), this method will add the forward slash + * if it is missing. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var path = $location.path(); + * // => "/some/path" + * ``` + * + * @param {(string|number)=} path New path + * @return {string} path + */ + path: locationGetterSetter('$$path', function(path) { + path = path !== null ? path.toString() : ''; + return path.charAt(0) == '/' ? path : '/' + path; + }), + + /** + * @ngdoc method + * @name $location#search + * + * @description + * This method is getter / setter. + * + * Return search part (as object) of current url when called without any parameter. + * + * Change search part when called with parameter and return `$location`. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var searchObject = $location.search(); + * // => {foo: 'bar', baz: 'xoxo'} + * + * // set foo to 'yipee' + * $location.search('foo', 'yipee'); + * // $location.search() => {foo: 'yipee', baz: 'xoxo'} + * ``` + * + * @param {string|Object.|Object.>} search New search params - string or + * hash object. + * + * When called with a single argument the method acts as a setter, setting the `search` component + * of `$location` to the specified value. + * + * If the argument is a hash object containing an array of values, these values will be encoded + * as duplicate search parameters in the url. + * + * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue` + * will override only a single search property. + * + * If `paramValue` is an array, it will override the property of the `search` component of + * `$location` specified via the first argument. + * + * If `paramValue` is `null`, the property specified via the first argument will be deleted. + * + * If `paramValue` is `true`, the property specified via the first argument will be added with no + * value nor trailing equal sign. + * + * @return {Object} If called with no arguments returns the parsed `search` object. If called with + * one or more arguments returns `$location` object itself. + */ + search: function(search, paramValue) { + switch (arguments.length) { + case 0: + return this.$$search; + case 1: + if (isString(search) || isNumber(search)) { + search = search.toString(); + this.$$search = parseKeyValue(search); + } else if (isObject(search)) { + search = copy(search, {}); + // remove object undefined or null properties + forEach(search, function(value, key) { + if (value == null) delete search[key]; + }); + + this.$$search = search; + } else { + throw $locationMinErr('isrcharg', + 'The first argument of the `$location#search()` call must be a string or an object.'); + } + break; + default: + if (isUndefined(paramValue) || paramValue === null) { + delete this.$$search[search]; + } else { + this.$$search[search] = paramValue; + } + } + + this.$$compose(); + return this; + }, + + /** + * @ngdoc method + * @name $location#hash + * + * @description + * This method is getter / setter. + * + * Return hash fragment when called without any parameter. + * + * Change hash fragment when called with parameter and return `$location`. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue + * var hash = $location.hash(); + * // => "hashValue" + * ``` + * + * @param {(string|number)=} hash New hash fragment + * @return {string} hash + */ + hash: locationGetterSetter('$$hash', function(hash) { + return hash !== null ? hash.toString() : ''; + }), + + /** + * @ngdoc method + * @name $location#replace + * + * @description + * If called, all changes to $location during current `$digest` will be replacing current history + * record, instead of adding new one. + */ + replace: function() { + this.$$replace = true; + return this; + } + }; + + forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) { + Location.prototype = Object.create(locationPrototype); + + /** + * @ngdoc method + * @name $location#state + * + * @description + * This method is getter / setter. + * + * Return the history state object when called without any parameter. + * + * Change the history state object when called with one parameter and return `$location`. + * The state object is later passed to `pushState` or `replaceState`. + * + * NOTE: This method is supported only in HTML5 mode and only in browsers supporting + * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support + * older browsers (like IE9 or Android < 4.0), don't use this method. + * + * @param {object=} state State object for pushState or replaceState + * @return {object} state + */ + Location.prototype.state = function(state) { + if (!arguments.length) { + return this.$$state; + } + + if (Location !== LocationHtml5Url || !this.$$html5) { + throw $locationMinErr('nostate', 'History API state support is available only ' + + 'in HTML5 mode and only in browsers supporting HTML5 History API'); + } + // The user might modify `stateObject` after invoking `$location.state(stateObject)` + // but we're changing the $$state reference to $browser.state() during the $digest + // so the modification window is narrow. + this.$$state = isUndefined(state) ? null : state; + + return this; + }; + }); + + + function locationGetter(property) { + return function() { + return this[property]; + }; + } + + + function locationGetterSetter(property, preprocess) { + return function(value) { + if (isUndefined(value)) { + return this[property]; + } + + this[property] = preprocess(value); + this.$$compose(); + + return this; + }; + } + + + /** + * @ngdoc service + * @name $location + * + * @requires $rootElement + * + * @description + * The $location service parses the URL in the browser address bar (based on the + * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL + * available to your application. Changes to the URL in the address bar are reflected into + * $location service and changes to $location are reflected into the browser address bar. + * + * **The $location service:** + * + * - Exposes the current URL in the browser address bar, so you can + * - Watch and observe the URL. + * - Change the URL. + * - Synchronizes the URL with the browser when the user + * - Changes the address bar. + * - Clicks the back or forward button (or clicks a History link). + * - Clicks on a link. + * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash). + * + * For more information see {@link guide/$location Developer Guide: Using $location} + */ + + /** + * @ngdoc provider + * @name $locationProvider + * @description + * Use the `$locationProvider` to configure how the application deep linking paths are stored. + */ + function $LocationProvider() { + var hashPrefix = '', + html5Mode = { + enabled: false, + requireBase: true, + rewriteLinks: true + }; + + /** + * @ngdoc method + * @name $locationProvider#hashPrefix + * @description + * @param {string=} prefix Prefix for hash part (containing path and search) + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.hashPrefix = function(prefix) { + if (isDefined(prefix)) { + hashPrefix = prefix; + return this; + } else { + return hashPrefix; + } + }; + + /** + * @ngdoc method + * @name $locationProvider#html5Mode + * @description + * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value. + * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported + * properties: + * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to + * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not + * support `pushState`. + * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies + * whether or not a tag is required to be present. If `enabled` and `requireBase` are + * true, and a base tag is not present, an error will be thrown when `$location` is injected. + * See the {@link guide/$location $location guide for more information} + * - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled, + * enables/disables url rewriting for relative links. + * + * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter + */ + this.html5Mode = function(mode) { + if (isBoolean(mode)) { + html5Mode.enabled = mode; + return this; + } else if (isObject(mode)) { + + if (isBoolean(mode.enabled)) { + html5Mode.enabled = mode.enabled; + } + + if (isBoolean(mode.requireBase)) { + html5Mode.requireBase = mode.requireBase; + } + + if (isBoolean(mode.rewriteLinks)) { + html5Mode.rewriteLinks = mode.rewriteLinks; + } + + return this; + } else { + return html5Mode; + } + }; + + /** + * @ngdoc event + * @name $location#$locationChangeStart + * @eventType broadcast on root scope + * @description + * Broadcasted before a URL will change. + * + * This change can be prevented by calling + * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more + * details about event object. Upon successful change + * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired. + * + * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when + * the browser supports the HTML5 History API. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + * @param {string=} newState New history state object + * @param {string=} oldState History state object that was before it was changed. + */ + + /** + * @ngdoc event + * @name $location#$locationChangeSuccess + * @eventType broadcast on root scope + * @description + * Broadcasted after a URL was changed. + * + * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when + * the browser supports the HTML5 History API. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + * @param {string=} newState New history state object + * @param {string=} oldState History state object that was before it was changed. + */ + + this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window', + function($rootScope, $browser, $sniffer, $rootElement, $window) { + var $location, + LocationMode, + baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to '' + initialUrl = $browser.url(), + appBase; + + if (html5Mode.enabled) { + if (!baseHref && html5Mode.requireBase) { + throw $locationMinErr('nobase', + "$location in HTML5 mode requires a tag to be present!"); + } + appBase = serverBase(initialUrl) + (baseHref || '/'); + LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; + } else { + appBase = stripHash(initialUrl); + LocationMode = LocationHashbangUrl; + } + var appBaseNoFile = stripFile(appBase); + + $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix); + $location.$$parseLinkUrl(initialUrl, initialUrl); + + $location.$$state = $browser.state(); + + var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; + + function setBrowserUrlWithFallback(url, replace, state) { + var oldUrl = $location.url(); + var oldState = $location.$$state; + try { + $browser.url(url, replace, state); + + // Make sure $location.state() returns referentially identical (not just deeply equal) + // state object; this makes possible quick checking if the state changed in the digest + // loop. Checking deep equality would be too expensive. + $location.$$state = $browser.state(); + } catch (e) { + // Restore old values if pushState fails + $location.url(oldUrl); + $location.$$state = oldState; + + throw e; + } + } + + $rootElement.on('click', function(event) { + // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) + // currently we open nice url link and redirect then + + if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return; + + var elm = jqLite(event.target); + + // traverse the DOM up to find first A tag + while (nodeName_(elm[0]) !== 'a') { + // ignore rewriting if no A tag (reached root element, or no parent - removed from document) + if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; + } + + var absHref = elm.prop('href'); + // get the actual href attribute - see + // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx + var relHref = elm.attr('href') || elm.attr('xlink:href'); + + if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') { + // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during + // an animation. + absHref = urlResolve(absHref.animVal).href; + } + + // Ignore when url is started with javascript: or mailto: + if (IGNORE_URI_REGEXP.test(absHref)) return; + + if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) { + if ($location.$$parseLinkUrl(absHref, relHref)) { + // We do a preventDefault for all urls that are part of the angular application, + // in html5mode and also without, so that we are able to abort navigation without + // getting double entries in the location history. + event.preventDefault(); + // update location manually + if ($location.absUrl() != $browser.url()) { + $rootScope.$apply(); + // hack to work around FF6 bug 684208 when scenario runner clicks on links + $window.angular['ff-684208-preventDefault'] = true; + } + } + } + }); + + + // rewrite hashbang url <> html5 url + if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) { + $browser.url($location.absUrl(), true); + } + + var initializing = true; + + // update $location when $browser url changes + $browser.onUrlChange(function(newUrl, newState) { + + if (isUndefined(beginsWith(appBaseNoFile, newUrl))) { + // If we are navigating outside of the app then force a reload + $window.location.href = newUrl; + return; + } + + $rootScope.$evalAsync(function() { + var oldUrl = $location.absUrl(); + var oldState = $location.$$state; + var defaultPrevented; + + $location.$$parse(newUrl); + $location.$$state = newState; + + defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, + newState, oldState).defaultPrevented; + + // if the location was changed by a `$locationChangeStart` handler then stop + // processing this location change + if ($location.absUrl() !== newUrl) return; + + if (defaultPrevented) { + $location.$$parse(oldUrl); + $location.$$state = oldState; + setBrowserUrlWithFallback(oldUrl, false, oldState); + } else { + initializing = false; + afterLocationChange(oldUrl, oldState); + } + }); + if (!$rootScope.$$phase) $rootScope.$digest(); + }); + + // update browser + $rootScope.$watch(function $locationWatch() { + var oldUrl = trimEmptyHash($browser.url()); + var newUrl = trimEmptyHash($location.absUrl()); + var oldState = $browser.state(); + var currentReplace = $location.$$replace; + var urlOrStateChanged = oldUrl !== newUrl || + ($location.$$html5 && $sniffer.history && oldState !== $location.$$state); + + if (initializing || urlOrStateChanged) { + initializing = false; + + $rootScope.$evalAsync(function() { + var newUrl = $location.absUrl(); + var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, + $location.$$state, oldState).defaultPrevented; + + // if the location was changed by a `$locationChangeStart` handler then stop + // processing this location change + if ($location.absUrl() !== newUrl) return; + + if (defaultPrevented) { + $location.$$parse(oldUrl); + $location.$$state = oldState; + } else { + if (urlOrStateChanged) { + setBrowserUrlWithFallback(newUrl, currentReplace, + oldState === $location.$$state ? null : $location.$$state); + } + afterLocationChange(oldUrl, oldState); + } + }); + } + + $location.$$replace = false; + + // we don't need to return anything because $evalAsync will make the digest loop dirty when + // there is a change + }); + + return $location; + + function afterLocationChange(oldUrl, oldState) { + $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl, + $location.$$state, oldState); + } + }]; + } + + /** + * @ngdoc service + * @name $log + * @requires $window + * + * @description + * Simple service for logging. Default implementation safely writes the message + * into the browser's console (if present). + * + * The main purpose of this service is to simplify debugging and troubleshooting. + * + * The default is to log `debug` messages. You can use + * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this. + * + * @example + + + angular.module('logExample', []) + .controller('LogController', ['$scope', '$log', function($scope, $log) { + $scope.$log = $log; + $scope.message = 'Hello World!'; + }]); + + +
    +

    Reload this page with open console, enter text and hit the log button...

    + + + + + + +
    +
    +
    + */ + + /** + * @ngdoc provider + * @name $logProvider + * @description + * Use the `$logProvider` to configure how the application logs messages + */ + function $LogProvider() { + var debug = true, + self = this; + + /** + * @ngdoc method + * @name $logProvider#debugEnabled + * @description + * @param {boolean=} flag enable or disable debug level messages + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.debugEnabled = function(flag) { + if (isDefined(flag)) { + debug = flag; + return this; + } else { + return debug; + } + }; + + this.$get = ['$window', function($window) { + return { + /** + * @ngdoc method + * @name $log#log + * + * @description + * Write a log message + */ + log: consoleLog('log'), + + /** + * @ngdoc method + * @name $log#info + * + * @description + * Write an information message + */ + info: consoleLog('info'), + + /** + * @ngdoc method + * @name $log#warn + * + * @description + * Write a warning message + */ + warn: consoleLog('warn'), + + /** + * @ngdoc method + * @name $log#error + * + * @description + * Write an error message + */ + error: consoleLog('error'), + + /** + * @ngdoc method + * @name $log#debug + * + * @description + * Write a debug message + */ + debug: (function() { + var fn = consoleLog('debug'); + + return function() { + if (debug) { + fn.apply(self, arguments); + } + }; + }()) + }; + + function formatError(arg) { + if (arg instanceof Error) { + if (arg.stack) { + arg = (arg.message && arg.stack.indexOf(arg.message) === -1) + ? 'Error: ' + arg.message + '\n' + arg.stack + : arg.stack; + } else if (arg.sourceURL) { + arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; + } + } + return arg; + } + + function consoleLog(type) { + var console = $window.console || {}, + logFn = console[type] || console.log || noop, + hasApply = false; + + // Note: reading logFn.apply throws an error in IE11 in IE8 document mode. + // The reason behind this is that console.log has type "object" in IE8... + try { + hasApply = !!logFn.apply; + } catch (e) {} + + if (hasApply) { + return function() { + var args = []; + forEach(arguments, function(arg) { + args.push(formatError(arg)); + }); + return logFn.apply(console, args); + }; + } + + // we are IE which either doesn't have window.console => this is noop and we do nothing, + // or we are IE where console.log doesn't have apply so we log at least first 2 args + return function(arg1, arg2) { + logFn(arg1, arg2 == null ? '' : arg2); + }; + } + }]; + } + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + var $parseMinErr = minErr('$parse'); + + // Sandboxing Angular Expressions + // ------------------------------ + // Angular expressions are generally considered safe because these expressions only have direct + // access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by + // obtaining a reference to native JS functions such as the Function constructor. + // + // As an example, consider the following Angular expression: + // + // {}.toString.constructor('alert("evil JS code")') + // + // This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits + // against the expression language, but not to prevent exploits that were enabled by exposing + // sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good + // practice and therefore we are not even trying to protect against interaction with an object + // explicitly exposed in this way. + // + // In general, it is not possible to access a Window object from an angular expression unless a + // window or some DOM object that has a reference to window is published onto a Scope. + // Similarly we prevent invocations of function known to be dangerous, as well as assignments to + // native objects. + // + // See https://docs.angularjs.org/guide/security + + + function ensureSafeMemberName(name, fullExpression) { + if (name === "__defineGetter__" || name === "__defineSetter__" + || name === "__lookupGetter__" || name === "__lookupSetter__" + || name === "__proto__") { + throw $parseMinErr('isecfld', + 'Attempting to access a disallowed field in Angular expressions! ' + + 'Expression: {0}', fullExpression); + } + return name; + } + + function getStringValue(name, fullExpression) { + // From the JavaScript docs: + // Property names must be strings. This means that non-string objects cannot be used + // as keys in an object. Any non-string object, including a number, is typecasted + // into a string via the toString method. + // + // So, to ensure that we are checking the same `name` that JavaScript would use, + // we cast it to a string, if possible. + // Doing `name + ''` can cause a repl error if the result to `toString` is not a string, + // this is, this will handle objects that misbehave. + name = name + ''; + if (!isString(name)) { + throw $parseMinErr('iseccst', + 'Cannot convert object to primitive value! ' + + 'Expression: {0}', fullExpression); + } + return name; + } + + function ensureSafeObject(obj, fullExpression) { + // nifty check if obj is Function that is fast and works across iframes and other contexts + if (obj) { + if (obj.constructor === obj) { + throw $parseMinErr('isecfn', + 'Referencing Function in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// isWindow(obj) + obj.window === obj) { + throw $parseMinErr('isecwindow', + 'Referencing the Window in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// isElement(obj) + obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) { + throw $parseMinErr('isecdom', + 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// block Object so that we can't get hold of dangerous Object.* methods + obj === Object) { + throw $parseMinErr('isecobj', + 'Referencing Object in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } + } + return obj; + } + + var CALL = Function.prototype.call; + var APPLY = Function.prototype.apply; + var BIND = Function.prototype.bind; + + function ensureSafeFunction(obj, fullExpression) { + if (obj) { + if (obj.constructor === obj) { + throw $parseMinErr('isecfn', + 'Referencing Function in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (obj === CALL || obj === APPLY || obj === BIND) { + throw $parseMinErr('isecff', + 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } + } + } + + function ensureSafeAssignContext(obj, fullExpression) { + if (obj) { + if (obj === (0).constructor || obj === (false).constructor || obj === ''.constructor || + obj === {}.constructor || obj === [].constructor || obj === Function.constructor) { + throw $parseMinErr('isecaf', + 'Assigning to a constructor is disallowed! Expression: {0}', fullExpression); + } + } + } + + var OPERATORS = createMap(); + forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; }); + var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; + + + ///////////////////////////////////////// + + + /** + * @constructor + */ + var Lexer = function(options) { + this.options = options; + }; + + Lexer.prototype = { + constructor: Lexer, + + lex: function(text) { + this.text = text; + this.index = 0; + this.tokens = []; + + while (this.index < this.text.length) { + var ch = this.text.charAt(this.index); + if (ch === '"' || ch === "'") { + this.readString(ch); + } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) { + this.readNumber(); + } else if (this.isIdent(ch)) { + this.readIdent(); + } else if (this.is(ch, '(){}[].,;:?')) { + this.tokens.push({index: this.index, text: ch}); + this.index++; + } else if (this.isWhitespace(ch)) { + this.index++; + } else { + var ch2 = ch + this.peek(); + var ch3 = ch2 + this.peek(2); + var op1 = OPERATORS[ch]; + var op2 = OPERATORS[ch2]; + var op3 = OPERATORS[ch3]; + if (op1 || op2 || op3) { + var token = op3 ? ch3 : (op2 ? ch2 : ch); + this.tokens.push({index: this.index, text: token, operator: true}); + this.index += token.length; + } else { + this.throwError('Unexpected next character ', this.index, this.index + 1); + } + } + } + return this.tokens; + }, + + is: function(ch, chars) { + return chars.indexOf(ch) !== -1; + }, + + peek: function(i) { + var num = i || 1; + return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false; + }, + + isNumber: function(ch) { + return ('0' <= ch && ch <= '9') && typeof ch === "string"; + }, + + isWhitespace: function(ch) { + // IE treats non-breaking space as \u00A0 + return (ch === ' ' || ch === '\r' || ch === '\t' || + ch === '\n' || ch === '\v' || ch === '\u00A0'); + }, + + isIdent: function(ch) { + return ('a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + '_' === ch || ch === '$'); + }, + + isExpOperator: function(ch) { + return (ch === '-' || ch === '+' || this.isNumber(ch)); + }, + + throwError: function(error, start, end) { + end = end || this.index; + var colStr = (isDefined(start) + ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']' + : ' ' + end); + throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].', + error, colStr, this.text); + }, + + readNumber: function() { + var number = ''; + var start = this.index; + while (this.index < this.text.length) { + var ch = lowercase(this.text.charAt(this.index)); + if (ch == '.' || this.isNumber(ch)) { + number += ch; + } else { + var peekCh = this.peek(); + if (ch == 'e' && this.isExpOperator(peekCh)) { + number += ch; + } else if (this.isExpOperator(ch) && + peekCh && this.isNumber(peekCh) && + number.charAt(number.length - 1) == 'e') { + number += ch; + } else if (this.isExpOperator(ch) && + (!peekCh || !this.isNumber(peekCh)) && + number.charAt(number.length - 1) == 'e') { + this.throwError('Invalid exponent'); + } else { + break; + } + } + this.index++; + } + this.tokens.push({ + index: start, + text: number, + constant: true, + value: Number(number) + }); + }, + + readIdent: function() { + var start = this.index; + while (this.index < this.text.length) { + var ch = this.text.charAt(this.index); + if (!(this.isIdent(ch) || this.isNumber(ch))) { + break; + } + this.index++; + } + this.tokens.push({ + index: start, + text: this.text.slice(start, this.index), + identifier: true + }); + }, + + readString: function(quote) { + var start = this.index; + this.index++; + var string = ''; + var rawString = quote; + var escape = false; + while (this.index < this.text.length) { + var ch = this.text.charAt(this.index); + rawString += ch; + if (escape) { + if (ch === 'u') { + var hex = this.text.substring(this.index + 1, this.index + 5); + if (!hex.match(/[\da-f]{4}/i)) { + this.throwError('Invalid unicode escape [\\u' + hex + ']'); + } + this.index += 4; + string += String.fromCharCode(parseInt(hex, 16)); + } else { + var rep = ESCAPE[ch]; + string = string + (rep || ch); + } + escape = false; + } else if (ch === '\\') { + escape = true; + } else if (ch === quote) { + this.index++; + this.tokens.push({ + index: start, + text: rawString, + constant: true, + value: string + }); + return; + } else { + string += ch; + } + this.index++; + } + this.throwError('Unterminated quote', start); + } + }; + + var AST = function(lexer, options) { + this.lexer = lexer; + this.options = options; + }; + + AST.Program = 'Program'; + AST.ExpressionStatement = 'ExpressionStatement'; + AST.AssignmentExpression = 'AssignmentExpression'; + AST.ConditionalExpression = 'ConditionalExpression'; + AST.LogicalExpression = 'LogicalExpression'; + AST.BinaryExpression = 'BinaryExpression'; + AST.UnaryExpression = 'UnaryExpression'; + AST.CallExpression = 'CallExpression'; + AST.MemberExpression = 'MemberExpression'; + AST.Identifier = 'Identifier'; + AST.Literal = 'Literal'; + AST.ArrayExpression = 'ArrayExpression'; + AST.Property = 'Property'; + AST.ObjectExpression = 'ObjectExpression'; + AST.ThisExpression = 'ThisExpression'; + + // Internal use only + AST.NGValueParameter = 'NGValueParameter'; + + AST.prototype = { + ast: function(text) { + this.text = text; + this.tokens = this.lexer.lex(text); + + var value = this.program(); + + if (this.tokens.length !== 0) { + this.throwError('is an unexpected token', this.tokens[0]); + } + + return value; + }, + + program: function() { + var body = []; + while (true) { + if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']')) + body.push(this.expressionStatement()); + if (!this.expect(';')) { + return { type: AST.Program, body: body}; + } + } + }, + + expressionStatement: function() { + return { type: AST.ExpressionStatement, expression: this.filterChain() }; + }, + + filterChain: function() { + var left = this.expression(); + var token; + while ((token = this.expect('|'))) { + left = this.filter(left); + } + return left; + }, + + expression: function() { + return this.assignment(); + }, + + assignment: function() { + var result = this.ternary(); + if (this.expect('=')) { + result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='}; + } + return result; + }, + + ternary: function() { + var test = this.logicalOR(); + var alternate; + var consequent; + if (this.expect('?')) { + alternate = this.expression(); + if (this.consume(':')) { + consequent = this.expression(); + return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent}; + } + } + return test; + }, + + logicalOR: function() { + var left = this.logicalAND(); + while (this.expect('||')) { + left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() }; + } + return left; + }, + + logicalAND: function() { + var left = this.equality(); + while (this.expect('&&')) { + left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()}; + } + return left; + }, + + equality: function() { + var left = this.relational(); + var token; + while ((token = this.expect('==','!=','===','!=='))) { + left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() }; + } + return left; + }, + + relational: function() { + var left = this.additive(); + var token; + while ((token = this.expect('<', '>', '<=', '>='))) { + left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() }; + } + return left; + }, + + additive: function() { + var left = this.multiplicative(); + var token; + while ((token = this.expect('+','-'))) { + left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() }; + } + return left; + }, + + multiplicative: function() { + var left = this.unary(); + var token; + while ((token = this.expect('*','/','%'))) { + left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() }; + } + return left; + }, + + unary: function() { + var token; + if ((token = this.expect('+', '-', '!'))) { + return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() }; + } else { + return this.primary(); + } + }, + + primary: function() { + var primary; + if (this.expect('(')) { + primary = this.filterChain(); + this.consume(')'); + } else if (this.expect('[')) { + primary = this.arrayDeclaration(); + } else if (this.expect('{')) { + primary = this.object(); + } else if (this.constants.hasOwnProperty(this.peek().text)) { + primary = copy(this.constants[this.consume().text]); + } else if (this.peek().identifier) { + primary = this.identifier(); + } else if (this.peek().constant) { + primary = this.constant(); + } else { + this.throwError('not a primary expression', this.peek()); + } + + var next; + while ((next = this.expect('(', '[', '.'))) { + if (next.text === '(') { + primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() }; + this.consume(')'); + } else if (next.text === '[') { + primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true }; + this.consume(']'); + } else if (next.text === '.') { + primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false }; + } else { + this.throwError('IMPOSSIBLE'); + } + } + return primary; + }, + + filter: function(baseExpression) { + var args = [baseExpression]; + var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true}; + + while (this.expect(':')) { + args.push(this.expression()); + } + + return result; + }, + + parseArguments: function() { + var args = []; + if (this.peekToken().text !== ')') { + do { + args.push(this.expression()); + } while (this.expect(',')); + } + return args; + }, + + identifier: function() { + var token = this.consume(); + if (!token.identifier) { + this.throwError('is not a valid identifier', token); + } + return { type: AST.Identifier, name: token.text }; + }, + + constant: function() { + // TODO check that it is a constant + return { type: AST.Literal, value: this.consume().value }; + }, + + arrayDeclaration: function() { + var elements = []; + if (this.peekToken().text !== ']') { + do { + if (this.peek(']')) { + // Support trailing commas per ES5.1. + break; + } + elements.push(this.expression()); + } while (this.expect(',')); + } + this.consume(']'); + + return { type: AST.ArrayExpression, elements: elements }; + }, + + object: function() { + var properties = [], property; + if (this.peekToken().text !== '}') { + do { + if (this.peek('}')) { + // Support trailing commas per ES5.1. + break; + } + property = {type: AST.Property, kind: 'init'}; + if (this.peek().constant) { + property.key = this.constant(); + } else if (this.peek().identifier) { + property.key = this.identifier(); + } else { + this.throwError("invalid key", this.peek()); + } + this.consume(':'); + property.value = this.expression(); + properties.push(property); + } while (this.expect(',')); + } + this.consume('}'); + + return {type: AST.ObjectExpression, properties: properties }; + }, + + throwError: function(msg, token) { + throw $parseMinErr('syntax', + 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].', + token.text, msg, (token.index + 1), this.text, this.text.substring(token.index)); + }, + + consume: function(e1) { + if (this.tokens.length === 0) { + throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); + } + + var token = this.expect(e1); + if (!token) { + this.throwError('is unexpected, expecting [' + e1 + ']', this.peek()); + } + return token; + }, + + peekToken: function() { + if (this.tokens.length === 0) { + throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); + } + return this.tokens[0]; + }, + + peek: function(e1, e2, e3, e4) { + return this.peekAhead(0, e1, e2, e3, e4); + }, + + peekAhead: function(i, e1, e2, e3, e4) { + if (this.tokens.length > i) { + var token = this.tokens[i]; + var t = token.text; + if (t === e1 || t === e2 || t === e3 || t === e4 || + (!e1 && !e2 && !e3 && !e4)) { + return token; + } + } + return false; + }, + + expect: function(e1, e2, e3, e4) { + var token = this.peek(e1, e2, e3, e4); + if (token) { + this.tokens.shift(); + return token; + } + return false; + }, + + + /* `undefined` is not a constant, it is an identifier, + * but using it as an identifier is not supported + */ + constants: { + 'true': { type: AST.Literal, value: true }, + 'false': { type: AST.Literal, value: false }, + 'null': { type: AST.Literal, value: null }, + 'undefined': {type: AST.Literal, value: undefined }, + 'this': {type: AST.ThisExpression } + } + }; + + function ifDefined(v, d) { + return typeof v !== 'undefined' ? v : d; + } + + function plusFn(l, r) { + if (typeof l === 'undefined') return r; + if (typeof r === 'undefined') return l; + return l + r; + } + + function isStateless($filter, filterName) { + var fn = $filter(filterName); + return !fn.$stateful; + } + + function findConstantAndWatchExpressions(ast, $filter) { + var allConstants; + var argsToWatch; + switch (ast.type) { + case AST.Program: + allConstants = true; + forEach(ast.body, function(expr) { + findConstantAndWatchExpressions(expr.expression, $filter); + allConstants = allConstants && expr.expression.constant; + }); + ast.constant = allConstants; + break; + case AST.Literal: + ast.constant = true; + ast.toWatch = []; + break; + case AST.UnaryExpression: + findConstantAndWatchExpressions(ast.argument, $filter); + ast.constant = ast.argument.constant; + ast.toWatch = ast.argument.toWatch; + break; + case AST.BinaryExpression: + findConstantAndWatchExpressions(ast.left, $filter); + findConstantAndWatchExpressions(ast.right, $filter); + ast.constant = ast.left.constant && ast.right.constant; + ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch); + break; + case AST.LogicalExpression: + findConstantAndWatchExpressions(ast.left, $filter); + findConstantAndWatchExpressions(ast.right, $filter); + ast.constant = ast.left.constant && ast.right.constant; + ast.toWatch = ast.constant ? [] : [ast]; + break; + case AST.ConditionalExpression: + findConstantAndWatchExpressions(ast.test, $filter); + findConstantAndWatchExpressions(ast.alternate, $filter); + findConstantAndWatchExpressions(ast.consequent, $filter); + ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant; + ast.toWatch = ast.constant ? [] : [ast]; + break; + case AST.Identifier: + ast.constant = false; + ast.toWatch = [ast]; + break; + case AST.MemberExpression: + findConstantAndWatchExpressions(ast.object, $filter); + if (ast.computed) { + findConstantAndWatchExpressions(ast.property, $filter); + } + ast.constant = ast.object.constant && (!ast.computed || ast.property.constant); + ast.toWatch = [ast]; + break; + case AST.CallExpression: + allConstants = ast.filter ? isStateless($filter, ast.callee.name) : false; + argsToWatch = []; + forEach(ast.arguments, function(expr) { + findConstantAndWatchExpressions(expr, $filter); + allConstants = allConstants && expr.constant; + if (!expr.constant) { + argsToWatch.push.apply(argsToWatch, expr.toWatch); + } + }); + ast.constant = allConstants; + ast.toWatch = ast.filter && isStateless($filter, ast.callee.name) ? argsToWatch : [ast]; + break; + case AST.AssignmentExpression: + findConstantAndWatchExpressions(ast.left, $filter); + findConstantAndWatchExpressions(ast.right, $filter); + ast.constant = ast.left.constant && ast.right.constant; + ast.toWatch = [ast]; + break; + case AST.ArrayExpression: + allConstants = true; + argsToWatch = []; + forEach(ast.elements, function(expr) { + findConstantAndWatchExpressions(expr, $filter); + allConstants = allConstants && expr.constant; + if (!expr.constant) { + argsToWatch.push.apply(argsToWatch, expr.toWatch); + } + }); + ast.constant = allConstants; + ast.toWatch = argsToWatch; + break; + case AST.ObjectExpression: + allConstants = true; + argsToWatch = []; + forEach(ast.properties, function(property) { + findConstantAndWatchExpressions(property.value, $filter); + allConstants = allConstants && property.value.constant; + if (!property.value.constant) { + argsToWatch.push.apply(argsToWatch, property.value.toWatch); + } + }); + ast.constant = allConstants; + ast.toWatch = argsToWatch; + break; + case AST.ThisExpression: + ast.constant = false; + ast.toWatch = []; + break; + } + } + + function getInputs(body) { + if (body.length != 1) return; + var lastExpression = body[0].expression; + var candidate = lastExpression.toWatch; + if (candidate.length !== 1) return candidate; + return candidate[0] !== lastExpression ? candidate : undefined; + } + + function isAssignable(ast) { + return ast.type === AST.Identifier || ast.type === AST.MemberExpression; + } + + function assignableAST(ast) { + if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) { + return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='}; + } + } + + function isLiteral(ast) { + return ast.body.length === 0 || + ast.body.length === 1 && ( + ast.body[0].expression.type === AST.Literal || + ast.body[0].expression.type === AST.ArrayExpression || + ast.body[0].expression.type === AST.ObjectExpression); + } + + function isConstant(ast) { + return ast.constant; + } + + function ASTCompiler(astBuilder, $filter) { + this.astBuilder = astBuilder; + this.$filter = $filter; + } + + ASTCompiler.prototype = { + compile: function(expression, expensiveChecks) { + var self = this; + var ast = this.astBuilder.ast(expression); + this.state = { + nextId: 0, + filters: {}, + expensiveChecks: expensiveChecks, + fn: {vars: [], body: [], own: {}}, + assign: {vars: [], body: [], own: {}}, + inputs: [] + }; + findConstantAndWatchExpressions(ast, self.$filter); + var extra = ''; + var assignable; + this.stage = 'assign'; + if ((assignable = assignableAST(ast))) { + this.state.computing = 'assign'; + var result = this.nextId(); + this.recurse(assignable, result); + this.return_(result); + extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l'); + } + var toWatch = getInputs(ast.body); + self.stage = 'inputs'; + forEach(toWatch, function(watch, key) { + var fnKey = 'fn' + key; + self.state[fnKey] = {vars: [], body: [], own: {}}; + self.state.computing = fnKey; + var intoId = self.nextId(); + self.recurse(watch, intoId); + self.return_(intoId); + self.state.inputs.push(fnKey); + watch.watchId = key; + }); + this.state.computing = 'fn'; + this.stage = 'main'; + this.recurse(ast); + var fnString = + // The build and minification steps remove the string "use strict" from the code, but this is done using a regex. + // This is a workaround for this until we do a better job at only removing the prefix only when we should. + '"' + this.USE + ' ' + this.STRICT + '";\n' + + this.filterPrefix() + + 'var fn=' + this.generateFunction('fn', 's,l,a,i') + + extra + + this.watchFns() + + 'return fn;'; + + /* jshint -W054 */ + var fn = (new Function('$filter', + 'ensureSafeMemberName', + 'ensureSafeObject', + 'ensureSafeFunction', + 'getStringValue', + 'ensureSafeAssignContext', + 'ifDefined', + 'plus', + 'text', + fnString))( + this.$filter, + ensureSafeMemberName, + ensureSafeObject, + ensureSafeFunction, + getStringValue, + ensureSafeAssignContext, + ifDefined, + plusFn, + expression); + /* jshint +W054 */ + this.state = this.stage = undefined; + fn.literal = isLiteral(ast); + fn.constant = isConstant(ast); + return fn; + }, + + USE: 'use', + + STRICT: 'strict', + + watchFns: function() { + var result = []; + var fns = this.state.inputs; + var self = this; + forEach(fns, function(name) { + result.push('var ' + name + '=' + self.generateFunction(name, 's')); + }); + if (fns.length) { + result.push('fn.inputs=[' + fns.join(',') + '];'); + } + return result.join(''); + }, + + generateFunction: function(name, params) { + return 'function(' + params + '){' + + this.varsPrefix(name) + + this.body(name) + + '};'; + }, + + filterPrefix: function() { + var parts = []; + var self = this; + forEach(this.state.filters, function(id, filter) { + parts.push(id + '=$filter(' + self.escape(filter) + ')'); + }); + if (parts.length) return 'var ' + parts.join(',') + ';'; + return ''; + }, + + varsPrefix: function(section) { + return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : ''; + }, + + body: function(section) { + return this.state[section].body.join(''); + }, + + recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) { + var left, right, self = this, args, expression; + recursionFn = recursionFn || noop; + if (!skipWatchIdCheck && isDefined(ast.watchId)) { + intoId = intoId || this.nextId(); + this.if_('i', + this.lazyAssign(intoId, this.computedMember('i', ast.watchId)), + this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true) + ); + return; + } + switch (ast.type) { + case AST.Program: + forEach(ast.body, function(expression, pos) { + self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; }); + if (pos !== ast.body.length - 1) { + self.current().body.push(right, ';'); + } else { + self.return_(right); + } + }); + break; + case AST.Literal: + expression = this.escape(ast.value); + this.assign(intoId, expression); + recursionFn(expression); + break; + case AST.UnaryExpression: + this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; }); + expression = ast.operator + '(' + this.ifDefined(right, 0) + ')'; + this.assign(intoId, expression); + recursionFn(expression); + break; + case AST.BinaryExpression: + this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; }); + this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; }); + if (ast.operator === '+') { + expression = this.plus(left, right); + } else if (ast.operator === '-') { + expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0); + } else { + expression = '(' + left + ')' + ast.operator + '(' + right + ')'; + } + this.assign(intoId, expression); + recursionFn(expression); + break; + case AST.LogicalExpression: + intoId = intoId || this.nextId(); + self.recurse(ast.left, intoId); + self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId)); + recursionFn(intoId); + break; + case AST.ConditionalExpression: + intoId = intoId || this.nextId(); + self.recurse(ast.test, intoId); + self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId)); + recursionFn(intoId); + break; + case AST.Identifier: + intoId = intoId || this.nextId(); + if (nameId) { + nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s'); + nameId.computed = false; + nameId.name = ast.name; + } + ensureSafeMemberName(ast.name); + self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)), + function() { + self.if_(self.stage === 'inputs' || 's', function() { + if (create && create !== 1) { + self.if_( + self.not(self.nonComputedMember('s', ast.name)), + self.lazyAssign(self.nonComputedMember('s', ast.name), '{}')); + } + self.assign(intoId, self.nonComputedMember('s', ast.name)); + }); + }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name)) + ); + if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.name)) { + self.addEnsureSafeObject(intoId); + } + recursionFn(intoId); + break; + case AST.MemberExpression: + left = nameId && (nameId.context = this.nextId()) || this.nextId(); + intoId = intoId || this.nextId(); + self.recurse(ast.object, left, undefined, function() { + self.if_(self.notNull(left), function() { + if (ast.computed) { + right = self.nextId(); + self.recurse(ast.property, right); + self.getStringValue(right); + self.addEnsureSafeMemberName(right); + if (create && create !== 1) { + self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}')); + } + expression = self.ensureSafeObject(self.computedMember(left, right)); + self.assign(intoId, expression); + if (nameId) { + nameId.computed = true; + nameId.name = right; + } + } else { + ensureSafeMemberName(ast.property.name); + if (create && create !== 1) { + self.if_(self.not(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}')); + } + expression = self.nonComputedMember(left, ast.property.name); + if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.property.name)) { + expression = self.ensureSafeObject(expression); + } + self.assign(intoId, expression); + if (nameId) { + nameId.computed = false; + nameId.name = ast.property.name; + } + } + }, function() { + self.assign(intoId, 'undefined'); + }); + recursionFn(intoId); + }, !!create); + break; + case AST.CallExpression: + intoId = intoId || this.nextId(); + if (ast.filter) { + right = self.filter(ast.callee.name); + args = []; + forEach(ast.arguments, function(expr) { + var argument = self.nextId(); + self.recurse(expr, argument); + args.push(argument); + }); + expression = right + '(' + args.join(',') + ')'; + self.assign(intoId, expression); + recursionFn(intoId); + } else { + right = self.nextId(); + left = {}; + args = []; + self.recurse(ast.callee, right, left, function() { + self.if_(self.notNull(right), function() { + self.addEnsureSafeFunction(right); + forEach(ast.arguments, function(expr) { + self.recurse(expr, self.nextId(), undefined, function(argument) { + args.push(self.ensureSafeObject(argument)); + }); + }); + if (left.name) { + if (!self.state.expensiveChecks) { + self.addEnsureSafeObject(left.context); + } + expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')'; + } else { + expression = right + '(' + args.join(',') + ')'; + } + expression = self.ensureSafeObject(expression); + self.assign(intoId, expression); + }, function() { + self.assign(intoId, 'undefined'); + }); + recursionFn(intoId); + }); + } + break; + case AST.AssignmentExpression: + right = this.nextId(); + left = {}; + if (!isAssignable(ast.left)) { + throw $parseMinErr('lval', 'Trying to assing a value to a non l-value'); + } + this.recurse(ast.left, undefined, left, function() { + self.if_(self.notNull(left.context), function() { + self.recurse(ast.right, right); + self.addEnsureSafeObject(self.member(left.context, left.name, left.computed)); + self.addEnsureSafeAssignContext(left.context); + expression = self.member(left.context, left.name, left.computed) + ast.operator + right; + self.assign(intoId, expression); + recursionFn(intoId || expression); + }); + }, 1); + break; + case AST.ArrayExpression: + args = []; + forEach(ast.elements, function(expr) { + self.recurse(expr, self.nextId(), undefined, function(argument) { + args.push(argument); + }); + }); + expression = '[' + args.join(',') + ']'; + this.assign(intoId, expression); + recursionFn(expression); + break; + case AST.ObjectExpression: + args = []; + forEach(ast.properties, function(property) { + self.recurse(property.value, self.nextId(), undefined, function(expr) { + args.push(self.escape( + property.key.type === AST.Identifier ? property.key.name : + ('' + property.key.value)) + + ':' + expr); + }); + }); + expression = '{' + args.join(',') + '}'; + this.assign(intoId, expression); + recursionFn(expression); + break; + case AST.ThisExpression: + this.assign(intoId, 's'); + recursionFn('s'); + break; + case AST.NGValueParameter: + this.assign(intoId, 'v'); + recursionFn('v'); + break; + } + }, + + getHasOwnProperty: function(element, property) { + var key = element + '.' + property; + var own = this.current().own; + if (!own.hasOwnProperty(key)) { + own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')'); + } + return own[key]; + }, + + assign: function(id, value) { + if (!id) return; + this.current().body.push(id, '=', value, ';'); + return id; + }, + + filter: function(filterName) { + if (!this.state.filters.hasOwnProperty(filterName)) { + this.state.filters[filterName] = this.nextId(true); + } + return this.state.filters[filterName]; + }, + + ifDefined: function(id, defaultValue) { + return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')'; + }, + + plus: function(left, right) { + return 'plus(' + left + ',' + right + ')'; + }, + + return_: function(id) { + this.current().body.push('return ', id, ';'); + }, + + if_: function(test, alternate, consequent) { + if (test === true) { + alternate(); + } else { + var body = this.current().body; + body.push('if(', test, '){'); + alternate(); + body.push('}'); + if (consequent) { + body.push('else{'); + consequent(); + body.push('}'); + } + } + }, + + not: function(expression) { + return '!(' + expression + ')'; + }, + + notNull: function(expression) { + return expression + '!=null'; + }, + + nonComputedMember: function(left, right) { + return left + '.' + right; + }, + + computedMember: function(left, right) { + return left + '[' + right + ']'; + }, + + member: function(left, right, computed) { + if (computed) return this.computedMember(left, right); + return this.nonComputedMember(left, right); + }, + + addEnsureSafeObject: function(item) { + this.current().body.push(this.ensureSafeObject(item), ';'); + }, + + addEnsureSafeMemberName: function(item) { + this.current().body.push(this.ensureSafeMemberName(item), ';'); + }, + + addEnsureSafeFunction: function(item) { + this.current().body.push(this.ensureSafeFunction(item), ';'); + }, + + addEnsureSafeAssignContext: function(item) { + this.current().body.push(this.ensureSafeAssignContext(item), ';'); + }, + + ensureSafeObject: function(item) { + return 'ensureSafeObject(' + item + ',text)'; + }, + + ensureSafeMemberName: function(item) { + return 'ensureSafeMemberName(' + item + ',text)'; + }, + + ensureSafeFunction: function(item) { + return 'ensureSafeFunction(' + item + ',text)'; + }, + + getStringValue: function(item) { + this.assign(item, 'getStringValue(' + item + ',text)'); + }, + + ensureSafeAssignContext: function(item) { + return 'ensureSafeAssignContext(' + item + ',text)'; + }, + + lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) { + var self = this; + return function() { + self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck); + }; + }, + + lazyAssign: function(id, value) { + var self = this; + return function() { + self.assign(id, value); + }; + }, + + stringEscapeRegex: /[^ a-zA-Z0-9]/g, + + stringEscapeFn: function(c) { + return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4); + }, + + escape: function(value) { + if (isString(value)) return "'" + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + "'"; + if (isNumber(value)) return value.toString(); + if (value === true) return 'true'; + if (value === false) return 'false'; + if (value === null) return 'null'; + if (typeof value === 'undefined') return 'undefined'; + + throw $parseMinErr('esc', 'IMPOSSIBLE'); + }, + + nextId: function(skip, init) { + var id = 'v' + (this.state.nextId++); + if (!skip) { + this.current().vars.push(id + (init ? '=' + init : '')); + } + return id; + }, + + current: function() { + return this.state[this.state.computing]; + } + }; + + + function ASTInterpreter(astBuilder, $filter) { + this.astBuilder = astBuilder; + this.$filter = $filter; + } + + ASTInterpreter.prototype = { + compile: function(expression, expensiveChecks) { + var self = this; + var ast = this.astBuilder.ast(expression); + this.expression = expression; + this.expensiveChecks = expensiveChecks; + findConstantAndWatchExpressions(ast, self.$filter); + var assignable; + var assign; + if ((assignable = assignableAST(ast))) { + assign = this.recurse(assignable); + } + var toWatch = getInputs(ast.body); + var inputs; + if (toWatch) { + inputs = []; + forEach(toWatch, function(watch, key) { + var input = self.recurse(watch); + watch.input = input; + inputs.push(input); + watch.watchId = key; + }); + } + var expressions = []; + forEach(ast.body, function(expression) { + expressions.push(self.recurse(expression.expression)); + }); + var fn = ast.body.length === 0 ? function() {} : + ast.body.length === 1 ? expressions[0] : + function(scope, locals) { + var lastValue; + forEach(expressions, function(exp) { + lastValue = exp(scope, locals); + }); + return lastValue; + }; + if (assign) { + fn.assign = function(scope, value, locals) { + return assign(scope, locals, value); + }; + } + if (inputs) { + fn.inputs = inputs; + } + fn.literal = isLiteral(ast); + fn.constant = isConstant(ast); + return fn; + }, + + recurse: function(ast, context, create) { + var left, right, self = this, args, expression; + if (ast.input) { + return this.inputs(ast.input, ast.watchId); + } + switch (ast.type) { + case AST.Literal: + return this.value(ast.value, context); + case AST.UnaryExpression: + right = this.recurse(ast.argument); + return this['unary' + ast.operator](right, context); + case AST.BinaryExpression: + left = this.recurse(ast.left); + right = this.recurse(ast.right); + return this['binary' + ast.operator](left, right, context); + case AST.LogicalExpression: + left = this.recurse(ast.left); + right = this.recurse(ast.right); + return this['binary' + ast.operator](left, right, context); + case AST.ConditionalExpression: + return this['ternary?:']( + this.recurse(ast.test), + this.recurse(ast.alternate), + this.recurse(ast.consequent), + context + ); + case AST.Identifier: + ensureSafeMemberName(ast.name, self.expression); + return self.identifier(ast.name, + self.expensiveChecks || isPossiblyDangerousMemberName(ast.name), + context, create, self.expression); + case AST.MemberExpression: + left = this.recurse(ast.object, false, !!create); + if (!ast.computed) { + ensureSafeMemberName(ast.property.name, self.expression); + right = ast.property.name; + } + if (ast.computed) right = this.recurse(ast.property); + return ast.computed ? + this.computedMember(left, right, context, create, self.expression) : + this.nonComputedMember(left, right, self.expensiveChecks, context, create, self.expression); + case AST.CallExpression: + args = []; + forEach(ast.arguments, function(expr) { + args.push(self.recurse(expr)); + }); + if (ast.filter) right = this.$filter(ast.callee.name); + if (!ast.filter) right = this.recurse(ast.callee, true); + return ast.filter ? + function(scope, locals, assign, inputs) { + var values = []; + for (var i = 0; i < args.length; ++i) { + values.push(args[i](scope, locals, assign, inputs)); + } + var value = right.apply(undefined, values, inputs); + return context ? {context: undefined, name: undefined, value: value} : value; + } : + function(scope, locals, assign, inputs) { + var rhs = right(scope, locals, assign, inputs); + var value; + if (rhs.value != null) { + ensureSafeObject(rhs.context, self.expression); + ensureSafeFunction(rhs.value, self.expression); + var values = []; + for (var i = 0; i < args.length; ++i) { + values.push(ensureSafeObject(args[i](scope, locals, assign, inputs), self.expression)); + } + value = ensureSafeObject(rhs.value.apply(rhs.context, values), self.expression); + } + return context ? {value: value} : value; + }; + case AST.AssignmentExpression: + left = this.recurse(ast.left, true, 1); + right = this.recurse(ast.right); + return function(scope, locals, assign, inputs) { + var lhs = left(scope, locals, assign, inputs); + var rhs = right(scope, locals, assign, inputs); + ensureSafeObject(lhs.value, self.expression); + ensureSafeAssignContext(lhs.context); + lhs.context[lhs.name] = rhs; + return context ? {value: rhs} : rhs; + }; + case AST.ArrayExpression: + args = []; + forEach(ast.elements, function(expr) { + args.push(self.recurse(expr)); + }); + return function(scope, locals, assign, inputs) { + var value = []; + for (var i = 0; i < args.length; ++i) { + value.push(args[i](scope, locals, assign, inputs)); + } + return context ? {value: value} : value; + }; + case AST.ObjectExpression: + args = []; + forEach(ast.properties, function(property) { + args.push({key: property.key.type === AST.Identifier ? + property.key.name : + ('' + property.key.value), + value: self.recurse(property.value) + }); + }); + return function(scope, locals, assign, inputs) { + var value = {}; + for (var i = 0; i < args.length; ++i) { + value[args[i].key] = args[i].value(scope, locals, assign, inputs); + } + return context ? {value: value} : value; + }; + case AST.ThisExpression: + return function(scope) { + return context ? {value: scope} : scope; + }; + case AST.NGValueParameter: + return function(scope, locals, assign, inputs) { + return context ? {value: assign} : assign; + }; + } + }, + + 'unary+': function(argument, context) { + return function(scope, locals, assign, inputs) { + var arg = argument(scope, locals, assign, inputs); + if (isDefined(arg)) { + arg = +arg; + } else { + arg = 0; + } + return context ? {value: arg} : arg; + }; + }, + 'unary-': function(argument, context) { + return function(scope, locals, assign, inputs) { + var arg = argument(scope, locals, assign, inputs); + if (isDefined(arg)) { + arg = -arg; + } else { + arg = 0; + } + return context ? {value: arg} : arg; + }; + }, + 'unary!': function(argument, context) { + return function(scope, locals, assign, inputs) { + var arg = !argument(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary+': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var lhs = left(scope, locals, assign, inputs); + var rhs = right(scope, locals, assign, inputs); + var arg = plusFn(lhs, rhs); + return context ? {value: arg} : arg; + }; + }, + 'binary-': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var lhs = left(scope, locals, assign, inputs); + var rhs = right(scope, locals, assign, inputs); + var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0); + return context ? {value: arg} : arg; + }; + }, + 'binary*': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary/': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary%': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary===': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary!==': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary==': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary!=': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary<': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary>': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary<=': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary>=': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary&&': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'binary||': function(left, right, context) { + return function(scope, locals, assign, inputs) { + var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + 'ternary?:': function(test, alternate, consequent, context) { + return function(scope, locals, assign, inputs) { + var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs); + return context ? {value: arg} : arg; + }; + }, + value: function(value, context) { + return function() { return context ? {context: undefined, name: undefined, value: value} : value; }; + }, + identifier: function(name, expensiveChecks, context, create, expression) { + return function(scope, locals, assign, inputs) { + var base = locals && (name in locals) ? locals : scope; + if (create && create !== 1 && base && !(base[name])) { + base[name] = {}; + } + var value = base ? base[name] : undefined; + if (expensiveChecks) { + ensureSafeObject(value, expression); + } + if (context) { + return {context: base, name: name, value: value}; + } else { + return value; + } + }; + }, + computedMember: function(left, right, context, create, expression) { + return function(scope, locals, assign, inputs) { + var lhs = left(scope, locals, assign, inputs); + var rhs; + var value; + if (lhs != null) { + rhs = right(scope, locals, assign, inputs); + rhs = getStringValue(rhs); + ensureSafeMemberName(rhs, expression); + if (create && create !== 1 && lhs && !(lhs[rhs])) { + lhs[rhs] = {}; + } + value = lhs[rhs]; + ensureSafeObject(value, expression); + } + if (context) { + return {context: lhs, name: rhs, value: value}; + } else { + return value; + } + }; + }, + nonComputedMember: function(left, right, expensiveChecks, context, create, expression) { + return function(scope, locals, assign, inputs) { + var lhs = left(scope, locals, assign, inputs); + if (create && create !== 1 && lhs && !(lhs[right])) { + lhs[right] = {}; + } + var value = lhs != null ? lhs[right] : undefined; + if (expensiveChecks || isPossiblyDangerousMemberName(right)) { + ensureSafeObject(value, expression); + } + if (context) { + return {context: lhs, name: right, value: value}; + } else { + return value; + } + }; + }, + inputs: function(input, watchId) { + return function(scope, value, locals, inputs) { + if (inputs) return inputs[watchId]; + return input(scope, value, locals); + }; + } + }; + + /** + * @constructor + */ + var Parser = function(lexer, $filter, options) { + this.lexer = lexer; + this.$filter = $filter; + this.options = options; + this.ast = new AST(this.lexer); + this.astCompiler = options.csp ? new ASTInterpreter(this.ast, $filter) : + new ASTCompiler(this.ast, $filter); + }; + + Parser.prototype = { + constructor: Parser, + + parse: function(text) { + return this.astCompiler.compile(text, this.options.expensiveChecks); + } + }; + + var getterFnCacheDefault = createMap(); + var getterFnCacheExpensive = createMap(); + + function isPossiblyDangerousMemberName(name) { + return name == 'constructor'; + } + + var objectValueOf = Object.prototype.valueOf; + + function getValueOf(value) { + return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value); + } + + /////////////////////////////////// + + /** + * @ngdoc service + * @name $parse + * @kind function + * + * @description + * + * Converts Angular {@link guide/expression expression} into a function. + * + * ```js + * var getter = $parse('user.name'); + * var setter = getter.assign; + * var context = {user:{name:'angular'}}; + * var locals = {user:{name:'local'}}; + * + * expect(getter(context)).toEqual('angular'); + * setter(context, 'newValue'); + * expect(context.user.name).toEqual('newValue'); + * expect(getter(context, locals)).toEqual('local'); + * ``` + * + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + * + * The returned function also has the following properties: + * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript + * literal. + * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript + * constant literals. + * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be + * set to a function to change its value on the given context. + * + */ + + + /** + * @ngdoc provider + * @name $parseProvider + * + * @description + * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} + * service. + */ + function $ParseProvider() { + var cacheDefault = createMap(); + var cacheExpensive = createMap(); + + this.$get = ['$filter', function($filter) { + var noUnsafeEval = csp().noUnsafeEval; + var $parseOptions = { + csp: noUnsafeEval, + expensiveChecks: false + }, + $parseOptionsExpensive = { + csp: noUnsafeEval, + expensiveChecks: true + }; + + return function $parse(exp, interceptorFn, expensiveChecks) { + var parsedExpression, oneTime, cacheKey; + + switch (typeof exp) { + case 'string': + exp = exp.trim(); + cacheKey = exp; + + var cache = (expensiveChecks ? cacheExpensive : cacheDefault); + parsedExpression = cache[cacheKey]; + + if (!parsedExpression) { + if (exp.charAt(0) === ':' && exp.charAt(1) === ':') { + oneTime = true; + exp = exp.substring(2); + } + var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions; + var lexer = new Lexer(parseOptions); + var parser = new Parser(lexer, $filter, parseOptions); + parsedExpression = parser.parse(exp); + if (parsedExpression.constant) { + parsedExpression.$$watchDelegate = constantWatchDelegate; + } else if (oneTime) { + parsedExpression.$$watchDelegate = parsedExpression.literal ? + oneTimeLiteralWatchDelegate : oneTimeWatchDelegate; + } else if (parsedExpression.inputs) { + parsedExpression.$$watchDelegate = inputsWatchDelegate; + } + cache[cacheKey] = parsedExpression; + } + return addInterceptor(parsedExpression, interceptorFn); + + case 'function': + return addInterceptor(exp, interceptorFn); + + default: + return noop; + } + }; + + function expressionInputDirtyCheck(newValue, oldValueOfValue) { + + if (newValue == null || oldValueOfValue == null) { // null/undefined + return newValue === oldValueOfValue; + } + + if (typeof newValue === 'object') { + + // attempt to convert the value to a primitive type + // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can + // be cheaply dirty-checked + newValue = getValueOf(newValue); + + if (typeof newValue === 'object') { + // objects/arrays are not supported - deep-watching them would be too expensive + return false; + } + + // fall-through to the primitive equality check + } + + //Primitive or NaN + return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue); + } + + function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) { + var inputExpressions = parsedExpression.inputs; + var lastResult; + + if (inputExpressions.length === 1) { + var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails + inputExpressions = inputExpressions[0]; + return scope.$watch(function expressionInputWatch(scope) { + var newInputValue = inputExpressions(scope); + if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) { + lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]); + oldInputValueOf = newInputValue && getValueOf(newInputValue); + } + return lastResult; + }, listener, objectEquality, prettyPrintExpression); + } + + var oldInputValueOfValues = []; + var oldInputValues = []; + for (var i = 0, ii = inputExpressions.length; i < ii; i++) { + oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails + oldInputValues[i] = null; + } + + return scope.$watch(function expressionInputsWatch(scope) { + var changed = false; + + for (var i = 0, ii = inputExpressions.length; i < ii; i++) { + var newInputValue = inputExpressions[i](scope); + if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) { + oldInputValues[i] = newInputValue; + oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue); + } + } + + if (changed) { + lastResult = parsedExpression(scope, undefined, undefined, oldInputValues); + } + + return lastResult; + }, listener, objectEquality, prettyPrintExpression); + } + + function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) { + var unwatch, lastValue; + return unwatch = scope.$watch(function oneTimeWatch(scope) { + return parsedExpression(scope); + }, function oneTimeListener(value, old, scope) { + lastValue = value; + if (isFunction(listener)) { + listener.apply(this, arguments); + } + if (isDefined(value)) { + scope.$$postDigest(function() { + if (isDefined(lastValue)) { + unwatch(); + } + }); + } + }, objectEquality); + } + + function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) { + var unwatch, lastValue; + return unwatch = scope.$watch(function oneTimeWatch(scope) { + return parsedExpression(scope); + }, function oneTimeListener(value, old, scope) { + lastValue = value; + if (isFunction(listener)) { + listener.call(this, value, old, scope); + } + if (isAllDefined(value)) { + scope.$$postDigest(function() { + if (isAllDefined(lastValue)) unwatch(); + }); + } + }, objectEquality); + + function isAllDefined(value) { + var allDefined = true; + forEach(value, function(val) { + if (!isDefined(val)) allDefined = false; + }); + return allDefined; + } + } + + function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) { + var unwatch; + return unwatch = scope.$watch(function constantWatch(scope) { + return parsedExpression(scope); + }, function constantListener(value, old, scope) { + if (isFunction(listener)) { + listener.apply(this, arguments); + } + unwatch(); + }, objectEquality); + } + + function addInterceptor(parsedExpression, interceptorFn) { + if (!interceptorFn) return parsedExpression; + var watchDelegate = parsedExpression.$$watchDelegate; + + var regularWatch = + watchDelegate !== oneTimeLiteralWatchDelegate && + watchDelegate !== oneTimeWatchDelegate; + + var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) { + var value = parsedExpression(scope, locals, assign, inputs); + return interceptorFn(value, scope, locals); + } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) { + var value = parsedExpression(scope, locals, assign, inputs); + var result = interceptorFn(value, scope, locals); + // we only return the interceptor's result if the + // initial value is defined (for bind-once) + return isDefined(value) ? result : value; + }; + + // Propagate $$watchDelegates other then inputsWatchDelegate + if (parsedExpression.$$watchDelegate && + parsedExpression.$$watchDelegate !== inputsWatchDelegate) { + fn.$$watchDelegate = parsedExpression.$$watchDelegate; + } else if (!interceptorFn.$stateful) { + // If there is an interceptor, but no watchDelegate then treat the interceptor like + // we treat filters - it is assumed to be a pure function unless flagged with $stateful + fn.$$watchDelegate = inputsWatchDelegate; + fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression]; + } + + return fn; + } + }]; + } + + /** + * @ngdoc service + * @name $q + * @requires $rootScope + * + * @description + * A service that helps you run functions asynchronously, and use their return values (or exceptions) + * when they are done processing. + * + * This is an implementation of promises/deferred objects inspired by + * [Kris Kowal's Q](https://github.com/kriskowal/q). + * + * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred + * implementations, and the other which resembles ES6 promises to some degree. + * + * # $q constructor + * + * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver` + * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony, + * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). + * + * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are + * available yet. + * + * It can be used like so: + * + * ```js + * // for the purpose of this example let's assume that variables `$q` and `okToGreet` + * // are available in the current lexical scope (they could have been injected or passed in). + * + * function asyncGreet(name) { + * // perform some asynchronous operation, resolve or reject the promise when appropriate. + * return $q(function(resolve, reject) { + * setTimeout(function() { + * if (okToGreet(name)) { + * resolve('Hello, ' + name + '!'); + * } else { + * reject('Greeting ' + name + ' is not allowed.'); + * } + * }, 1000); + * }); + * } + * + * var promise = asyncGreet('Robin Hood'); + * promise.then(function(greeting) { + * alert('Success: ' + greeting); + * }, function(reason) { + * alert('Failed: ' + reason); + * }); + * ``` + * + * Note: progress/notify callbacks are not currently supported via the ES6-style interface. + * + * However, the more traditional CommonJS-style usage is still available, and documented below. + * + * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an + * interface for interacting with an object that represents the result of an action that is + * performed asynchronously, and may or may not be finished at any given point in time. + * + * From the perspective of dealing with error handling, deferred and promise APIs are to + * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. + * + * ```js + * // for the purpose of this example let's assume that variables `$q` and `okToGreet` + * // are available in the current lexical scope (they could have been injected or passed in). + * + * function asyncGreet(name) { + * var deferred = $q.defer(); + * + * setTimeout(function() { + * deferred.notify('About to greet ' + name + '.'); + * + * if (okToGreet(name)) { + * deferred.resolve('Hello, ' + name + '!'); + * } else { + * deferred.reject('Greeting ' + name + ' is not allowed.'); + * } + * }, 1000); + * + * return deferred.promise; + * } + * + * var promise = asyncGreet('Robin Hood'); + * promise.then(function(greeting) { + * alert('Success: ' + greeting); + * }, function(reason) { + * alert('Failed: ' + reason); + * }, function(update) { + * alert('Got notification: ' + update); + * }); + * ``` + * + * At first it might not be obvious why this extra complexity is worth the trouble. The payoff + * comes in the way of guarantees that promise and deferred APIs make, see + * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md. + * + * Additionally the promise api allows for composition that is very hard to do with the + * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. + * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the + * section on serial or parallel joining of promises. + * + * # The Deferred API + * + * A new instance of deferred is constructed by calling `$q.defer()`. + * + * The purpose of the deferred object is to expose the associated Promise instance as well as APIs + * that can be used for signaling the successful or unsuccessful completion, as well as the status + * of the task. + * + * **Methods** + * + * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection + * constructed via `$q.reject`, the promise will be rejected instead. + * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to + * resolving it with a rejection constructed via `$q.reject`. + * - `notify(value)` - provides updates on the status of the promise's execution. This may be called + * multiple times before the promise is either resolved or rejected. + * + * **Properties** + * + * - promise – `{Promise}` – promise object associated with this deferred. + * + * + * # The Promise API + * + * A new promise instance is created when a deferred instance is created and can be retrieved by + * calling `deferred.promise`. + * + * The purpose of the promise object is to allow for interested parties to get access to the result + * of the deferred task when it completes. + * + * **Methods** + * + * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or + * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously + * as soon as the result is available. The callbacks are called with a single argument: the result + * or rejection reason. Additionally, the notify callback may be called zero or more times to + * provide a progress indication, before the promise is resolved or rejected. + * + * This method *returns a new promise* which is resolved or rejected via the return value of the + * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved + * with the value which is resolved in that promise using + * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)). + * It also notifies via the return value of the `notifyCallback` method. The promise cannot be + * resolved or rejected from the notifyCallback method. + * + * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)` + * + * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise, + * but to do so without modifying the final value. This is useful to release resources or do some + * clean-up that needs to be done whether the promise was rejected or resolved. See the [full + * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for + * more information. + * + * # Chaining promises + * + * Because calling the `then` method of a promise returns a new derived promise, it is easily + * possible to create a chain of promises: + * + * ```js + * promiseB = promiseA.then(function(result) { + * return result + 1; + * }); + * + * // promiseB will be resolved immediately after promiseA is resolved and its value + * // will be the result of promiseA incremented by 1 + * ``` + * + * It is possible to create chains of any length and since a promise can be resolved with another + * promise (which will defer its resolution further), it is possible to pause/defer resolution of + * the promises at any point in the chain. This makes it possible to implement powerful APIs like + * $http's response interceptors. + * + * + * # Differences between Kris Kowal's Q and $q + * + * There are two main differences: + * + * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation + * mechanism in angular, which means faster propagation of resolution or rejection into your + * models and avoiding unnecessary browser repaints, which would result in flickering UI. + * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains + * all the important functionality needed for common async tasks. + * + * # Testing + * + * ```js + * it('should simulate promise', inject(function($q, $rootScope) { + * var deferred = $q.defer(); + * var promise = deferred.promise; + * var resolvedValue; + * + * promise.then(function(value) { resolvedValue = value; }); + * expect(resolvedValue).toBeUndefined(); + * + * // Simulate resolving of promise + * deferred.resolve(123); + * // Note that the 'then' function does not get called synchronously. + * // This is because we want the promise API to always be async, whether or not + * // it got called synchronously or asynchronously. + * expect(resolvedValue).toBeUndefined(); + * + * // Propagate promise resolution to 'then' functions using $apply(). + * $rootScope.$apply(); + * expect(resolvedValue).toEqual(123); + * })); + * ``` + * + * @param {function(function, function)} resolver Function which is responsible for resolving or + * rejecting the newly created promise. The first parameter is a function which resolves the + * promise, the second parameter is a function which rejects the promise. + * + * @returns {Promise} The newly created promise. + */ + function $QProvider() { + + this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { + return qFactory(function(callback) { + $rootScope.$evalAsync(callback); + }, $exceptionHandler); + }]; + } + + function $$QProvider() { + this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) { + return qFactory(function(callback) { + $browser.defer(callback); + }, $exceptionHandler); + }]; + } + + /** + * Constructs a promise manager. + * + * @param {function(function)} nextTick Function for executing functions in the next turn. + * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for + * debugging purposes. + * @returns {object} Promise manager. + */ + function qFactory(nextTick, exceptionHandler) { + var $qMinErr = minErr('$q', TypeError); + function callOnce(self, resolveFn, rejectFn) { + var called = false; + function wrap(fn) { + return function(value) { + if (called) return; + called = true; + fn.call(self, value); + }; + } + + return [wrap(resolveFn), wrap(rejectFn)]; + } + + /** + * @ngdoc method + * @name ng.$q#defer + * @kind function + * + * @description + * Creates a `Deferred` object which represents a task which will finish in the future. + * + * @returns {Deferred} Returns a new instance of deferred. + */ + var defer = function() { + return new Deferred(); + }; + + function Promise() { + this.$$state = { status: 0 }; + } + + extend(Promise.prototype, { + then: function(onFulfilled, onRejected, progressBack) { + if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) { + return this; + } + var result = new Deferred(); + + this.$$state.pending = this.$$state.pending || []; + this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]); + if (this.$$state.status > 0) scheduleProcessQueue(this.$$state); + + return result.promise; + }, + + "catch": function(callback) { + return this.then(null, callback); + }, + + "finally": function(callback, progressBack) { + return this.then(function(value) { + return handleCallback(value, true, callback); + }, function(error) { + return handleCallback(error, false, callback); + }, progressBack); + } + }); + + //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native + function simpleBind(context, fn) { + return function(value) { + fn.call(context, value); + }; + } + + function processQueue(state) { + var fn, deferred, pending; + + pending = state.pending; + state.processScheduled = false; + state.pending = undefined; + for (var i = 0, ii = pending.length; i < ii; ++i) { + deferred = pending[i][0]; + fn = pending[i][state.status]; + try { + if (isFunction(fn)) { + deferred.resolve(fn(state.value)); + } else if (state.status === 1) { + deferred.resolve(state.value); + } else { + deferred.reject(state.value); + } + } catch (e) { + deferred.reject(e); + exceptionHandler(e); + } + } + } + + function scheduleProcessQueue(state) { + if (state.processScheduled || !state.pending) return; + state.processScheduled = true; + nextTick(function() { processQueue(state); }); + } + + function Deferred() { + this.promise = new Promise(); + //Necessary to support unbound execution :/ + this.resolve = simpleBind(this, this.resolve); + this.reject = simpleBind(this, this.reject); + this.notify = simpleBind(this, this.notify); + } + + extend(Deferred.prototype, { + resolve: function(val) { + if (this.promise.$$state.status) return; + if (val === this.promise) { + this.$$reject($qMinErr( + 'qcycle', + "Expected promise to be resolved with value other than itself '{0}'", + val)); + } else { + this.$$resolve(val); + } + + }, + + $$resolve: function(val) { + var then, fns; + + fns = callOnce(this, this.$$resolve, this.$$reject); + try { + if ((isObject(val) || isFunction(val))) then = val && val.then; + if (isFunction(then)) { + this.promise.$$state.status = -1; + then.call(val, fns[0], fns[1], this.notify); + } else { + this.promise.$$state.value = val; + this.promise.$$state.status = 1; + scheduleProcessQueue(this.promise.$$state); + } + } catch (e) { + fns[1](e); + exceptionHandler(e); + } + }, + + reject: function(reason) { + if (this.promise.$$state.status) return; + this.$$reject(reason); + }, + + $$reject: function(reason) { + this.promise.$$state.value = reason; + this.promise.$$state.status = 2; + scheduleProcessQueue(this.promise.$$state); + }, + + notify: function(progress) { + var callbacks = this.promise.$$state.pending; + + if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) { + nextTick(function() { + var callback, result; + for (var i = 0, ii = callbacks.length; i < ii; i++) { + result = callbacks[i][0]; + callback = callbacks[i][3]; + try { + result.notify(isFunction(callback) ? callback(progress) : progress); + } catch (e) { + exceptionHandler(e); + } + } + }); + } + } + }); + + /** + * @ngdoc method + * @name $q#reject + * @kind function + * + * @description + * Creates a promise that is resolved as rejected with the specified `reason`. This api should be + * used to forward rejection in a chain of promises. If you are dealing with the last promise in + * a promise chain, you don't need to worry about it. + * + * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of + * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via + * a promise error callback and you want to forward the error to the promise derived from the + * current promise, you have to "rethrow" the error by returning a rejection constructed via + * `reject`. + * + * ```js + * promiseB = promiseA.then(function(result) { + * // success: do something and resolve promiseB + * // with the old or a new result + * return result; + * }, function(reason) { + * // error: handle the error if possible and + * // resolve promiseB with newPromiseOrValue, + * // otherwise forward the rejection to promiseB + * if (canHandle(reason)) { + * // handle the error and recover + * return newPromiseOrValue; + * } + * return $q.reject(reason); + * }); + * ``` + * + * @param {*} reason Constant, message, exception or an object representing the rejection reason. + * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`. + */ + var reject = function(reason) { + var result = new Deferred(); + result.reject(reason); + return result.promise; + }; + + var makePromise = function makePromise(value, resolved) { + var result = new Deferred(); + if (resolved) { + result.resolve(value); + } else { + result.reject(value); + } + return result.promise; + }; + + var handleCallback = function handleCallback(value, isResolved, callback) { + var callbackOutput = null; + try { + if (isFunction(callback)) callbackOutput = callback(); + } catch (e) { + return makePromise(e, false); + } + if (isPromiseLike(callbackOutput)) { + return callbackOutput.then(function() { + return makePromise(value, isResolved); + }, function(error) { + return makePromise(error, false); + }); + } else { + return makePromise(value, isResolved); + } + }; + + /** + * @ngdoc method + * @name $q#when + * @kind function + * + * @description + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. + * This is useful when you are dealing with an object that might or might not be a promise, or if + * the promise comes from a source that can't be trusted. + * + * @param {*} value Value or a promise + * @param {Function=} successCallback + * @param {Function=} errorCallback + * @param {Function=} progressCallback + * @returns {Promise} Returns a promise of the passed value or promise + */ + + + var when = function(value, callback, errback, progressBack) { + var result = new Deferred(); + result.resolve(value); + return result.promise.then(callback, errback, progressBack); + }; + + /** + * @ngdoc method + * @name $q#resolve + * @kind function + * + * @description + * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6. + * + * @param {*} value Value or a promise + * @param {Function=} successCallback + * @param {Function=} errorCallback + * @param {Function=} progressCallback + * @returns {Promise} Returns a promise of the passed value or promise + */ + var resolve = when; + + /** + * @ngdoc method + * @name $q#all + * @kind function + * + * @description + * Combines multiple promises into a single promise that is resolved when all of the input + * promises are resolved. + * + * @param {Array.|Object.} promises An array or hash of promises. + * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, + * each value corresponding to the promise at the same index/key in the `promises` array/hash. + * If any of the promises is resolved with a rejection, this resulting promise will be rejected + * with the same rejection value. + */ + + function all(promises) { + var deferred = new Deferred(), + counter = 0, + results = isArray(promises) ? [] : {}; + + forEach(promises, function(promise, key) { + counter++; + when(promise).then(function(value) { + if (results.hasOwnProperty(key)) return; + results[key] = value; + if (!(--counter)) deferred.resolve(results); + }, function(reason) { + if (results.hasOwnProperty(key)) return; + deferred.reject(reason); + }); + }); + + if (counter === 0) { + deferred.resolve(results); + } + + return deferred.promise; + } + + var $Q = function Q(resolver) { + if (!isFunction(resolver)) { + throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver); + } + + if (!(this instanceof Q)) { + // More useful when $Q is the Promise itself. + return new Q(resolver); + } + + var deferred = new Deferred(); + + function resolveFn(value) { + deferred.resolve(value); + } + + function rejectFn(reason) { + deferred.reject(reason); + } + + resolver(resolveFn, rejectFn); + + return deferred.promise; + }; + + $Q.defer = defer; + $Q.reject = reject; + $Q.when = when; + $Q.resolve = resolve; + $Q.all = all; + + return $Q; + } + + function $$RAFProvider() { //rAF + this.$get = ['$window', '$timeout', function($window, $timeout) { + var requestAnimationFrame = $window.requestAnimationFrame || + $window.webkitRequestAnimationFrame; + + var cancelAnimationFrame = $window.cancelAnimationFrame || + $window.webkitCancelAnimationFrame || + $window.webkitCancelRequestAnimationFrame; + + var rafSupported = !!requestAnimationFrame; + var raf = rafSupported + ? function(fn) { + var id = requestAnimationFrame(fn); + return function() { + cancelAnimationFrame(id); + }; + } + : function(fn) { + var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666 + return function() { + $timeout.cancel(timer); + }; + }; + + raf.supported = rafSupported; + + return raf; + }]; + } + + /** + * DESIGN NOTES + * + * The design decisions behind the scope are heavily favored for speed and memory consumption. + * + * The typical use of scope is to watch the expressions, which most of the time return the same + * value as last time so we optimize the operation. + * + * Closures construction is expensive in terms of speed as well as memory: + * - No closures, instead use prototypical inheritance for API + * - Internal state needs to be stored on scope directly, which means that private state is + * exposed as $$____ properties + * + * Loop operations are optimized by using while(count--) { ... } + * - this means that in order to keep the same order of execution as addition we have to add + * items to the array at the beginning (unshift) instead of at the end (push) + * + * Child scopes are created and removed often + * - Using an array would be slow since inserts in middle are expensive so we use linked list + * + * There are few watches then a lot of observers. This is why you don't want the observer to be + * implemented in the same way as watch. Watch requires return of initialization function which + * are expensive to construct. + */ + + + /** + * @ngdoc provider + * @name $rootScopeProvider + * @description + * + * Provider for the $rootScope service. + */ + + /** + * @ngdoc method + * @name $rootScopeProvider#digestTtl + * @description + * + * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and + * assuming that the model is unstable. + * + * The current default is 10 iterations. + * + * In complex applications it's possible that the dependencies between `$watch`s will result in + * several digest iterations. However if an application needs more than the default 10 digest + * iterations for its model to stabilize then you should investigate what is causing the model to + * continuously change during the digest. + * + * Increasing the TTL could have performance implications, so you should not change it without + * proper justification. + * + * @param {number} limit The number of digest iterations. + */ + + + /** + * @ngdoc service + * @name $rootScope + * @description + * + * Every application has a single root {@link ng.$rootScope.Scope scope}. + * All other scopes are descendant scopes of the root scope. Scopes provide separation + * between the model and the view, via a mechanism for watching the model for changes. + * They also provide an event emission/broadcast and subscription facility. See the + * {@link guide/scope developer guide on scopes}. + */ + function $RootScopeProvider() { + var TTL = 10; + var $rootScopeMinErr = minErr('$rootScope'); + var lastDirtyWatch = null; + var applyAsyncId = null; + + this.digestTtl = function(value) { + if (arguments.length) { + TTL = value; + } + return TTL; + }; + + function createChildScopeClass(parent) { + function ChildScope() { + this.$$watchers = this.$$nextSibling = + this.$$childHead = this.$$childTail = null; + this.$$listeners = {}; + this.$$listenerCount = {}; + this.$$watchersCount = 0; + this.$id = nextUid(); + this.$$ChildScope = null; + } + ChildScope.prototype = parent; + return ChildScope; + } + + this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser', + function($injector, $exceptionHandler, $parse, $browser) { + + function destroyChildScope($event) { + $event.currentScope.$$destroyed = true; + } + + /** + * @ngdoc type + * @name $rootScope.Scope + * + * @description + * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the + * {@link auto.$injector $injector}. Child scopes are created using the + * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when + * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for + * an in-depth introduction and usage examples. + * + * + * # Inheritance + * A scope can inherit from a parent scope, as in this example: + * ```js + var parent = $rootScope; + var child = parent.$new(); + + parent.salutation = "Hello"; + expect(child.salutation).toEqual('Hello'); + + child.salutation = "Welcome"; + expect(child.salutation).toEqual('Welcome'); + expect(parent.salutation).toEqual('Hello'); + * ``` + * + * When interacting with `Scope` in tests, additional helper methods are available on the + * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional + * details. + * + * + * @param {Object.=} providers Map of service factory which need to be + * provided for the current scope. Defaults to {@link ng}. + * @param {Object.=} instanceCache Provides pre-instantiated services which should + * append/override services provided by `providers`. This is handy + * when unit-testing and having the need to override a default + * service. + * @returns {Object} Newly created scope. + * + */ + function Scope() { + this.$id = nextUid(); + this.$$phase = this.$parent = this.$$watchers = + this.$$nextSibling = this.$$prevSibling = + this.$$childHead = this.$$childTail = null; + this.$root = this; + this.$$destroyed = false; + this.$$listeners = {}; + this.$$listenerCount = {}; + this.$$watchersCount = 0; + this.$$isolateBindings = null; + } + + /** + * @ngdoc property + * @name $rootScope.Scope#$id + * + * @description + * Unique scope ID (monotonically increasing) useful for debugging. + */ + + /** + * @ngdoc property + * @name $rootScope.Scope#$parent + * + * @description + * Reference to the parent scope. + */ + + /** + * @ngdoc property + * @name $rootScope.Scope#$root + * + * @description + * Reference to the root scope. + */ + + Scope.prototype = { + constructor: Scope, + /** + * @ngdoc method + * @name $rootScope.Scope#$new + * @kind function + * + * @description + * Creates a new child {@link ng.$rootScope.Scope scope}. + * + * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event. + * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. + * + * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is + * desired for the scope and its child scopes to be permanently detached from the parent and + * thus stop participating in model change detection and listener notification by invoking. + * + * @param {boolean} isolate If true, then the scope does not prototypically inherit from the + * parent scope. The scope is isolated, as it can not see parent scope properties. + * When creating widgets, it is useful for the widget to not accidentally read parent + * state. + * + * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent` + * of the newly created scope. Defaults to `this` scope if not provided. + * This is used when creating a transclude scope to correctly place it + * in the scope hierarchy while maintaining the correct prototypical + * inheritance. + * + * @returns {Object} The newly created child scope. + * + */ + $new: function(isolate, parent) { + var child; + + parent = parent || this; + + if (isolate) { + child = new Scope(); + child.$root = this.$root; + } else { + // Only create a child scope class if somebody asks for one, + // but cache it to allow the VM to optimize lookups. + if (!this.$$ChildScope) { + this.$$ChildScope = createChildScopeClass(this); + } + child = new this.$$ChildScope(); + } + child.$parent = parent; + child.$$prevSibling = parent.$$childTail; + if (parent.$$childHead) { + parent.$$childTail.$$nextSibling = child; + parent.$$childTail = child; + } else { + parent.$$childHead = parent.$$childTail = child; + } + + // When the new scope is not isolated or we inherit from `this`, and + // the parent scope is destroyed, the property `$$destroyed` is inherited + // prototypically. In all other cases, this property needs to be set + // when the parent scope is destroyed. + // The listener needs to be added after the parent is set + if (isolate || parent != this) child.$on('$destroy', destroyChildScope); + + return child; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$watch + * @kind function + * + * @description + * Registers a `listener` callback to be executed whenever the `watchExpression` changes. + * + * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest + * $digest()} and should return the value that will be watched. (`watchExpression` should not change + * its value when executed multiple times with the same input because it may be executed multiple + * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be + * [idempotent](http://en.wikipedia.org/wiki/Idempotence). + * - The `listener` is called only when the value from the current `watchExpression` and the + * previous call to `watchExpression` are not equal (with the exception of the initial run, + * see below). Inequality is determined according to reference inequality, + * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators) + * via the `!==` Javascript operator, unless `objectEquality == true` + * (see next point) + * - When `objectEquality == true`, inequality of the `watchExpression` is determined + * according to the {@link angular.equals} function. To save the value of the object for + * later comparison, the {@link angular.copy} function is used. This therefore means that + * watching complex objects will have adverse memory and performance implications. + * - The watch `listener` may change the model, which may trigger other `listener`s to fire. + * This is achieved by rerunning the watchers until no changes are detected. The rerun + * iteration limit is 10 to prevent an infinite loop deadlock. + * + * + * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, + * you can register a `watchExpression` function with no `listener`. (Be prepared for + * multiple calls to your `watchExpression` because it will execute multiple times in a + * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.) + * + * After a watcher is registered with the scope, the `listener` fn is called asynchronously + * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the + * watcher. In rare cases, this is undesirable because the listener is called when the result + * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you + * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the + * listener was called due to initialization. + * + * + * + * # Example + * ```js + // let's assume that scope was dependency injected as the $rootScope + var scope = $rootScope; + scope.name = 'misko'; + scope.counter = 0; + + expect(scope.counter).toEqual(0); + scope.$watch('name', function(newValue, oldValue) { + scope.counter = scope.counter + 1; + }); + expect(scope.counter).toEqual(0); + + scope.$digest(); + // the listener is always called during the first $digest loop after it was registered + expect(scope.counter).toEqual(1); + + scope.$digest(); + // but now it will not be called unless the value changes + expect(scope.counter).toEqual(1); + + scope.name = 'adam'; + scope.$digest(); + expect(scope.counter).toEqual(2); + + + + // Using a function as a watchExpression + var food; + scope.foodCounter = 0; + expect(scope.foodCounter).toEqual(0); + scope.$watch( + // This function returns the value being watched. It is called for each turn of the $digest loop + function() { return food; }, + // This is the change listener, called when the value returned from the above function changes + function(newValue, oldValue) { + if ( newValue !== oldValue ) { + // Only increment the counter if the value changed + scope.foodCounter = scope.foodCounter + 1; + } + } + ); + // No digest has been run so the counter will be zero + expect(scope.foodCounter).toEqual(0); + + // Run the digest but since food has not changed count will still be zero + scope.$digest(); + expect(scope.foodCounter).toEqual(0); + + // Update food and run digest. Now the counter will increment + food = 'cheeseburger'; + scope.$digest(); + expect(scope.foodCounter).toEqual(1); + + * ``` + * + * + * + * @param {(function()|string)} watchExpression Expression that is evaluated on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers + * a call to the `listener`. + * + * - `string`: Evaluated as {@link guide/expression expression} + * - `function(scope)`: called with current `scope` as a parameter. + * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value + * of `watchExpression` changes. + * + * - `newVal` contains the current value of the `watchExpression` + * - `oldVal` contains the previous value of the `watchExpression` + * - `scope` refers to the current scope + * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of + * comparing for reference equality. + * @returns {function()} Returns a deregistration function for this listener. + */ + $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) { + var get = $parse(watchExp); + + if (get.$$watchDelegate) { + return get.$$watchDelegate(this, listener, objectEquality, get, watchExp); + } + var scope = this, + array = scope.$$watchers, + watcher = { + fn: listener, + last: initWatchVal, + get: get, + exp: prettyPrintExpression || watchExp, + eq: !!objectEquality + }; + + lastDirtyWatch = null; + + if (!isFunction(listener)) { + watcher.fn = noop; + } + + if (!array) { + array = scope.$$watchers = []; + } + // we use unshift since we use a while loop in $digest for speed. + // the while loop reads in reverse order. + array.unshift(watcher); + incrementWatchersCount(this, 1); + + return function deregisterWatch() { + if (arrayRemove(array, watcher) >= 0) { + incrementWatchersCount(scope, -1); + } + lastDirtyWatch = null; + }; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$watchGroup + * @kind function + * + * @description + * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`. + * If any one expression in the collection changes the `listener` is executed. + * + * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every + * call to $digest() to see if any items changes. + * - The `listener` is called whenever any expression in the `watchExpressions` array changes. + * + * @param {Array.} watchExpressions Array of expressions that will be individually + * watched using {@link ng.$rootScope.Scope#$watch $watch()} + * + * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any + * expression in `watchExpressions` changes + * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching + * those of `watchExpression` + * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching + * those of `watchExpression` + * The `scope` refers to the current scope. + * @returns {function()} Returns a de-registration function for all listeners. + */ + $watchGroup: function(watchExpressions, listener) { + var oldValues = new Array(watchExpressions.length); + var newValues = new Array(watchExpressions.length); + var deregisterFns = []; + var self = this; + var changeReactionScheduled = false; + var firstRun = true; + + if (!watchExpressions.length) { + // No expressions means we call the listener ASAP + var shouldCall = true; + self.$evalAsync(function() { + if (shouldCall) listener(newValues, newValues, self); + }); + return function deregisterWatchGroup() { + shouldCall = false; + }; + } + + if (watchExpressions.length === 1) { + // Special case size of one + return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) { + newValues[0] = value; + oldValues[0] = oldValue; + listener(newValues, (value === oldValue) ? newValues : oldValues, scope); + }); + } + + forEach(watchExpressions, function(expr, i) { + var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) { + newValues[i] = value; + oldValues[i] = oldValue; + if (!changeReactionScheduled) { + changeReactionScheduled = true; + self.$evalAsync(watchGroupAction); + } + }); + deregisterFns.push(unwatchFn); + }); + + function watchGroupAction() { + changeReactionScheduled = false; + + if (firstRun) { + firstRun = false; + listener(newValues, newValues, self); + } else { + listener(newValues, oldValues, self); + } + } + + return function deregisterWatchGroup() { + while (deregisterFns.length) { + deregisterFns.shift()(); + } + }; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$watchCollection + * @kind function + * + * @description + * Shallow watches the properties of an object and fires whenever any of the properties change + * (for arrays, this implies watching the array items; for object maps, this implies watching + * the properties). If a change is detected, the `listener` callback is fired. + * + * - The `obj` collection is observed via standard $watch operation and is examined on every + * call to $digest() to see if any items have been added, removed, or moved. + * - The `listener` is called whenever anything within the `obj` has changed. Examples include + * adding, removing, and moving items belonging to an object or array. + * + * + * # Example + * ```js + $scope.names = ['igor', 'matias', 'misko', 'james']; + $scope.dataCount = 4; + + $scope.$watchCollection('names', function(newNames, oldNames) { + $scope.dataCount = newNames.length; + }); + + expect($scope.dataCount).toEqual(4); + $scope.$digest(); + + //still at 4 ... no changes + expect($scope.dataCount).toEqual(4); + + $scope.names.pop(); + $scope.$digest(); + + //now there's been a change + expect($scope.dataCount).toEqual(3); + * ``` + * + * + * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The + * expression value should evaluate to an object or an array which is observed on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the + * collection will trigger a call to the `listener`. + * + * @param {function(newCollection, oldCollection, scope)} listener a callback function called + * when a change is detected. + * - The `newCollection` object is the newly modified data obtained from the `obj` expression + * - The `oldCollection` object is a copy of the former collection data. + * Due to performance considerations, the`oldCollection` value is computed only if the + * `listener` function declares two or more arguments. + * - The `scope` argument refers to the current scope. + * + * @returns {function()} Returns a de-registration function for this listener. When the + * de-registration function is executed, the internal watch operation is terminated. + */ + $watchCollection: function(obj, listener) { + $watchCollectionInterceptor.$stateful = true; + + var self = this; + // the current value, updated on each dirty-check run + var newValue; + // a shallow copy of the newValue from the last dirty-check run, + // updated to match newValue during dirty-check run + var oldValue; + // a shallow copy of the newValue from when the last change happened + var veryOldValue; + // only track veryOldValue if the listener is asking for it + var trackVeryOldValue = (listener.length > 1); + var changeDetected = 0; + var changeDetector = $parse(obj, $watchCollectionInterceptor); + var internalArray = []; + var internalObject = {}; + var initRun = true; + var oldLength = 0; + + function $watchCollectionInterceptor(_value) { + newValue = _value; + var newLength, key, bothNaN, newItem, oldItem; + + // If the new value is undefined, then return undefined as the watch may be a one-time watch + if (isUndefined(newValue)) return; + + if (!isObject(newValue)) { // if primitive + if (oldValue !== newValue) { + oldValue = newValue; + changeDetected++; + } + } else if (isArrayLike(newValue)) { + if (oldValue !== internalArray) { + // we are transitioning from something which was not an array into array. + oldValue = internalArray; + oldLength = oldValue.length = 0; + changeDetected++; + } + + newLength = newValue.length; + + if (oldLength !== newLength) { + // if lengths do not match we need to trigger change notification + changeDetected++; + oldValue.length = oldLength = newLength; + } + // copy the items to oldValue and look for changes. + for (var i = 0; i < newLength; i++) { + oldItem = oldValue[i]; + newItem = newValue[i]; + + bothNaN = (oldItem !== oldItem) && (newItem !== newItem); + if (!bothNaN && (oldItem !== newItem)) { + changeDetected++; + oldValue[i] = newItem; + } + } + } else { + if (oldValue !== internalObject) { + // we are transitioning from something which was not an object into object. + oldValue = internalObject = {}; + oldLength = 0; + changeDetected++; + } + // copy the items to oldValue and look for changes. + newLength = 0; + for (key in newValue) { + if (hasOwnProperty.call(newValue, key)) { + newLength++; + newItem = newValue[key]; + oldItem = oldValue[key]; + + if (key in oldValue) { + bothNaN = (oldItem !== oldItem) && (newItem !== newItem); + if (!bothNaN && (oldItem !== newItem)) { + changeDetected++; + oldValue[key] = newItem; + } + } else { + oldLength++; + oldValue[key] = newItem; + changeDetected++; + } + } + } + if (oldLength > newLength) { + // we used to have more keys, need to find them and destroy them. + changeDetected++; + for (key in oldValue) { + if (!hasOwnProperty.call(newValue, key)) { + oldLength--; + delete oldValue[key]; + } + } + } + } + return changeDetected; + } + + function $watchCollectionAction() { + if (initRun) { + initRun = false; + listener(newValue, newValue, self); + } else { + listener(newValue, veryOldValue, self); + } + + // make a copy for the next time a collection is changed + if (trackVeryOldValue) { + if (!isObject(newValue)) { + //primitive + veryOldValue = newValue; + } else if (isArrayLike(newValue)) { + veryOldValue = new Array(newValue.length); + for (var i = 0; i < newValue.length; i++) { + veryOldValue[i] = newValue[i]; + } + } else { // if object + veryOldValue = {}; + for (var key in newValue) { + if (hasOwnProperty.call(newValue, key)) { + veryOldValue[key] = newValue[key]; + } + } + } + } + } + + return this.$watch(changeDetector, $watchCollectionAction); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$digest + * @kind function + * + * @description + * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and + * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change + * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} + * until no more listeners are firing. This means that it is possible to get into an infinite + * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of + * iterations exceeds 10. + * + * Usually, you don't call `$digest()` directly in + * {@link ng.directive:ngController controllers} or in + * {@link ng.$compileProvider#directive directives}. + * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within + * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`. + * + * If you want to be notified whenever `$digest()` is called, + * you can register a `watchExpression` function with + * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`. + * + * In unit tests, you may need to call `$digest()` to simulate the scope life cycle. + * + * # Example + * ```js + var scope = ...; + scope.name = 'misko'; + scope.counter = 0; + + expect(scope.counter).toEqual(0); + scope.$watch('name', function(newValue, oldValue) { + scope.counter = scope.counter + 1; + }); + expect(scope.counter).toEqual(0); + + scope.$digest(); + // the listener is always called during the first $digest loop after it was registered + expect(scope.counter).toEqual(1); + + scope.$digest(); + // but now it will not be called unless the value changes + expect(scope.counter).toEqual(1); + + scope.name = 'adam'; + scope.$digest(); + expect(scope.counter).toEqual(2); + * ``` + * + */ + $digest: function() { + var watch, value, last, + watchers, + length, + dirty, ttl = TTL, + next, current, target = this, + watchLog = [], + logIdx, logMsg, asyncTask; + + beginPhase('$digest'); + // Check for changes to browser url that happened in sync before the call to $digest + $browser.$$checkUrlChange(); + + if (this === $rootScope && applyAsyncId !== null) { + // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then + // cancel the scheduled $apply and flush the queue of expressions to be evaluated. + $browser.defer.cancel(applyAsyncId); + flushApplyAsync(); + } + + lastDirtyWatch = null; + + do { // "while dirty" loop + dirty = false; + current = target; + + while (asyncQueue.length) { + try { + asyncTask = asyncQueue.shift(); + asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals); + } catch (e) { + $exceptionHandler(e); + } + lastDirtyWatch = null; + } + + traverseScopesLoop: + do { // "traverse the scopes" loop + if ((watchers = current.$$watchers)) { + // process our watches + length = watchers.length; + while (length--) { + try { + watch = watchers[length]; + // Most common watches are on primitives, in which case we can short + // circuit it with === operator, only when === fails do we use .equals + if (watch) { + if ((value = watch.get(current)) !== (last = watch.last) && + !(watch.eq + ? equals(value, last) + : (typeof value === 'number' && typeof last === 'number' + && isNaN(value) && isNaN(last)))) { + dirty = true; + lastDirtyWatch = watch; + watch.last = watch.eq ? copy(value, null) : value; + watch.fn(value, ((last === initWatchVal) ? value : last), current); + if (ttl < 5) { + logIdx = 4 - ttl; + if (!watchLog[logIdx]) watchLog[logIdx] = []; + watchLog[logIdx].push({ + msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp, + newVal: value, + oldVal: last + }); + } + } else if (watch === lastDirtyWatch) { + // If the most recently dirty watcher is now clean, short circuit since the remaining watchers + // have already been tested. + dirty = false; + break traverseScopesLoop; + } + } + } catch (e) { + $exceptionHandler(e); + } + } + } + + // Insanity Warning: scope depth-first traversal + // yes, this code is a bit crazy, but it works and we have tests to prove it! + // this piece should be kept in sync with the traversal in $broadcast + if (!(next = ((current.$$watchersCount && current.$$childHead) || + (current !== target && current.$$nextSibling)))) { + while (current !== target && !(next = current.$$nextSibling)) { + current = current.$parent; + } + } + } while ((current = next)); + + // `break traverseScopesLoop;` takes us to here + + if ((dirty || asyncQueue.length) && !(ttl--)) { + clearPhase(); + throw $rootScopeMinErr('infdig', + '{0} $digest() iterations reached. Aborting!\n' + + 'Watchers fired in the last 5 iterations: {1}', + TTL, watchLog); + } + + } while (dirty || asyncQueue.length); + + clearPhase(); + + while (postDigestQueue.length) { + try { + postDigestQueue.shift()(); + } catch (e) { + $exceptionHandler(e); + } + } + }, + + + /** + * @ngdoc event + * @name $rootScope.Scope#$destroy + * @eventType broadcast on scope being destroyed + * + * @description + * Broadcasted when a scope and its children are being destroyed. + * + * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to + * clean up DOM bindings before an element is removed from the DOM. + */ + + /** + * @ngdoc method + * @name $rootScope.Scope#$destroy + * @kind function + * + * @description + * Removes the current scope (and all of its children) from the parent scope. Removal implies + * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer + * propagate to the current scope and its children. Removal also implies that the current + * scope is eligible for garbage collection. + * + * The `$destroy()` is usually used by directives such as + * {@link ng.directive:ngRepeat ngRepeat} for managing the + * unrolling of the loop. + * + * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. + * Application code can register a `$destroy` event handler that will give it a chance to + * perform any necessary cleanup. + * + * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to + * clean up DOM bindings before an element is removed from the DOM. + */ + $destroy: function() { + // We can't destroy a scope that has been already destroyed. + if (this.$$destroyed) return; + var parent = this.$parent; + + this.$broadcast('$destroy'); + this.$$destroyed = true; + + if (this === $rootScope) { + //Remove handlers attached to window when $rootScope is removed + $browser.$$applicationDestroyed(); + } + + incrementWatchersCount(this, -this.$$watchersCount); + for (var eventName in this.$$listenerCount) { + decrementListenerCount(this, this.$$listenerCount[eventName], eventName); + } + + // sever all the references to parent scopes (after this cleanup, the current scope should + // not be retained by any of our references and should be eligible for garbage collection) + if (parent && parent.$$childHead == this) parent.$$childHead = this.$$nextSibling; + if (parent && parent.$$childTail == this) parent.$$childTail = this.$$prevSibling; + if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling; + if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling; + + // Disable listeners, watchers and apply/digest methods + this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop; + this.$on = this.$watch = this.$watchGroup = function() { return noop; }; + this.$$listeners = {}; + + // All of the code below is bogus code that works around V8's memory leak via optimized code + // and inline caches. + // + // see: + // - https://code.google.com/p/v8/issues/detail?id=2073#c26 + // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909 + // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 + + this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = + this.$$childTail = this.$root = this.$$watchers = null; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$eval + * @kind function + * + * @description + * Executes the `expression` on the current scope and returns the result. Any exceptions in + * the expression are propagated (uncaught). This is useful when evaluating Angular + * expressions. + * + * # Example + * ```js + var scope = ng.$rootScope.Scope(); + scope.a = 1; + scope.b = 2; + + expect(scope.$eval('a+b')).toEqual(3); + expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3); + * ``` + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + * @param {(object)=} locals Local variables object, useful for overriding values in scope. + * @returns {*} The result of evaluating the expression. + */ + $eval: function(expr, locals) { + return $parse(expr)(this, locals); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$evalAsync + * @kind function + * + * @description + * Executes the expression on the current scope at a later point in time. + * + * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only + * that: + * + * - it will execute after the function that scheduled the evaluation (preferably before DOM + * rendering). + * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after + * `expression` execution. + * + * Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle + * will be scheduled. However, it is encouraged to always call code that changes the model + * from within an `$apply` call. That includes code evaluated via `$evalAsync`. + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + * @param {(object)=} locals Local variables object, useful for overriding values in scope. + */ + $evalAsync: function(expr, locals) { + // if we are outside of an $digest loop and this is the first time we are scheduling async + // task also schedule async auto-flush + if (!$rootScope.$$phase && !asyncQueue.length) { + $browser.defer(function() { + if (asyncQueue.length) { + $rootScope.$digest(); + } + }); + } + + asyncQueue.push({scope: this, expression: expr, locals: locals}); + }, + + $$postDigest: function(fn) { + postDigestQueue.push(fn); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$apply + * @kind function + * + * @description + * `$apply()` is used to execute an expression in angular from outside of the angular + * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). + * Because we are calling into the angular framework we need to perform proper scope life + * cycle of {@link ng.$exceptionHandler exception handling}, + * {@link ng.$rootScope.Scope#$digest executing watches}. + * + * ## Life cycle + * + * # Pseudo-Code of `$apply()` + * ```js + function $apply(expr) { + try { + return $eval(expr); + } catch (e) { + $exceptionHandler(e); + } finally { + $root.$digest(); + } + } + * ``` + * + * + * Scope's `$apply()` method transitions through the following stages: + * + * 1. The {@link guide/expression expression} is executed using the + * {@link ng.$rootScope.Scope#$eval $eval()} method. + * 2. Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the + * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. + * + * + * @param {(string|function())=} exp An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with current `scope` parameter. + * + * @returns {*} The result of evaluating the expression. + */ + $apply: function(expr) { + try { + beginPhase('$apply'); + try { + return this.$eval(expr); + } finally { + clearPhase(); + } + } catch (e) { + $exceptionHandler(e); + } finally { + try { + $rootScope.$digest(); + } catch (e) { + $exceptionHandler(e); + throw e; + } + } + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$applyAsync + * @kind function + * + * @description + * Schedule the invocation of $apply to occur at a later time. The actual time difference + * varies across browsers, but is typically around ~10 milliseconds. + * + * This can be used to queue up multiple expressions which need to be evaluated in the same + * digest. + * + * @param {(string|function())=} exp An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with current `scope` parameter. + */ + $applyAsync: function(expr) { + var scope = this; + expr && applyAsyncQueue.push($applyAsyncExpression); + scheduleApplyAsync(); + + function $applyAsyncExpression() { + scope.$eval(expr); + } + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$on + * @kind function + * + * @description + * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for + * discussion of event life cycle. + * + * The event listener function format is: `function(event, args...)`. The `event` object + * passed into the listener has the following attributes: + * + * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or + * `$broadcast`-ed. + * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the + * event propagates through the scope hierarchy, this property is set to null. + * - `name` - `{string}`: name of the event. + * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel + * further event propagation (available only for events that were `$emit`-ed). + * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag + * to true. + * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called. + * + * @param {string} name Event name to listen on. + * @param {function(event, ...args)} listener Function to call when the event is emitted. + * @returns {function()} Returns a deregistration function for this listener. + */ + $on: function(name, listener) { + var namedListeners = this.$$listeners[name]; + if (!namedListeners) { + this.$$listeners[name] = namedListeners = []; + } + namedListeners.push(listener); + + var current = this; + do { + if (!current.$$listenerCount[name]) { + current.$$listenerCount[name] = 0; + } + current.$$listenerCount[name]++; + } while ((current = current.$parent)); + + var self = this; + return function() { + var indexOfListener = namedListeners.indexOf(listener); + if (indexOfListener !== -1) { + namedListeners[indexOfListener] = null; + decrementListenerCount(self, 1, name); + } + }; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$emit + * @kind function + * + * @description + * Dispatches an event `name` upwards through the scope hierarchy notifying the + * registered {@link ng.$rootScope.Scope#$on} listeners. + * + * The event life cycle starts at the scope on which `$emit` was called. All + * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get + * notified. Afterwards, the event traverses upwards toward the root scope and calls all + * registered listeners along the way. The event will stop propagating if one of the listeners + * cancels it. + * + * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed + * onto the {@link ng.$exceptionHandler $exceptionHandler} service. + * + * @param {string} name Event name to emit. + * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. + * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}). + */ + $emit: function(name, args) { + var empty = [], + namedListeners, + scope = this, + stopPropagation = false, + event = { + name: name, + targetScope: scope, + stopPropagation: function() {stopPropagation = true;}, + preventDefault: function() { + event.defaultPrevented = true; + }, + defaultPrevented: false + }, + listenerArgs = concat([event], arguments, 1), + i, length; + + do { + namedListeners = scope.$$listeners[name] || empty; + event.currentScope = scope; + for (i = 0, length = namedListeners.length; i < length; i++) { + + // if listeners were deregistered, defragment the array + if (!namedListeners[i]) { + namedListeners.splice(i, 1); + i--; + length--; + continue; + } + try { + //allow all listeners attached to the current scope to run + namedListeners[i].apply(null, listenerArgs); + } catch (e) { + $exceptionHandler(e); + } + } + //if any listener on the current scope stops propagation, prevent bubbling + if (stopPropagation) { + event.currentScope = null; + return event; + } + //traverse upwards + scope = scope.$parent; + } while (scope); + + event.currentScope = null; + + return event; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$broadcast + * @kind function + * + * @description + * Dispatches an event `name` downwards to all child scopes (and their children) notifying the + * registered {@link ng.$rootScope.Scope#$on} listeners. + * + * The event life cycle starts at the scope on which `$broadcast` was called. All + * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get + * notified. Afterwards, the event propagates to all direct and indirect scopes of the current + * scope and calls all registered listeners along the way. The event cannot be canceled. + * + * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed + * onto the {@link ng.$exceptionHandler $exceptionHandler} service. + * + * @param {string} name Event name to broadcast. + * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. + * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on} + */ + $broadcast: function(name, args) { + var target = this, + current = target, + next = target, + event = { + name: name, + targetScope: target, + preventDefault: function() { + event.defaultPrevented = true; + }, + defaultPrevented: false + }; + + if (!target.$$listenerCount[name]) return event; + + var listenerArgs = concat([event], arguments, 1), + listeners, i, length; + + //down while you can, then up and next sibling or up and next sibling until back at root + while ((current = next)) { + event.currentScope = current; + listeners = current.$$listeners[name] || []; + for (i = 0, length = listeners.length; i < length; i++) { + // if listeners were deregistered, defragment the array + if (!listeners[i]) { + listeners.splice(i, 1); + i--; + length--; + continue; + } + + try { + listeners[i].apply(null, listenerArgs); + } catch (e) { + $exceptionHandler(e); + } + } + + // Insanity Warning: scope depth-first traversal + // yes, this code is a bit crazy, but it works and we have tests to prove it! + // this piece should be kept in sync with the traversal in $digest + // (though it differs due to having the extra check for $$listenerCount) + if (!(next = ((current.$$listenerCount[name] && current.$$childHead) || + (current !== target && current.$$nextSibling)))) { + while (current !== target && !(next = current.$$nextSibling)) { + current = current.$parent; + } + } + } + + event.currentScope = null; + return event; + } + }; + + var $rootScope = new Scope(); + + //The internal queues. Expose them on the $rootScope for debugging/testing purposes. + var asyncQueue = $rootScope.$$asyncQueue = []; + var postDigestQueue = $rootScope.$$postDigestQueue = []; + var applyAsyncQueue = $rootScope.$$applyAsyncQueue = []; + + return $rootScope; + + + function beginPhase(phase) { + if ($rootScope.$$phase) { + throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase); + } + + $rootScope.$$phase = phase; + } + + function clearPhase() { + $rootScope.$$phase = null; + } + + function incrementWatchersCount(current, count) { + do { + current.$$watchersCount += count; + } while ((current = current.$parent)); + } + + function decrementListenerCount(current, count, name) { + do { + current.$$listenerCount[name] -= count; + + if (current.$$listenerCount[name] === 0) { + delete current.$$listenerCount[name]; + } + } while ((current = current.$parent)); + } + + /** + * function used as an initial value for watchers. + * because it's unique we can easily tell it apart from other values + */ + function initWatchVal() {} + + function flushApplyAsync() { + while (applyAsyncQueue.length) { + try { + applyAsyncQueue.shift()(); + } catch (e) { + $exceptionHandler(e); + } + } + applyAsyncId = null; + } + + function scheduleApplyAsync() { + if (applyAsyncId === null) { + applyAsyncId = $browser.defer(function() { + $rootScope.$apply(flushApplyAsync); + }); + } + } + }]; + } + + /** + * @description + * Private service to sanitize uris for links and images. Used by $compile and $sanitize. + */ + function $$SanitizeUriProvider() { + var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/, + imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; + + /** + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during a[href] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to a[href] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.aHrefSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + aHrefSanitizationWhitelist = regexp; + return this; + } + return aHrefSanitizationWhitelist; + }; + + + /** + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during img[src] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to img[src] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.imgSrcSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + imgSrcSanitizationWhitelist = regexp; + return this; + } + return imgSrcSanitizationWhitelist; + }; + + this.$get = function() { + return function sanitizeUri(uri, isImage) { + var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; + var normalizedVal; + normalizedVal = urlResolve(uri).href; + if (normalizedVal !== '' && !normalizedVal.match(regex)) { + return 'unsafe:' + normalizedVal; + } + return uri; + }; + }; + } + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + var $sceMinErr = minErr('$sce'); + + var SCE_CONTEXTS = { + HTML: 'html', + CSS: 'css', + URL: 'url', + // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a + // url. (e.g. ng-include, script src, templateUrl) + RESOURCE_URL: 'resourceUrl', + JS: 'js' + }; + + // Helper functions follow. + + function adjustMatcher(matcher) { + if (matcher === 'self') { + return matcher; + } else if (isString(matcher)) { + // Strings match exactly except for 2 wildcards - '*' and '**'. + // '*' matches any character except those from the set ':/.?&'. + // '**' matches any character (like .* in a RegExp). + // More than 2 *'s raises an error as it's ill defined. + if (matcher.indexOf('***') > -1) { + throw $sceMinErr('iwcard', + 'Illegal sequence *** in string matcher. String: {0}', matcher); + } + matcher = escapeForRegexp(matcher). + replace('\\*\\*', '.*'). + replace('\\*', '[^:/.?&;]*'); + return new RegExp('^' + matcher + '$'); + } else if (isRegExp(matcher)) { + // The only other type of matcher allowed is a Regexp. + // Match entire URL / disallow partial matches. + // Flags are reset (i.e. no global, ignoreCase or multiline) + return new RegExp('^' + matcher.source + '$'); + } else { + throw $sceMinErr('imatcher', + 'Matchers may only be "self", string patterns or RegExp objects'); + } + } + + + function adjustMatchers(matchers) { + var adjustedMatchers = []; + if (isDefined(matchers)) { + forEach(matchers, function(matcher) { + adjustedMatchers.push(adjustMatcher(matcher)); + }); + } + return adjustedMatchers; + } + + + /** + * @ngdoc service + * @name $sceDelegate + * @kind function + * + * @description + * + * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict + * Contextual Escaping (SCE)} services to AngularJS. + * + * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of + * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is + * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to + * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things + * work because `$sce` delegates to `$sceDelegate` for these operations. + * + * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service. + * + * The default instance of `$sceDelegate` should work out of the box with little pain. While you + * can override it completely to change the behavior of `$sce`, the common case would + * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting + * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as + * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist + * $sceDelegateProvider.resourceUrlWhitelist} and {@link + * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} + */ + + /** + * @ngdoc provider + * @name $sceDelegateProvider + * @description + * + * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate + * $sceDelegate} service. This allows one to get/set the whitelists and blacklists used to ensure + * that the URLs used for sourcing Angular templates are safe. Refer {@link + * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and + * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} + * + * For the general details about this service in Angular, read the main page for {@link ng.$sce + * Strict Contextual Escaping (SCE)}. + * + * **Example**: Consider the following case. + * + * - your app is hosted at url `http://myapp.example.com/` + * - but some of your templates are hosted on other domains you control such as + * `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc. + * - and you have an open redirect at `http://myapp.example.com/clickThru?...`. + * + * Here is what a secure configuration for this scenario might look like: + * + * ``` + * angular.module('myApp', []).config(function($sceDelegateProvider) { + * $sceDelegateProvider.resourceUrlWhitelist([ + * // Allow same origin resource loads. + * 'self', + * // Allow loading from our assets domain. Notice the difference between * and **. + * 'http://srv*.assets.example.com/**' + * ]); + * + * // The blacklist overrides the whitelist so the open redirect here is blocked. + * $sceDelegateProvider.resourceUrlBlacklist([ + * 'http://myapp.example.com/clickThru**' + * ]); + * }); + * ``` + */ + + function $SceDelegateProvider() { + this.SCE_CONTEXTS = SCE_CONTEXTS; + + // Resource URLs can also be trusted by policy. + var resourceUrlWhitelist = ['self'], + resourceUrlBlacklist = []; + + /** + * @ngdoc method + * @name $sceDelegateProvider#resourceUrlWhitelist + * @kind function + * + * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value + * provided. This must be an array or null. A snapshot of this array is used so further + * changes to the array are ignored. + * + * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items + * allowed in this array. + * + * Note: **an empty whitelist array will block all URLs**! + * + * @return {Array} the currently set whitelist array. + * + * The **default value** when no whitelist has been explicitly set is `['self']` allowing only + * same origin resource requests. + * + * @description + * Sets/Gets the whitelist of trusted resource URLs. + */ + this.resourceUrlWhitelist = function(value) { + if (arguments.length) { + resourceUrlWhitelist = adjustMatchers(value); + } + return resourceUrlWhitelist; + }; + + /** + * @ngdoc method + * @name $sceDelegateProvider#resourceUrlBlacklist + * @kind function + * + * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value + * provided. This must be an array or null. A snapshot of this array is used so further + * changes to the array are ignored. + * + * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items + * allowed in this array. + * + * The typical usage for the blacklist is to **block + * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as + * these would otherwise be trusted but actually return content from the redirected domain. + * + * Finally, **the blacklist overrides the whitelist** and has the final say. + * + * @return {Array} the currently set blacklist array. + * + * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there + * is no blacklist.) + * + * @description + * Sets/Gets the blacklist of trusted resource URLs. + */ + + this.resourceUrlBlacklist = function(value) { + if (arguments.length) { + resourceUrlBlacklist = adjustMatchers(value); + } + return resourceUrlBlacklist; + }; + + this.$get = ['$injector', function($injector) { + + var htmlSanitizer = function htmlSanitizer(html) { + throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); + }; + + if ($injector.has('$sanitize')) { + htmlSanitizer = $injector.get('$sanitize'); + } + + + function matchUrl(matcher, parsedUrl) { + if (matcher === 'self') { + return urlIsSameOrigin(parsedUrl); + } else { + // definitely a regex. See adjustMatchers() + return !!matcher.exec(parsedUrl.href); + } + } + + function isResourceUrlAllowedByPolicy(url) { + var parsedUrl = urlResolve(url.toString()); + var i, n, allowed = false; + // Ensure that at least one item from the whitelist allows this url. + for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { + if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { + allowed = true; + break; + } + } + if (allowed) { + // Ensure that no item from the blacklist blocked this url. + for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { + if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { + allowed = false; + break; + } + } + } + return allowed; + } + + function generateHolderType(Base) { + var holderType = function TrustedValueHolderType(trustedValue) { + this.$$unwrapTrustedValue = function() { + return trustedValue; + }; + }; + if (Base) { + holderType.prototype = new Base(); + } + holderType.prototype.valueOf = function sceValueOf() { + return this.$$unwrapTrustedValue(); + }; + holderType.prototype.toString = function sceToString() { + return this.$$unwrapTrustedValue().toString(); + }; + return holderType; + } + + var trustedValueHolderBase = generateHolderType(), + byType = {}; + + byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]); + + /** + * @ngdoc method + * @name $sceDelegate#trustAs + * + * @description + * Returns an object that is trusted by angular for use in specified strict + * contextual escaping contexts (such as ng-bind-html, ng-include, any src + * attribute interpolation, any dom event binding attribute interpolation + * such as for onclick, etc.) that uses the provided value. + * See {@link ng.$sce $sce} for enabling strict contextual escaping. + * + * @param {string} type The kind of context in which this value is safe for use. e.g. url, + * resourceUrl, html, js and css. + * @param {*} value The value that that should be considered trusted/safe. + * @returns {*} A value that can be used to stand in for the provided `value` in places + * where Angular expects a $sce.trustAs() return value. + */ + function trustAs(type, trustedValue) { + var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null); + if (!Constructor) { + throw $sceMinErr('icontext', + 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', + type, trustedValue); + } + if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') { + return trustedValue; + } + // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting + // mutable objects, we ensure here that the value passed in is actually a string. + if (typeof trustedValue !== 'string') { + throw $sceMinErr('itype', + 'Attempted to trust a non-string value in a content requiring a string: Context: {0}', + type); + } + return new Constructor(trustedValue); + } + + /** + * @ngdoc method + * @name $sceDelegate#valueOf + * + * @description + * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link + * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. + * + * If the passed parameter is not a value that had been returned by {@link + * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is. + * + * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} + * call or anything else. + * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns + * `value` unchanged. + */ + function valueOf(maybeTrusted) { + if (maybeTrusted instanceof trustedValueHolderBase) { + return maybeTrusted.$$unwrapTrustedValue(); + } else { + return maybeTrusted; + } + } + + /** + * @ngdoc method + * @name $sceDelegate#getTrusted + * + * @description + * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and + * returns the originally supplied value if the queried context type is a supertype of the + * created type. If this condition isn't satisfied, throws an exception. + * + * @param {string} type The kind of context in which this value is to be used. + * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} call. + * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} if valid in this context. Otherwise, throws an exception. + */ + function getTrusted(type, maybeTrusted) { + if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') { + return maybeTrusted; + } + var constructor = (byType.hasOwnProperty(type) ? byType[type] : null); + if (constructor && maybeTrusted instanceof constructor) { + return maybeTrusted.$$unwrapTrustedValue(); + } + // If we get here, then we may only take one of two actions. + // 1. sanitize the value for the requested type, or + // 2. throw an exception. + if (type === SCE_CONTEXTS.RESOURCE_URL) { + if (isResourceUrlAllowedByPolicy(maybeTrusted)) { + return maybeTrusted; + } else { + throw $sceMinErr('insecurl', + 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', + maybeTrusted.toString()); + } + } else if (type === SCE_CONTEXTS.HTML) { + return htmlSanitizer(maybeTrusted); + } + throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); + } + + return { trustAs: trustAs, + getTrusted: getTrusted, + valueOf: valueOf }; + }]; + } + + + /** + * @ngdoc provider + * @name $sceProvider + * @description + * + * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service. + * - enable/disable Strict Contextual Escaping (SCE) in a module + * - override the default implementation with a custom delegate + * + * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}. + */ + + /* jshint maxlen: false*/ + + /** + * @ngdoc service + * @name $sce + * @kind function + * + * @description + * + * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS. + * + * # Strict Contextual Escaping + * + * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain + * contexts to result in a value that is marked as safe to use for that context. One example of + * such a context is binding arbitrary html controlled by the user via `ng-bind-html`. We refer + * to these contexts as privileged or SCE contexts. + * + * As of version 1.2, Angular ships with SCE enabled by default. + * + * Note: When enabled (the default), IE<11 in quirks mode is not supported. In this mode, IE<11 allow + * one to execute arbitrary javascript by the use of the expression() syntax. Refer + * to learn more about them. + * You can ensure your document is in standards mode and not quirks mode by adding `` + * to the top of your HTML document. + * + * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for + * security vulnerabilities such as XSS, clickjacking, etc. a lot easier. + * + * Here's an example of a binding in a privileged context: + * + * ``` + * + *
    + * ``` + * + * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE + * disabled, this application allows the user to render arbitrary HTML into the DIV. + * In a more realistic example, one may be rendering user comments, blog articles, etc. via + * bindings. (HTML is just one example of a context where rendering user controlled input creates + * security vulnerabilities.) + * + * For the case of HTML, you might use a library, either on the client side, or on the server side, + * to sanitize unsafe HTML before binding to the value and rendering it in the document. + * + * How would you ensure that every place that used these types of bindings was bound to a value that + * was sanitized by your library (or returned as safe for rendering by your server?) How can you + * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some + * properties/fields and forgot to update the binding to the sanitized value? + * + * To be secure by default, you want to ensure that any such bindings are disallowed unless you can + * determine that something explicitly says it's safe to use a value for binding in that + * context. You can then audit your code (a simple grep would do) to ensure that this is only done + * for those values that you can easily tell are safe - because they were received from your server, + * sanitized by your library, etc. You can organize your codebase to help with this - perhaps + * allowing only the files in a specific directory to do this. Ensuring that the internal API + * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task. + * + * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs} + * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to + * obtain values that will be accepted by SCE / privileged contexts. + * + * + * ## How does it work? + * + * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted + * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link + * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the + * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. + * + * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link + * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly + * simplified): + * + * ``` + * var ngBindHtmlDirective = ['$sce', function($sce) { + * return function(scope, element, attr) { + * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) { + * element.html(value || ''); + * }); + * }; + * }]; + * ``` + * + * ## Impact on loading templates + * + * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as + * `templateUrl`'s specified by {@link guide/directive directives}. + * + * By default, Angular only loads templates from the same domain and protocol as the application + * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl + * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or + * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist + * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value. + * + * *Please note*: + * The browser's + * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) + * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) + * policy apply in addition to this and may further restrict whether the template is successfully + * loaded. This means that without the right CORS policy, loading templates from a different domain + * won't work on all browsers. Also, loading templates from `file://` URL does not work on some + * browsers. + * + * ## This feels like too much overhead + * + * It's important to remember that SCE only applies to interpolation expressions. + * + * If your expressions are constant literals, they're automatically trusted and you don't need to + * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g. + * `
    `) just works. + * + * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them + * through {@link ng.$sce#getTrusted $sce.getTrusted}. SCE doesn't play a role here. + * + * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load + * templates in `ng-include` from your application's domain without having to even know about SCE. + * It blocks loading templates from other domains or loading templates over http from an https + * served document. You can change these by setting your own custom {@link + * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link + * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs. + * + * This significantly reduces the overhead. It is far easier to pay the small overhead and have an + * application that's secure and can be audited to verify that with much more ease than bolting + * security onto an application later. + * + * + * ## What trusted context types are supported? + * + * | Context | Notes | + * |---------------------|----------------| + * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. | + * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. | + * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`
    Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. | + * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. | + * + * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
    + * + * Each element in these arrays must be one of the following: + * + * - **'self'** + * - The special **string**, `'self'`, can be used to match against all URLs of the **same + * domain** as the application document using the **same protocol**. + * - **String** (except the special value `'self'`) + * - The string is matched against the full *normalized / absolute URL* of the resource + * being tested (substring matches are not good enough.) + * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters + * match themselves. + * - `*`: matches zero or more occurrences of any character other than one of the following 6 + * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use + * in a whitelist. + * - `**`: matches zero or more occurrences of *any* character. As such, it's not + * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g. + * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might + * not have been the intention.) Its usage at the very end of the path is ok. (e.g. + * http://foo.example.com/templates/**). + * - **RegExp** (*see caveat below*) + * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax + * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to + * accidentally introduce a bug when one updates a complex expression (imho, all regexes should + * have good test coverage). For instance, the use of `.` in the regex is correct only in a + * small number of cases. A `.` character in the regex used when matching the scheme or a + * subdomain could be matched against a `:` or literal `.` that was likely not intended. It + * is highly recommended to use the string patterns and only fall back to regular expressions + * as a last resort. + * - The regular expression must be an instance of RegExp (i.e. not a string.) It is + * matched against the **entire** *normalized / absolute URL* of the resource being tested + * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags + * present on the RegExp (such as multiline, global, ignoreCase) are ignored. + * - If you are generating your JavaScript from some other templating engine (not + * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)), + * remember to escape your regular expression (and be aware that you might need more than + * one level of escaping depending on your templating engine and the way you interpolated + * the value.) Do make use of your platform's escaping mechanism as it might be good + * enough before coding your own. E.g. Ruby has + * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape) + * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape). + * Javascript lacks a similar built in function for escaping. Take a look at Google + * Closure library's [goog.string.regExpEscape(s)]( + * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962). + * + * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example. + * + * ## Show me an example using SCE. + * + * + * + *
    + *

    + * User comments
    + * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when + * $sanitize is available. If $sanitize isn't available, this results in an error instead of an + * exploit. + *
    + *
    + * {{userComment.name}}: + * + *
    + *
    + *
    + *
    + *
    + * + * + * angular.module('mySceApp', ['ngSanitize']) + * .controller('AppController', ['$http', '$templateCache', '$sce', + * function($http, $templateCache, $sce) { + * var self = this; + * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { + * self.userComments = userComments; + * }); + * self.explicitlyTrustedHtml = $sce.trustAsHtml( + * 'Hover over this text.'); + * }]); + * + * + * + * [ + * { "name": "Alice", + * "htmlComment": + * "Is anyone reading this?" + * }, + * { "name": "Bob", + * "htmlComment": "Yes! Am I the only other one?" + * } + * ] + * + * + * + * describe('SCE doc demo', function() { + * it('should sanitize untrusted values', function() { + * expect(element.all(by.css('.htmlComment')).first().getInnerHtml()) + * .toBe('Is anyone reading this?'); + * }); + * + * it('should NOT sanitize explicitly trusted values', function() { + * expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe( + * 'Hover over this text.'); + * }); + * }); + * + *
    + * + * + * + * ## Can I disable SCE completely? + * + * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits + * for little coding overhead. It will be much harder to take an SCE disabled application and + * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE + * for cases where you have a lot of existing code that was written before SCE was introduced and + * you're migrating them a module at a time. + * + * That said, here's how you can completely disable SCE: + * + * ``` + * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) { + * // Completely disable SCE. For demonstration purposes only! + * // Do not use in new projects. + * $sceProvider.enabled(false); + * }); + * ``` + * + */ + /* jshint maxlen: 100 */ + + function $SceProvider() { + var enabled = true; + + /** + * @ngdoc method + * @name $sceProvider#enabled + * @kind function + * + * @param {boolean=} value If provided, then enables/disables SCE. + * @return {boolean} true if SCE is enabled, false otherwise. + * + * @description + * Enables/disables SCE and returns the current value. + */ + this.enabled = function(value) { + if (arguments.length) { + enabled = !!value; + } + return enabled; + }; + + + /* Design notes on the default implementation for SCE. + * + * The API contract for the SCE delegate + * ------------------------------------- + * The SCE delegate object must provide the following 3 methods: + * + * - trustAs(contextEnum, value) + * This method is used to tell the SCE service that the provided value is OK to use in the + * contexts specified by contextEnum. It must return an object that will be accepted by + * getTrusted() for a compatible contextEnum and return this value. + * + * - valueOf(value) + * For values that were not produced by trustAs(), return them as is. For values that were + * produced by trustAs(), return the corresponding input value to trustAs. Basically, if + * trustAs is wrapping the given values into some type, this operation unwraps it when given + * such a value. + * + * - getTrusted(contextEnum, value) + * This function should return the a value that is safe to use in the context specified by + * contextEnum or throw and exception otherwise. + * + * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be + * opaque or wrapped in some holder object. That happens to be an implementation detail. For + * instance, an implementation could maintain a registry of all trusted objects by context. In + * such a case, trustAs() would return the same object that was passed in. getTrusted() would + * return the same object passed in if it was found in the registry under a compatible context or + * throw an exception otherwise. An implementation might only wrap values some of the time based + * on some criteria. getTrusted() might return a value and not throw an exception for special + * constants or objects even if not wrapped. All such implementations fulfill this contract. + * + * + * A note on the inheritance model for SCE contexts + * ------------------------------------------------ + * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This + * is purely an implementation details. + * + * The contract is simply this: + * + * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value) + * will also succeed. + * + * Inheritance happens to capture this in a natural way. In some future, we + * may not use inheritance anymore. That is OK because no code outside of + * sce.js and sceSpecs.js would need to be aware of this detail. + */ + + this.$get = ['$parse', '$sceDelegate', function( + $parse, $sceDelegate) { + // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow + // the "expression(javascript expression)" syntax which is insecure. + if (enabled && msie < 8) { + throw $sceMinErr('iequirks', + 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' + + 'mode. You can fix this by adding the text to the top of your HTML ' + + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.'); + } + + var sce = shallowCopy(SCE_CONTEXTS); + + /** + * @ngdoc method + * @name $sce#isEnabled + * @kind function + * + * @return {Boolean} true if SCE is enabled, false otherwise. If you want to set the value, you + * have to do it at module config time on {@link ng.$sceProvider $sceProvider}. + * + * @description + * Returns a boolean indicating if SCE is enabled. + */ + sce.isEnabled = function() { + return enabled; + }; + sce.trustAs = $sceDelegate.trustAs; + sce.getTrusted = $sceDelegate.getTrusted; + sce.valueOf = $sceDelegate.valueOf; + + if (!enabled) { + sce.trustAs = sce.getTrusted = function(type, value) { return value; }; + sce.valueOf = identity; + } + + /** + * @ngdoc method + * @name $sce#parseAs + * + * @description + * Converts Angular {@link guide/expression expression} into a function. This is like {@link + * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it + * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*, + * *result*)} + * + * @param {string} type The kind of SCE context in which this result will be used. + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + sce.parseAs = function sceParseAs(type, expr) { + var parsed = $parse(expr); + if (parsed.literal && parsed.constant) { + return parsed; + } else { + return $parse(expr, function(value) { + return sce.getTrusted(type, value); + }); + } + }; + + /** + * @ngdoc method + * @name $sce#trustAs + * + * @description + * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, + * returns an object that is trusted by angular for use in specified strict contextual + * escaping contexts (such as ng-bind-html, ng-include, any src attribute + * interpolation, any dom event binding attribute interpolation such as for onclick, etc.) + * that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual + * escaping. + * + * @param {string} type The kind of context in which this value is safe for use. e.g. url, + * resourceUrl, html, js and css. + * @param {*} value The value that that should be considered trusted/safe. + * @returns {*} A value that can be used to stand in for the provided `value` in places + * where Angular expects a $sce.trustAs() return value. + */ + + /** + * @ngdoc method + * @name $sce#trustAsHtml + * + * @description + * Shorthand method. `$sce.trustAsHtml(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml + * $sce.getTrustedHtml(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsUrl + * + * @description + * Shorthand method. `$sce.trustAsUrl(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl + * $sce.getTrustedUrl(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsResourceUrl + * + * @description + * Shorthand method. `$sce.trustAsResourceUrl(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl + * $sce.getTrustedResourceUrl(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the return + * value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsJs + * + * @description + * Shorthand method. `$sce.trustAsJs(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs + * $sce.getTrustedJs(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#getTrusted + * + * @description + * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such, + * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the + * originally supplied value if the queried context type is a supertype of the created type. + * If this condition isn't satisfied, throws an exception. + * + * @param {string} type The kind of context in which this value is to be used. + * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`} + * call. + * @returns {*} The value the was originally provided to + * {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context. + * Otherwise, throws an exception. + */ + + /** + * @ngdoc method + * @name $sce#getTrustedHtml + * + * @description + * Shorthand method. `$sce.getTrustedHtml(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedCss + * + * @description + * Shorthand method. `$sce.getTrustedCss(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedUrl + * + * @description + * Shorthand method. `$sce.getTrustedUrl(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedResourceUrl + * + * @description + * Shorthand method. `$sce.getTrustedResourceUrl(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`} + * + * @param {*} value The value to pass to `$sceDelegate.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedJs + * + * @description + * Shorthand method. `$sce.getTrustedJs(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)` + */ + + /** + * @ngdoc method + * @name $sce#parseAsHtml + * + * @description + * Shorthand method. `$sce.parseAsHtml(expression string)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsCss + * + * @description + * Shorthand method. `$sce.parseAsCss(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsUrl + * + * @description + * Shorthand method. `$sce.parseAsUrl(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsResourceUrl + * + * @description + * Shorthand method. `$sce.parseAsResourceUrl(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsJs + * + * @description + * Shorthand method. `$sce.parseAsJs(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + // Shorthand delegations. + var parse = sce.parseAs, + getTrusted = sce.getTrusted, + trustAs = sce.trustAs; + + forEach(SCE_CONTEXTS, function(enumValue, name) { + var lName = lowercase(name); + sce[camelCase("parse_as_" + lName)] = function(expr) { + return parse(enumValue, expr); + }; + sce[camelCase("get_trusted_" + lName)] = function(value) { + return getTrusted(enumValue, value); + }; + sce[camelCase("trust_as_" + lName)] = function(value) { + return trustAs(enumValue, value); + }; + }); + + return sce; + }]; + } + + /** + * !!! This is an undocumented "private" service !!! + * + * @name $sniffer + * @requires $window + * @requires $document + * + * @property {boolean} history Does the browser support html5 history api ? + * @property {boolean} transitions Does the browser support CSS transition events ? + * @property {boolean} animations Does the browser support CSS animation events ? + * + * @description + * This is very simple implementation of testing browser's features. + */ + function $SnifferProvider() { + this.$get = ['$window', '$document', function($window, $document) { + var eventSupport = {}, + android = + toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), + boxee = /Boxee/i.test(($window.navigator || {}).userAgent), + document = $document[0] || {}, + vendorPrefix, + vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/, + bodyStyle = document.body && document.body.style, + transitions = false, + animations = false, + match; + + if (bodyStyle) { + for (var prop in bodyStyle) { + if (match = vendorRegex.exec(prop)) { + vendorPrefix = match[0]; + vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1); + break; + } + } + + if (!vendorPrefix) { + vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit'; + } + + transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle)); + animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); + + if (android && (!transitions || !animations)) { + transitions = isString(bodyStyle.webkitTransition); + animations = isString(bodyStyle.webkitAnimation); + } + } + + + return { + // Android has history.pushState, but it does not update location correctly + // so let's not use the history API at all. + // http://code.google.com/p/android/issues/detail?id=17471 + // https://github.com/angular/angular.js/issues/904 + + // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has + // so let's not use the history API also + // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined + // jshint -W018 + history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee), + // jshint +W018 + hasEvent: function(event) { + // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have + // it. In particular the event is not fired when backspace or delete key are pressed or + // when cut operation is performed. + // IE10+ implements 'input' event but it erroneously fires under various situations, + // e.g. when placeholder changes, or a form is focused. + if (event === 'input' && msie <= 11) return false; + + if (isUndefined(eventSupport[event])) { + var divElm = document.createElement('div'); + eventSupport[event] = 'on' + event in divElm; + } + + return eventSupport[event]; + }, + csp: csp(), + vendorPrefix: vendorPrefix, + transitions: transitions, + animations: animations, + android: android + }; + }]; + } + + var $compileMinErr = minErr('$compile'); + + /** + * @ngdoc service + * @name $templateRequest + * + * @description + * The `$templateRequest` service runs security checks then downloads the provided template using + * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request + * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the + * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the + * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted + * when `tpl` is of type string and `$templateCache` has the matching entry. + * + * @param {string|TrustedResourceUrl} tpl The HTTP request template URL + * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty + * + * @return {Promise} a promise for the HTTP response data of the given URL. + * + * @property {number} totalPendingRequests total amount of pending template requests being downloaded. + */ + function $TemplateRequestProvider() { + this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) { + function handleRequestFn(tpl, ignoreRequestError) { + handleRequestFn.totalPendingRequests++; + + // We consider the template cache holds only trusted templates, so + // there's no need to go through whitelisting again for keys that already + // are included in there. This also makes Angular accept any script + // directive, no matter its name. However, we still need to unwrap trusted + // types. + if (!isString(tpl) || !$templateCache.get(tpl)) { + tpl = $sce.getTrustedResourceUrl(tpl); + } + + var transformResponse = $http.defaults && $http.defaults.transformResponse; + + if (isArray(transformResponse)) { + transformResponse = transformResponse.filter(function(transformer) { + return transformer !== defaultHttpResponseTransform; + }); + } else if (transformResponse === defaultHttpResponseTransform) { + transformResponse = null; + } + + var httpOptions = { + cache: $templateCache, + transformResponse: transformResponse + }; + + return $http.get(tpl, httpOptions) + ['finally'](function() { + handleRequestFn.totalPendingRequests--; + }) + .then(function(response) { + $templateCache.put(tpl, response.data); + return response.data; + }, handleError); + + function handleError(resp) { + if (!ignoreRequestError) { + throw $compileMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})', + tpl, resp.status, resp.statusText); + } + return $q.reject(resp); + } + } + + handleRequestFn.totalPendingRequests = 0; + + return handleRequestFn; + }]; + } + + function $$TestabilityProvider() { + this.$get = ['$rootScope', '$browser', '$location', + function($rootScope, $browser, $location) { + + /** + * @name $testability + * + * @description + * The private $$testability service provides a collection of methods for use when debugging + * or by automated test and debugging tools. + */ + var testability = {}; + + /** + * @name $$testability#findBindings + * + * @description + * Returns an array of elements that are bound (via ng-bind or {{}}) + * to expressions matching the input. + * + * @param {Element} element The element root to search from. + * @param {string} expression The binding expression to match. + * @param {boolean} opt_exactMatch If true, only returns exact matches + * for the expression. Filters and whitespace are ignored. + */ + testability.findBindings = function(element, expression, opt_exactMatch) { + var bindings = element.getElementsByClassName('ng-binding'); + var matches = []; + forEach(bindings, function(binding) { + var dataBinding = angular.element(binding).data('$binding'); + if (dataBinding) { + forEach(dataBinding, function(bindingName) { + if (opt_exactMatch) { + var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)'); + if (matcher.test(bindingName)) { + matches.push(binding); + } + } else { + if (bindingName.indexOf(expression) != -1) { + matches.push(binding); + } + } + }); + } + }); + return matches; + }; + + /** + * @name $$testability#findModels + * + * @description + * Returns an array of elements that are two-way found via ng-model to + * expressions matching the input. + * + * @param {Element} element The element root to search from. + * @param {string} expression The model expression to match. + * @param {boolean} opt_exactMatch If true, only returns exact matches + * for the expression. + */ + testability.findModels = function(element, expression, opt_exactMatch) { + var prefixes = ['ng-', 'data-ng-', 'ng\\:']; + for (var p = 0; p < prefixes.length; ++p) { + var attributeEquals = opt_exactMatch ? '=' : '*='; + var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]'; + var elements = element.querySelectorAll(selector); + if (elements.length) { + return elements; + } + } + }; + + /** + * @name $$testability#getLocation + * + * @description + * Shortcut for getting the location in a browser agnostic way. Returns + * the path, search, and hash. (e.g. /path?a=b#hash) + */ + testability.getLocation = function() { + return $location.url(); + }; + + /** + * @name $$testability#setLocation + * + * @description + * Shortcut for navigating to a location without doing a full page reload. + * + * @param {string} url The location url (path, search and hash, + * e.g. /path?a=b#hash) to go to. + */ + testability.setLocation = function(url) { + if (url !== $location.url()) { + $location.url(url); + $rootScope.$digest(); + } + }; + + /** + * @name $$testability#whenStable + * + * @description + * Calls the callback when $timeout and $http requests are completed. + * + * @param {function} callback + */ + testability.whenStable = function(callback) { + $browser.notifyWhenNoOutstandingRequests(callback); + }; + + return testability; + }]; + } + + function $TimeoutProvider() { + this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', + function($rootScope, $browser, $q, $$q, $exceptionHandler) { + + var deferreds = {}; + + + /** + * @ngdoc service + * @name $timeout + * + * @description + * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch + * block and delegates any exceptions to + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * The return value of calling `$timeout` is a promise, which will be resolved when + * the delay has passed and the timeout function, if provided, is executed. + * + * To cancel a timeout request, call `$timeout.cancel(promise)`. + * + * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to + * synchronously flush the queue of deferred functions. + * + * If you only want a promise that will be resolved after some specified delay + * then you can call `$timeout` without the `fn` function. + * + * @param {function()=} fn A function, whose execution should be delayed. + * @param {number=} [delay=0] Delay in milliseconds. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @param {...*=} Pass additional parameters to the executed function. + * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this + * promise will be resolved with is the return value of the `fn` function. + * + */ + function timeout(fn, delay, invokeApply) { + if (!isFunction(fn)) { + invokeApply = delay; + delay = fn; + fn = noop; + } + + var args = sliceArgs(arguments, 3), + skipApply = (isDefined(invokeApply) && !invokeApply), + deferred = (skipApply ? $$q : $q).defer(), + promise = deferred.promise, + timeoutId; + + timeoutId = $browser.defer(function() { + try { + deferred.resolve(fn.apply(null, args)); + } catch (e) { + deferred.reject(e); + $exceptionHandler(e); + } + finally { + delete deferreds[promise.$$timeoutId]; + } + + if (!skipApply) $rootScope.$apply(); + }, delay); + + promise.$$timeoutId = timeoutId; + deferreds[timeoutId] = deferred; + + return promise; + } + + + /** + * @ngdoc method + * @name $timeout#cancel + * + * @description + * Cancels a task associated with the `promise`. As a result of this, the promise will be + * resolved with a rejection. + * + * @param {Promise=} promise Promise returned by the `$timeout` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully + * canceled. + */ + timeout.cancel = function(promise) { + if (promise && promise.$$timeoutId in deferreds) { + deferreds[promise.$$timeoutId].reject('canceled'); + delete deferreds[promise.$$timeoutId]; + return $browser.defer.cancel(promise.$$timeoutId); + } + return false; + }; + + return timeout; + }]; + } + + // NOTE: The usage of window and document instead of $window and $document here is + // deliberate. This service depends on the specific behavior of anchor nodes created by the + // browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and + // cause us to break tests. In addition, when the browser resolves a URL for XHR, it + // doesn't know about mocked locations and resolves URLs to the real document - which is + // exactly the behavior needed here. There is little value is mocking these out for this + // service. + var urlParsingNode = document.createElement("a"); + var originUrl = urlResolve(window.location.href); + + + /** + * + * Implementation Notes for non-IE browsers + * ---------------------------------------- + * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, + * results both in the normalizing and parsing of the URL. Normalizing means that a relative + * URL will be resolved into an absolute URL in the context of the application document. + * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related + * properties are all populated to reflect the normalized URL. This approach has wide + * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See + * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html + * + * Implementation Notes for IE + * --------------------------- + * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other + * browsers. However, the parsed components will not be set if the URL assigned did not specify + * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We + * work around that by performing the parsing in a 2nd step by taking a previously normalized + * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the + * properties such as protocol, hostname, port, etc. + * + * References: + * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement + * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html + * http://url.spec.whatwg.org/#urlutils + * https://github.com/angular/angular.js/pull/2902 + * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ + * + * @kind function + * @param {string} url The URL to be parsed. + * @description Normalizes and parses a URL. + * @returns {object} Returns the normalized URL as a dictionary. + * + * | member name | Description | + * |---------------|----------------| + * | href | A normalized version of the provided URL if it was not an absolute URL | + * | protocol | The protocol including the trailing colon | + * | host | The host and port (if the port is non-default) of the normalizedUrl | + * | search | The search params, minus the question mark | + * | hash | The hash string, minus the hash symbol + * | hostname | The hostname + * | port | The port, without ":" + * | pathname | The pathname, beginning with "/" + * + */ + function urlResolve(url) { + var href = url; + + if (msie) { + // Normalize before parse. Refer Implementation Notes on why this is + // done in two steps on IE. + urlParsingNode.setAttribute("href", href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') + ? urlParsingNode.pathname + : '/' + urlParsingNode.pathname + }; + } + + /** + * Parse a request URL and determine whether this is a same-origin request as the application document. + * + * @param {string|object} requestUrl The url of the request as a string that will be resolved + * or a parsed URL object. + * @returns {boolean} Whether the request is for the same origin as the application document. + */ + function urlIsSameOrigin(requestUrl) { + var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; + return (parsed.protocol === originUrl.protocol && + parsed.host === originUrl.host); + } + + /** + * @ngdoc service + * @name $window + * + * @description + * A reference to the browser's `window` object. While `window` + * is globally available in JavaScript, it causes testability problems, because + * it is a global variable. In angular we always refer to it through the + * `$window` service, so it may be overridden, removed or mocked for testing. + * + * Expressions, like the one defined for the `ngClick` directive in the example + * below, are evaluated with respect to the current scope. Therefore, there is + * no risk of inadvertently coding in a dependency on a global value in such an + * expression. + * + * @example + + + +
    + + +
    +
    + + it('should display the greeting in the input box', function() { + element(by.model('greeting')).sendKeys('Hello, E2E Tests'); + // If we click the button it will block the test runner + // element(':button').click(); + }); + +
    + */ + function $WindowProvider() { + this.$get = valueFn(window); + } + + /** + * @name $$cookieReader + * @requires $document + * + * @description + * This is a private service for reading cookies used by $http and ngCookies + * + * @return {Object} a key/value map of the current cookies + */ + function $$CookieReader($document) { + var rawDocument = $document[0] || {}; + var lastCookies = {}; + var lastCookieString = ''; + + function safeDecodeURIComponent(str) { + try { + return decodeURIComponent(str); + } catch (e) { + return str; + } + } + + return function() { + var cookieArray, cookie, i, index, name; + var currentCookieString = rawDocument.cookie || ''; + + if (currentCookieString !== lastCookieString) { + lastCookieString = currentCookieString; + cookieArray = lastCookieString.split('; '); + lastCookies = {}; + + for (i = 0; i < cookieArray.length; i++) { + cookie = cookieArray[i]; + index = cookie.indexOf('='); + if (index > 0) { //ignore nameless cookies + name = safeDecodeURIComponent(cookie.substring(0, index)); + // the first value that is seen for a cookie is the most + // specific one. values for the same cookie name that + // follow are for less specific paths. + if (isUndefined(lastCookies[name])) { + lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1)); + } + } + } + } + return lastCookies; + }; + } + + $$CookieReader.$inject = ['$document']; + + function $$CookieReaderProvider() { + this.$get = $$CookieReader; + } + + /* global currencyFilter: true, + dateFilter: true, + filterFilter: true, + jsonFilter: true, + limitToFilter: true, + lowercaseFilter: true, + numberFilter: true, + orderByFilter: true, + uppercaseFilter: true, + */ + + /** + * @ngdoc provider + * @name $filterProvider + * @description + * + * Filters are just functions which transform input to an output. However filters need to be + * Dependency Injected. To achieve this a filter definition consists of a factory function which is + * annotated with dependencies and is responsible for creating a filter function. + * + *
    + * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. + * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace + * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores + * (`myapp_subsection_filterx`). + *
    + * + * ```js + * // Filter registration + * function MyModule($provide, $filterProvider) { + * // create a service to demonstrate injection (not always needed) + * $provide.value('greet', function(name){ + * return 'Hello ' + name + '!'; + * }); + * + * // register a filter factory which uses the + * // greet service to demonstrate DI. + * $filterProvider.register('greet', function(greet){ + * // return the filter function which uses the greet service + * // to generate salutation + * return function(text) { + * // filters need to be forgiving so check input validity + * return text && greet(text) || text; + * }; + * }); + * } + * ``` + * + * The filter function is registered with the `$injector` under the filter name suffix with + * `Filter`. + * + * ```js + * it('should be the same instance', inject( + * function($filterProvider) { + * $filterProvider.register('reverse', function(){ + * return ...; + * }); + * }, + * function($filter, reverseFilter) { + * expect($filter('reverse')).toBe(reverseFilter); + * }); + * ``` + * + * + * For more information about how angular filters work, and how to create your own filters, see + * {@link guide/filter Filters} in the Angular Developer Guide. + */ + + /** + * @ngdoc service + * @name $filter + * @kind function + * @description + * Filters are used for formatting data displayed to the user. + * + * The general syntax in templates is as follows: + * + * {{ expression [| filter_name[:parameter_value] ... ] }} + * + * @param {String} name Name of the filter function to retrieve + * @return {Function} the filter function + * @example + + +
    +

    {{ originalText }}

    +

    {{ filteredText }}

    +
    +
    + + + angular.module('filterExample', []) + .controller('MainCtrl', function($scope, $filter) { + $scope.originalText = 'hello'; + $scope.filteredText = $filter('uppercase')($scope.originalText); + }); + +
    + */ + $FilterProvider.$inject = ['$provide']; + function $FilterProvider($provide) { + var suffix = 'Filter'; + + /** + * @ngdoc method + * @name $filterProvider#register + * @param {string|Object} name Name of the filter function, or an object map of filters where + * the keys are the filter names and the values are the filter factories. + * + *
    + * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. + * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace + * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores + * (`myapp_subsection_filterx`). + *
    + * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered. + * @returns {Object} Registered filter instance, or if a map of filters was provided then a map + * of the registered filter instances. + */ + function register(name, factory) { + if (isObject(name)) { + var filters = {}; + forEach(name, function(filter, key) { + filters[key] = register(key, filter); + }); + return filters; + } else { + return $provide.factory(name + suffix, factory); + } + } + this.register = register; + + this.$get = ['$injector', function($injector) { + return function(name) { + return $injector.get(name + suffix); + }; + }]; + + //////////////////////////////////////// + + /* global + currencyFilter: false, + dateFilter: false, + filterFilter: false, + jsonFilter: false, + limitToFilter: false, + lowercaseFilter: false, + numberFilter: false, + orderByFilter: false, + uppercaseFilter: false, + */ + + register('currency', currencyFilter); + register('date', dateFilter); + register('filter', filterFilter); + register('json', jsonFilter); + register('limitTo', limitToFilter); + register('lowercase', lowercaseFilter); + register('number', numberFilter); + register('orderBy', orderByFilter); + register('uppercase', uppercaseFilter); + } + + /** + * @ngdoc filter + * @name filter + * @kind function + * + * @description + * Selects a subset of items from `array` and returns it as a new array. + * + * @param {Array} array The source array. + * @param {string|Object|function()} expression The predicate to be used for selecting items from + * `array`. + * + * Can be one of: + * + * - `string`: The string is used for matching against the contents of the `array`. All strings or + * objects with string properties in `array` that match this string will be returned. This also + * applies to nested object properties. + * The predicate can be negated by prefixing the string with `!`. + * + * - `Object`: A pattern object can be used to filter specific properties on objects contained + * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items + * which have property `name` containing "M" and property `phone` containing "1". A special + * property name `$` can be used (as in `{$:"text"}`) to accept a match against any + * property of the object or its nested object properties. That's equivalent to the simple + * substring match with a `string` as described above. The predicate can be negated by prefixing + * the string with `!`. + * For example `{name: "!M"}` predicate will return an array of items which have property `name` + * not containing "M". + * + * Note that a named property will match properties on the same level only, while the special + * `$` property will match properties on the same level or deeper. E.g. an array item like + * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but + * **will** be matched by `{$: 'John'}`. + * + * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters. + * The function is called for each element of the array, with the element, its index, and + * the entire array itself as arguments. + * + * The final result is an array of those elements that the predicate returned true for. + * + * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in + * determining if the expected value (from the filter expression) and actual value (from + * the object in the array) should be considered a match. + * + * Can be one of: + * + * - `function(actual, expected)`: + * The function will be given the object value and the predicate value to compare and + * should return true if both values should be considered equal. + * + * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`. + * This is essentially strict comparison of expected and actual. + * + * - `false|undefined`: A short hand for a function which will look for a substring match in case + * insensitive way. + * + * Primitive values are converted to strings. Objects are not compared against primitives, + * unless they have a custom `toString` method (e.g. `Date` objects). + * + * @example + + +
    + + + + + + + + +
    NamePhone
    {{friend.name}}{{friend.phone}}
    +
    +
    +
    +
    +
    + + + + + + +
    NamePhone
    {{friendObj.name}}{{friendObj.phone}}
    +
    + + var expectFriendNames = function(expectedNames, key) { + element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) { + arr.forEach(function(wd, i) { + expect(wd.getText()).toMatch(expectedNames[i]); + }); + }); + }; + + it('should search across all fields when filtering with a string', function() { + var searchText = element(by.model('searchText')); + searchText.clear(); + searchText.sendKeys('m'); + expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend'); + + searchText.clear(); + searchText.sendKeys('76'); + expectFriendNames(['John', 'Julie'], 'friend'); + }); + + it('should search in specific fields when filtering with a predicate object', function() { + var searchAny = element(by.model('search.$')); + searchAny.clear(); + searchAny.sendKeys('i'); + expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj'); + }); + it('should use a equal comparison when comparator is true', function() { + var searchName = element(by.model('search.name')); + var strict = element(by.model('strict')); + searchName.clear(); + searchName.sendKeys('Julie'); + strict.click(); + expectFriendNames(['Julie'], 'friendObj'); + }); + +
    + */ + function filterFilter() { + return function(array, expression, comparator) { + if (!isArrayLike(array)) { + if (array == null) { + return array; + } else { + throw minErr('filter')('notarray', 'Expected array but received: {0}', array); + } + } + + var expressionType = getTypeForFilter(expression); + var predicateFn; + var matchAgainstAnyProp; + + switch (expressionType) { + case 'function': + predicateFn = expression; + break; + case 'boolean': + case 'null': + case 'number': + case 'string': + matchAgainstAnyProp = true; + //jshint -W086 + case 'object': + //jshint +W086 + predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp); + break; + default: + return array; + } + + return Array.prototype.filter.call(array, predicateFn); + }; + } + + // Helper functions for `filterFilter` + function createPredicateFn(expression, comparator, matchAgainstAnyProp) { + var shouldMatchPrimitives = isObject(expression) && ('$' in expression); + var predicateFn; + + if (comparator === true) { + comparator = equals; + } else if (!isFunction(comparator)) { + comparator = function(actual, expected) { + if (isUndefined(actual)) { + // No substring matching against `undefined` + return false; + } + if ((actual === null) || (expected === null)) { + // No substring matching against `null`; only match against `null` + return actual === expected; + } + if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) { + // Should not compare primitives against objects, unless they have custom `toString` method + return false; + } + + actual = lowercase('' + actual); + expected = lowercase('' + expected); + return actual.indexOf(expected) !== -1; + }; + } + + predicateFn = function(item) { + if (shouldMatchPrimitives && !isObject(item)) { + return deepCompare(item, expression.$, comparator, false); + } + return deepCompare(item, expression, comparator, matchAgainstAnyProp); + }; + + return predicateFn; + } + + function deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) { + var actualType = getTypeForFilter(actual); + var expectedType = getTypeForFilter(expected); + + if ((expectedType === 'string') && (expected.charAt(0) === '!')) { + return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp); + } else if (isArray(actual)) { + // In case `actual` is an array, consider it a match + // if ANY of it's items matches `expected` + return actual.some(function(item) { + return deepCompare(item, expected, comparator, matchAgainstAnyProp); + }); + } + + switch (actualType) { + case 'object': + var key; + if (matchAgainstAnyProp) { + for (key in actual) { + if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) { + return true; + } + } + return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false); + } else if (expectedType === 'object') { + for (key in expected) { + var expectedVal = expected[key]; + if (isFunction(expectedVal) || isUndefined(expectedVal)) { + continue; + } + + var matchAnyProperty = key === '$'; + var actualVal = matchAnyProperty ? actual : actual[key]; + if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) { + return false; + } + } + return true; + } else { + return comparator(actual, expected); + } + break; + case 'function': + return false; + default: + return comparator(actual, expected); + } + } + + // Used for easily differentiating between `null` and actual `object` + function getTypeForFilter(val) { + return (val === null) ? 'null' : typeof val; + } + + /** + * @ngdoc filter + * @name currency + * @kind function + * + * @description + * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default + * symbol for current locale is used. + * + * @param {number} amount Input to filter. + * @param {string=} symbol Currency symbol or identifier to be displayed. + * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale + * @returns {string} Formatted number. + * + * + * @example + + + +
    +
    + default currency symbol ($): {{amount | currency}}
    + custom currency identifier (USD$): {{amount | currency:"USD$"}} + no fractions (0): {{amount | currency:"USD$":0}} +
    +
    + + it('should init with 1234.56', function() { + expect(element(by.id('currency-default')).getText()).toBe('$1,234.56'); + expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56'); + expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235'); + }); + it('should update', function() { + if (browser.params.browser == 'safari') { + // Safari does not understand the minus key. See + // https://github.com/angular/protractor/issues/481 + return; + } + element(by.model('amount')).clear(); + element(by.model('amount')).sendKeys('-1234'); + expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00'); + expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00'); + expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234'); + }); + +
    + */ + currencyFilter.$inject = ['$locale']; + function currencyFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(amount, currencySymbol, fractionSize) { + if (isUndefined(currencySymbol)) { + currencySymbol = formats.CURRENCY_SYM; + } + + if (isUndefined(fractionSize)) { + fractionSize = formats.PATTERNS[1].maxFrac; + } + + // if null or undefined pass it through + return (amount == null) + ? amount + : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). + replace(/\u00A4/g, currencySymbol); + }; + } + + /** + * @ngdoc filter + * @name number + * @kind function + * + * @description + * Formats a number as text. + * + * If the input is null or undefined, it will just be returned. + * If the input is infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned. + * If the input is not a number an empty string is returned. + * + * + * @param {number|string} number Number to format. + * @param {(number|string)=} fractionSize Number of decimal places to round the number to. + * If this is not provided then the fraction size is computed from the current locale's number + * formatting pattern. In the case of the default locale, it will be 3. + * @returns {string} Number rounded to decimalPlaces and places a “,†after each third digit. + * + * @example + + + +
    +
    + Default formatting: {{val | number}}
    + No fractions: {{val | number:0}}
    + Negative number: {{-val | number:4}} +
    +
    + + it('should format numbers', function() { + expect(element(by.id('number-default')).getText()).toBe('1,234.568'); + expect(element(by.binding('val | number:0')).getText()).toBe('1,235'); + expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679'); + }); + + it('should update', function() { + element(by.model('val')).clear(); + element(by.model('val')).sendKeys('3374.333'); + expect(element(by.id('number-default')).getText()).toBe('3,374.333'); + expect(element(by.binding('val | number:0')).getText()).toBe('3,374'); + expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330'); + }); + +
    + */ + + + numberFilter.$inject = ['$locale']; + function numberFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(number, fractionSize) { + + // if null or undefined pass it through + return (number == null) + ? number + : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, + fractionSize); + }; + } + + var DECIMAL_SEP = '.'; + function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { + if (isObject(number)) return ''; + + var isNegative = number < 0; + number = Math.abs(number); + + var isInfinity = number === Infinity; + if (!isInfinity && !isFinite(number)) return ''; + + var numStr = number + '', + formatedText = '', + hasExponent = false, + parts = []; + + if (isInfinity) formatedText = '\u221e'; + + if (!isInfinity && numStr.indexOf('e') !== -1) { + var match = numStr.match(/([\d\.]+)e(-?)(\d+)/); + if (match && match[2] == '-' && match[3] > fractionSize + 1) { + number = 0; + } else { + formatedText = numStr; + hasExponent = true; + } + } + + if (!isInfinity && !hasExponent) { + var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length; + + // determine fractionSize if it is not specified + if (isUndefined(fractionSize)) { + fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac); + } + + // safely round numbers in JS without hitting imprecisions of floating-point arithmetics + // inspired by: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize); + + var fraction = ('' + number).split(DECIMAL_SEP); + var whole = fraction[0]; + fraction = fraction[1] || ''; + + var i, pos = 0, + lgroup = pattern.lgSize, + group = pattern.gSize; + + if (whole.length >= (lgroup + group)) { + pos = whole.length - lgroup; + for (i = 0; i < pos; i++) { + if ((pos - i) % group === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + } + + for (i = pos; i < whole.length; i++) { + if ((whole.length - i) % lgroup === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + + // format fraction part. + while (fraction.length < fractionSize) { + fraction += '0'; + } + + if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize); + } else { + if (fractionSize > 0 && number < 1) { + formatedText = number.toFixed(fractionSize); + number = parseFloat(formatedText); + formatedText = formatedText.replace(DECIMAL_SEP, decimalSep); + } + } + + if (number === 0) { + isNegative = false; + } + + parts.push(isNegative ? pattern.negPre : pattern.posPre, + formatedText, + isNegative ? pattern.negSuf : pattern.posSuf); + return parts.join(''); + } + + function padNumber(num, digits, trim) { + var neg = ''; + if (num < 0) { + neg = '-'; + num = -num; + } + num = '' + num; + while (num.length < digits) num = '0' + num; + if (trim) { + num = num.substr(num.length - digits); + } + return neg + num; + } + + + function dateGetter(name, size, offset, trim) { + offset = offset || 0; + return function(date) { + var value = date['get' + name](); + if (offset > 0 || value > -offset) { + value += offset; + } + if (value === 0 && offset == -12) value = 12; + return padNumber(value, size, trim); + }; + } + + function dateStrGetter(name, shortForm) { + return function(date, formats) { + var value = date['get' + name](); + var get = uppercase(shortForm ? ('SHORT' + name) : name); + + return formats[get][value]; + }; + } + + function timeZoneGetter(date, formats, offset) { + var zone = -1 * offset; + var paddedZone = (zone >= 0) ? "+" : ""; + + paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + + padNumber(Math.abs(zone % 60), 2); + + return paddedZone; + } + + function getFirstThursdayOfYear(year) { + // 0 = index of January + var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay(); + // 4 = index of Thursday (+1 to account for 1st = 5) + // 11 = index of *next* Thursday (+1 account for 1st = 12) + return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst); + } + + function getThursdayThisWeek(datetime) { + return new Date(datetime.getFullYear(), datetime.getMonth(), + // 4 = index of Thursday + datetime.getDate() + (4 - datetime.getDay())); + } + + function weekGetter(size) { + return function(date) { + var firstThurs = getFirstThursdayOfYear(date.getFullYear()), + thisThurs = getThursdayThisWeek(date); + + var diff = +thisThurs - +firstThurs, + result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week + + return padNumber(result, size); + }; + } + + function ampmGetter(date, formats) { + return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; + } + + function eraGetter(date, formats) { + return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1]; + } + + function longEraGetter(date, formats) { + return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1]; + } + + var DATE_FORMATS = { + yyyy: dateGetter('FullYear', 4), + yy: dateGetter('FullYear', 2, 0, true), + y: dateGetter('FullYear', 1), + MMMM: dateStrGetter('Month'), + MMM: dateStrGetter('Month', true), + MM: dateGetter('Month', 2, 1), + M: dateGetter('Month', 1, 1), + dd: dateGetter('Date', 2), + d: dateGetter('Date', 1), + HH: dateGetter('Hours', 2), + H: dateGetter('Hours', 1), + hh: dateGetter('Hours', 2, -12), + h: dateGetter('Hours', 1, -12), + mm: dateGetter('Minutes', 2), + m: dateGetter('Minutes', 1), + ss: dateGetter('Seconds', 2), + s: dateGetter('Seconds', 1), + // while ISO 8601 requires fractions to be prefixed with `.` or `,` + // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions + sss: dateGetter('Milliseconds', 3), + EEEE: dateStrGetter('Day'), + EEE: dateStrGetter('Day', true), + a: ampmGetter, + Z: timeZoneGetter, + ww: weekGetter(2), + w: weekGetter(1), + G: eraGetter, + GG: eraGetter, + GGG: eraGetter, + GGGG: longEraGetter + }; + + var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/, + NUMBER_STRING = /^\-?\d+$/; + + /** + * @ngdoc filter + * @name date + * @kind function + * + * @description + * Formats `date` to a string based on the requested `format`. + * + * `format` string can be composed of the following elements: + * + * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) + * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) + * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) + * * `'MMMM'`: Month in year (January-December) + * * `'MMM'`: Month in year (Jan-Dec) + * * `'MM'`: Month in year, padded (01-12) + * * `'M'`: Month in year (1-12) + * * `'dd'`: Day in month, padded (01-31) + * * `'d'`: Day in month (1-31) + * * `'EEEE'`: Day in Week,(Sunday-Saturday) + * * `'EEE'`: Day in Week, (Sun-Sat) + * * `'HH'`: Hour in day, padded (00-23) + * * `'H'`: Hour in day (0-23) + * * `'hh'`: Hour in AM/PM, padded (01-12) + * * `'h'`: Hour in AM/PM, (1-12) + * * `'mm'`: Minute in hour, padded (00-59) + * * `'m'`: Minute in hour (0-59) + * * `'ss'`: Second in minute, padded (00-59) + * * `'s'`: Second in minute (0-59) + * * `'sss'`: Millisecond in second, padded (000-999) + * * `'a'`: AM/PM marker + * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) + * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year + * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year + * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD') + * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini') + * + * `format` string can also be one of the following predefined + * {@link guide/i18n localizable formats}: + * + * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale + * (e.g. Sep 3, 2010 12:05:08 PM) + * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM) + * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale + * (e.g. Friday, September 3, 2010) + * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010) + * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010) + * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) + * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM) + * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM) + * + * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g. + * `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence + * (e.g. `"h 'o''clock'"`). + * + * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or + * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its + * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is + * specified in the string input, the time is considered to be in the local timezone. + * @param {string=} format Formatting rules (see Description). If not specified, + * `mediumDate` is used. + * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the + * continental US time zone abbreviations, but for general use, use a time zone offset, for + * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian) + * If not specified, the timezone of the browser will be used. + * @returns {string} Formatted string or the input if input is not recognized as date/millis. + * + * @example + + + {{1288323623006 | date:'medium'}}: + {{1288323623006 | date:'medium'}}
    + {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}: + {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
    + {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}: + {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
    + {{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}: + {{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}
    +
    + + it('should format date', function() { + expect(element(by.binding("1288323623006 | date:'medium'")).getText()). + toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/); + expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()). + toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/); + expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()). + toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/); + expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()). + toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/); + }); + +
    + */ + dateFilter.$inject = ['$locale']; + function dateFilter($locale) { + + + var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; + // 1 2 3 4 5 6 7 8 9 10 11 + function jsonStringToDate(string) { + var match; + if (match = string.match(R_ISO8601_STR)) { + var date = new Date(0), + tzHour = 0, + tzMin = 0, + dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, + timeSetter = match[8] ? date.setUTCHours : date.setHours; + + if (match[9]) { + tzHour = toInt(match[9] + match[10]); + tzMin = toInt(match[9] + match[11]); + } + dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); + var h = toInt(match[4] || 0) - tzHour; + var m = toInt(match[5] || 0) - tzMin; + var s = toInt(match[6] || 0); + var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); + timeSetter.call(date, h, m, s, ms); + return date; + } + return string; + } + + + return function(date, format, timezone) { + var text = '', + parts = [], + fn, match; + + format = format || 'mediumDate'; + format = $locale.DATETIME_FORMATS[format] || format; + if (isString(date)) { + date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date); + } + + if (isNumber(date)) { + date = new Date(date); + } + + if (!isDate(date) || !isFinite(date.getTime())) { + return date; + } + + while (format) { + match = DATE_FORMATS_SPLIT.exec(format); + if (match) { + parts = concat(parts, match, 1); + format = parts.pop(); + } else { + parts.push(format); + format = null; + } + } + + var dateTimezoneOffset = date.getTimezoneOffset(); + if (timezone) { + dateTimezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset()); + date = convertTimezoneToLocal(date, timezone, true); + } + forEach(parts, function(value) { + fn = DATE_FORMATS[value]; + text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset) + : value.replace(/(^'|'$)/g, '').replace(/''/g, "'"); + }); + + return text; + }; + } + + + /** + * @ngdoc filter + * @name json + * @kind function + * + * @description + * Allows you to convert a JavaScript object into JSON string. + * + * This filter is mostly useful for debugging. When using the double curly {{value}} notation + * the binding is automatically converted to JSON. + * + * @param {*} object Any JavaScript object (including arrays and primitive types) to filter. + * @param {number=} spacing The number of spaces to use per indentation, defaults to 2. + * @returns {string} JSON string. + * + * + * @example + + +
    {{ {'name':'value'} | json }}
    +
    {{ {'name':'value'} | json:4 }}
    +
    + + it('should jsonify filtered objects', function() { + expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/); + expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/); + }); + +
    + * + */ + function jsonFilter() { + return function(object, spacing) { + if (isUndefined(spacing)) { + spacing = 2; + } + return toJson(object, spacing); + }; + } + + + /** + * @ngdoc filter + * @name lowercase + * @kind function + * @description + * Converts string to lowercase. + * @see angular.lowercase + */ + var lowercaseFilter = valueFn(lowercase); + + + /** + * @ngdoc filter + * @name uppercase + * @kind function + * @description + * Converts string to uppercase. + * @see angular.uppercase + */ + var uppercaseFilter = valueFn(uppercase); + + /** + * @ngdoc filter + * @name limitTo + * @kind function + * + * @description + * Creates a new array or string containing only a specified number of elements. The elements + * are taken from either the beginning or the end of the source array, string or number, as specified by + * the value and sign (positive or negative) of `limit`. If a number is used as input, it is + * converted to a string. + * + * @param {Array|string|number} input Source array, string or number to be limited. + * @param {string|number} limit The length of the returned array or string. If the `limit` number + * is positive, `limit` number of items from the beginning of the source array/string are copied. + * If the number is negative, `limit` number of items from the end of the source array/string + * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined, + * the input will be returned unchanged. + * @param {(string|number)=} begin Index at which to begin limitation. As a negative index, `begin` + * indicates an offset from the end of `input`. Defaults to `0`. + * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array + * had less than `limit` elements. + * + * @example + + + +
    + +

    Output numbers: {{ numbers | limitTo:numLimit }}

    + +

    Output letters: {{ letters | limitTo:letterLimit }}

    + +

    Output long number: {{ longNumber | limitTo:longNumberLimit }}

    +
    +
    + + var numLimitInput = element(by.model('numLimit')); + var letterLimitInput = element(by.model('letterLimit')); + var longNumberLimitInput = element(by.model('longNumberLimit')); + var limitedNumbers = element(by.binding('numbers | limitTo:numLimit')); + var limitedLetters = element(by.binding('letters | limitTo:letterLimit')); + var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit')); + + it('should limit the number array to first three items', function() { + expect(numLimitInput.getAttribute('value')).toBe('3'); + expect(letterLimitInput.getAttribute('value')).toBe('3'); + expect(longNumberLimitInput.getAttribute('value')).toBe('3'); + expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]'); + expect(limitedLetters.getText()).toEqual('Output letters: abc'); + expect(limitedLongNumber.getText()).toEqual('Output long number: 234'); + }); + + // There is a bug in safari and protractor that doesn't like the minus key + // it('should update the output when -3 is entered', function() { + // numLimitInput.clear(); + // numLimitInput.sendKeys('-3'); + // letterLimitInput.clear(); + // letterLimitInput.sendKeys('-3'); + // longNumberLimitInput.clear(); + // longNumberLimitInput.sendKeys('-3'); + // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]'); + // expect(limitedLetters.getText()).toEqual('Output letters: ghi'); + // expect(limitedLongNumber.getText()).toEqual('Output long number: 342'); + // }); + + it('should not exceed the maximum size of input array', function() { + numLimitInput.clear(); + numLimitInput.sendKeys('100'); + letterLimitInput.clear(); + letterLimitInput.sendKeys('100'); + longNumberLimitInput.clear(); + longNumberLimitInput.sendKeys('100'); + expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]'); + expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi'); + expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342'); + }); + +
    + */ + function limitToFilter() { + return function(input, limit, begin) { + if (Math.abs(Number(limit)) === Infinity) { + limit = Number(limit); + } else { + limit = toInt(limit); + } + if (isNaN(limit)) return input; + + if (isNumber(input)) input = input.toString(); + if (!isArray(input) && !isString(input)) return input; + + begin = (!begin || isNaN(begin)) ? 0 : toInt(begin); + begin = (begin < 0 && begin >= -input.length) ? input.length + begin : begin; + + if (limit >= 0) { + return input.slice(begin, begin + limit); + } else { + if (begin === 0) { + return input.slice(limit, input.length); + } else { + return input.slice(Math.max(0, begin + limit), begin); + } + } + }; + } + + /** + * @ngdoc filter + * @name orderBy + * @kind function + * + * @description + * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically + * for strings and numerically for numbers. Note: if you notice numbers are not being sorted + * as expected, make sure they are actually being saved as numbers and not strings. + * + * @param {Array} array The array to sort. + * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be + * used by the comparator to determine the order of elements. + * + * Can be one of: + * + * - `function`: Getter function. The result of this function will be sorted using the + * `<`, `===`, `>` operator. + * - `string`: An Angular expression. The result of this expression is used to compare elements + * (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by + * 3 first characters of a property called `name`). The result of a constant expression + * is interpreted as a property name to be used in comparisons (for example `"special name"` + * to sort object by the value of their `special name` property). An expression can be + * optionally prefixed with `+` or `-` to control ascending or descending sort order + * (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array + * element itself is used to compare where sorting. + * - `Array`: An array of function or string predicates. The first predicate in the array + * is used for sorting, but when two items are equivalent, the next predicate is used. + * + * If the predicate is missing or empty then it defaults to `'+'`. + * + * @param {boolean=} reverse Reverse the order of the array. + * @returns {Array} Sorted copy of the source array. + * + * + * @example + * The example below demonstrates a simple ngRepeat, where the data is sorted + * by age in descending order (predicate is set to `'-age'`). + * `reverse` is not set, which means it defaults to `false`. + + + +
    + + + + + + + + + + + +
    NamePhone NumberAge
    {{friend.name}}{{friend.phone}}{{friend.age}}
    +
    +
    +
    + * + * The predicate and reverse parameters can be controlled dynamically through scope properties, + * as shown in the next example. + * @example + + + + +
    +
    Sorting predicate = {{predicate}}; reverse = {{reverse}}
    +
    + [ unsorted ] + + + + + + + + + + + +
    + Name + + + Phone Number + + + Age + +
    {{friend.name}}{{friend.phone}}{{friend.age}}
    +
    +
    +
    + * + * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the + * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the + * desired parameters. + * + * Example: + * + * @example + + +
    + + + + + + + + + + + +
    Name + (^)Phone NumberAge
    {{friend.name}}{{friend.phone}}{{friend.age}}
    +
    +
    + + + angular.module('orderByExample', []) + .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) { + var orderBy = $filter('orderBy'); + $scope.friends = [ + { name: 'John', phone: '555-1212', age: 10 }, + { name: 'Mary', phone: '555-9876', age: 19 }, + { name: 'Mike', phone: '555-4321', age: 21 }, + { name: 'Adam', phone: '555-5678', age: 35 }, + { name: 'Julie', phone: '555-8765', age: 29 } + ]; + $scope.order = function(predicate, reverse) { + $scope.friends = orderBy($scope.friends, predicate, reverse); + }; + $scope.order('-age',false); + }]); + +
    + */ + orderByFilter.$inject = ['$parse']; + function orderByFilter($parse) { + return function(array, sortPredicate, reverseOrder) { + + if (!(isArrayLike(array))) return array; + + if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; } + if (sortPredicate.length === 0) { sortPredicate = ['+']; } + + var predicates = processPredicates(sortPredicate, reverseOrder); + // Add a predicate at the end that evaluates to the element index. This makes the + // sort stable as it works as a tie-breaker when all the input predicates cannot + // distinguish between two elements. + predicates.push({ get: function() { return {}; }, descending: reverseOrder ? -1 : 1}); + + // The next three lines are a version of a Swartzian Transform idiom from Perl + // (sometimes called the Decorate-Sort-Undecorate idiom) + // See https://en.wikipedia.org/wiki/Schwartzian_transform + var compareValues = Array.prototype.map.call(array, getComparisonObject); + compareValues.sort(doComparison); + array = compareValues.map(function(item) { return item.value; }); + + return array; + + function getComparisonObject(value, index) { + return { + value: value, + predicateValues: predicates.map(function(predicate) { + return getPredicateValue(predicate.get(value), index); + }) + }; + } + + function doComparison(v1, v2) { + var result = 0; + for (var index=0, length = predicates.length; index < length; ++index) { + result = compare(v1.predicateValues[index], v2.predicateValues[index]) * predicates[index].descending; + if (result) break; + } + return result; + } + }; + + function processPredicates(sortPredicate, reverseOrder) { + reverseOrder = reverseOrder ? -1 : 1; + return sortPredicate.map(function(predicate) { + var descending = 1, get = identity; + + if (isFunction(predicate)) { + get = predicate; + } else if (isString(predicate)) { + if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) { + descending = predicate.charAt(0) == '-' ? -1 : 1; + predicate = predicate.substring(1); + } + if (predicate !== '') { + get = $parse(predicate); + if (get.constant) { + var key = get(); + get = function(value) { return value[key]; }; + } + } + } + return { get: get, descending: descending * reverseOrder }; + }); + } + + function isPrimitive(value) { + switch (typeof value) { + case 'number': /* falls through */ + case 'boolean': /* falls through */ + case 'string': + return true; + default: + return false; + } + } + + function objectValue(value, index) { + // If `valueOf` is a valid function use that + if (typeof value.valueOf === 'function') { + value = value.valueOf(); + if (isPrimitive(value)) return value; + } + // If `toString` is a valid function and not the one from `Object.prototype` use that + if (hasCustomToString(value)) { + value = value.toString(); + if (isPrimitive(value)) return value; + } + // We have a basic object so we use the position of the object in the collection + return index; + } + + function getPredicateValue(value, index) { + var type = typeof value; + if (value === null) { + type = 'string'; + value = 'null'; + } else if (type === 'string') { + value = value.toLowerCase(); + } else if (type === 'object') { + value = objectValue(value, index); + } + return { value: value, type: type }; + } + + function compare(v1, v2) { + var result = 0; + if (v1.type === v2.type) { + if (v1.value !== v2.value) { + result = v1.value < v2.value ? -1 : 1; + } + } else { + result = v1.type < v2.type ? -1 : 1; + } + return result; + } + } + + function ngDirective(directive) { + if (isFunction(directive)) { + directive = { + link: directive + }; + } + directive.restrict = directive.restrict || 'AC'; + return valueFn(directive); + } + + /** + * @ngdoc directive + * @name a + * @restrict E + * + * @description + * Modifies the default behavior of the html A tag so that the default action is prevented when + * the href attribute is empty. + * + * This change permits the easy creation of action links with the `ngClick` directive + * without changing the location or causing page reloads, e.g.: + * `Add Item` + */ + var htmlAnchorDirective = valueFn({ + restrict: 'E', + compile: function(element, attr) { + if (!attr.href && !attr.xlinkHref) { + return function(scope, element) { + // If the linked element is not an anchor tag anymore, do nothing + if (element[0].nodeName.toLowerCase() !== 'a') return; + + // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. + var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? + 'xlink:href' : 'href'; + element.on('click', function(event) { + // if we have no href url, then don't navigate anywhere. + if (!element.attr(href)) { + event.preventDefault(); + } + }); + }; + } + } + }); + + /** + * @ngdoc directive + * @name ngHref + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in an href attribute will + * make the link go to the wrong URL if the user clicks it before + * Angular has a chance to replace the `{{hash}}` markup with its + * value. Until Angular replaces the markup the link will be broken + * and will most likely return a 404 error. The `ngHref` directive + * solves this problem. + * + * The wrong way to write it: + * ```html + * link1 + * ``` + * + * The correct way to write it: + * ```html + * link1 + * ``` + * + * @element A + * @param {template} ngHref any string which can contain `{{}}` markup. + * + * @example + * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes + * in links and their different behaviors: + + +
    + link 1 (link, don't reload)
    + link 2 (link, don't reload)
    + link 3 (link, reload!)
    + anchor (link, don't reload)
    + anchor (no link)
    + link (link, change location) +
    + + it('should execute ng-click but not reload when href without value', function() { + element(by.id('link-1')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('1'); + expect(element(by.id('link-1')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click but not reload when href empty string', function() { + element(by.id('link-2')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('2'); + expect(element(by.id('link-2')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click and change url when ng-href specified', function() { + expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/); + + element(by.id('link-3')).click(); + + // At this point, we navigate away from an Angular page, so we need + // to use browser.driver to get the base webdriver. + + browser.wait(function() { + return browser.driver.getCurrentUrl().then(function(url) { + return url.match(/\/123$/); + }); + }, 5000, 'page should navigate to /123'); + }); + + it('should execute ng-click but not reload when href empty string and name specified', function() { + element(by.id('link-4')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('4'); + expect(element(by.id('link-4')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click but not reload when no href but name specified', function() { + element(by.id('link-5')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('5'); + expect(element(by.id('link-5')).getAttribute('href')).toBe(null); + }); + + it('should only change url when only ng-href', function() { + element(by.model('value')).clear(); + element(by.model('value')).sendKeys('6'); + expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/); + + element(by.id('link-6')).click(); + + // At this point, we navigate away from an Angular page, so we need + // to use browser.driver to get the base webdriver. + browser.wait(function() { + return browser.driver.getCurrentUrl().then(function(url) { + return url.match(/\/6$/); + }); + }, 5000, 'page should navigate to /6'); + }); + +
    + */ + + /** + * @ngdoc directive + * @name ngSrc + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in a `src` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrc` directive solves this problem. + * + * The buggy way to write it: + * ```html + * Description + * ``` + * + * The correct way to write it: + * ```html + * Description + * ``` + * + * @element IMG + * @param {template} ngSrc any string which can contain `{{}}` markup. + */ + + /** + * @ngdoc directive + * @name ngSrcset + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrcset` directive solves this problem. + * + * The buggy way to write it: + * ```html + * Description + * ``` + * + * The correct way to write it: + * ```html + * Description + * ``` + * + * @element IMG + * @param {template} ngSrcset any string which can contain `{{}}` markup. + */ + + /** + * @ngdoc directive + * @name ngDisabled + * @restrict A + * @priority 100 + * + * @description + * + * This directive sets the `disabled` attribute on the element if the + * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy. + * + * A special directive is necessary because we cannot use interpolation inside the `disabled` + * attribute. The following example would make the button enabled on Chrome/Firefox + * but not on older IEs: + * + * ```html + * + *
    + * + *
    + * ``` + * + * This is because the HTML specification does not require browsers to preserve the values of + * boolean attributes such as `disabled` (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * + * @example + + +
    + +
    + + it('should toggle button', function() { + expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy(); + element(by.model('checked')).click(); + expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy(); + }); + +
    + * + * @element INPUT + * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, + * then the `disabled` attribute will be set on the element + */ + + + /** + * @ngdoc directive + * @name ngChecked + * @restrict A + * @priority 100 + * + * @description + * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy. + * + * Note that this directive should not be used together with {@link ngModel `ngModel`}, + * as this can lead to unexpected behavior. + * + * ### Why do we need `ngChecked`? + * + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as checked. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngChecked` directive solves this problem for the `checked` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + +
    + +
    + + it('should check both checkBoxes', function() { + expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy(); + element(by.model('master')).click(); + expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy(); + }); + +
    + * + * @element INPUT + * @param {expression} ngChecked If the {@link guide/expression expression} is truthy, + * then the `checked` attribute will be set on the element + */ + + + /** + * @ngdoc directive + * @name ngReadonly + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as readonly. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngReadonly` directive solves this problem for the `readonly` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + +
    + +
    + + it('should toggle readonly attr', function() { + expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy(); + element(by.model('checked')).click(); + expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy(); + }); + +
    + * + * @element INPUT + * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy, + * then special attribute "readonly" will be set on the element + */ + + + /** + * @ngdoc directive + * @name ngSelected + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as selected. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngSelected` directive solves this problem for the `selected` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * + * @example + + +
    + +
    + + it('should select Greetings!', function() { + expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy(); + element(by.model('selected')).click(); + expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy(); + }); + +
    + * + * @element OPTION + * @param {expression} ngSelected If the {@link guide/expression expression} is truthy, + * then special attribute "selected" will be set on the element + */ + + /** + * @ngdoc directive + * @name ngOpen + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as open. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngOpen` directive solves this problem for the `open` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + +
    +
    + Show/Hide me +
    +
    + + it('should toggle open', function() { + expect(element(by.id('details')).getAttribute('open')).toBeFalsy(); + element(by.model('open')).click(); + expect(element(by.id('details')).getAttribute('open')).toBeTruthy(); + }); + +
    + * + * @element DETAILS + * @param {expression} ngOpen If the {@link guide/expression expression} is truthy, + * then special attribute "open" will be set on the element + */ + + var ngAttributeAliasDirectives = {}; + + // boolean attrs are evaluated + forEach(BOOLEAN_ATTR, function(propName, attrName) { + // binding to multiple is not supported + if (propName == "multiple") return; + + function defaultLinkFn(scope, element, attr) { + scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { + attr.$set(attrName, !!value); + }); + } + + var normalized = directiveNormalize('ng-' + attrName); + var linkFn = defaultLinkFn; + + if (propName === 'checked') { + linkFn = function(scope, element, attr) { + // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input + if (attr.ngModel !== attr[normalized]) { + defaultLinkFn(scope, element, attr); + } + }; + } + + ngAttributeAliasDirectives[normalized] = function() { + return { + restrict: 'A', + priority: 100, + link: linkFn + }; + }; + }); + + // aliased input attrs are evaluated + forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) { + ngAttributeAliasDirectives[ngAttr] = function() { + return { + priority: 100, + link: function(scope, element, attr) { + //special case ngPattern when a literal regular expression value + //is used as the expression (this way we don't have to watch anything). + if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) == "/") { + var match = attr.ngPattern.match(REGEX_STRING_REGEXP); + if (match) { + attr.$set("ngPattern", new RegExp(match[1], match[2])); + return; + } + } + + scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) { + attr.$set(ngAttr, value); + }); + } + }; + }; + }); + + // ng-src, ng-srcset, ng-href are interpolated + forEach(['src', 'srcset', 'href'], function(attrName) { + var normalized = directiveNormalize('ng-' + attrName); + ngAttributeAliasDirectives[normalized] = function() { + return { + priority: 99, // it needs to run after the attributes are interpolated + link: function(scope, element, attr) { + var propName = attrName, + name = attrName; + + if (attrName === 'href' && + toString.call(element.prop('href')) === '[object SVGAnimatedString]') { + name = 'xlinkHref'; + attr.$attr[name] = 'xlink:href'; + propName = null; + } + + attr.$observe(normalized, function(value) { + if (!value) { + if (attrName === 'href') { + attr.$set(name, null); + } + return; + } + + attr.$set(name, value); + + // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist + // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need + // to set the property as well to achieve the desired effect. + // we use attr[attrName] value since $set can sanitize the url. + if (msie && propName) element.prop(propName, attr[name]); + }); + } + }; + }; + }); + + /* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true + */ + var nullFormCtrl = { + $addControl: noop, + $$renameControl: nullFormRenameControl, + $removeControl: noop, + $setValidity: noop, + $setDirty: noop, + $setPristine: noop, + $setSubmitted: noop + }, + SUBMITTED_CLASS = 'ng-submitted'; + + function nullFormRenameControl(control, name) { + control.$name = name; + } + + /** + * @ngdoc type + * @name form.FormController + * + * @property {boolean} $pristine True if user has not interacted with the form yet. + * @property {boolean} $dirty True if user has already interacted with the form. + * @property {boolean} $valid True if all of the containing forms and controls are valid. + * @property {boolean} $invalid True if at least one containing control or form is invalid. + * @property {boolean} $pending True if at least one containing control or form is pending. + * @property {boolean} $submitted True if user has submitted the form even if its invalid. + * + * @property {Object} $error Is an object hash, containing references to controls or + * forms with failing validators, where: + * + * - keys are validation tokens (error names), + * - values are arrays of controls or forms that have a failing validator for given error name. + * + * Built-in validation tokens: + * + * - `email` + * - `max` + * - `maxlength` + * - `min` + * - `minlength` + * - `number` + * - `pattern` + * - `required` + * - `url` + * - `date` + * - `datetimelocal` + * - `time` + * - `week` + * - `month` + * + * @description + * `FormController` keeps track of all its controls and nested forms as well as the state of them, + * such as being valid/invalid or dirty/pristine. + * + * Each {@link ng.directive:form form} directive creates an instance + * of `FormController`. + * + */ + //asks for $scope to fool the BC controller module + FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate']; + function FormController(element, attrs, $scope, $animate, $interpolate) { + var form = this, + controls = []; + + // init state + form.$error = {}; + form.$$success = {}; + form.$pending = undefined; + form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope); + form.$dirty = false; + form.$pristine = true; + form.$valid = true; + form.$invalid = false; + form.$submitted = false; + form.$$parentForm = nullFormCtrl; + + /** + * @ngdoc method + * @name form.FormController#$rollbackViewValue + * + * @description + * Rollback all form controls pending updates to the `$modelValue`. + * + * Updates may be pending by a debounced event or because the input is waiting for a some future + * event defined in `ng-model-options`. This method is typically needed by the reset button of + * a form that uses `ng-model-options` to pend updates. + */ + form.$rollbackViewValue = function() { + forEach(controls, function(control) { + control.$rollbackViewValue(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$commitViewValue + * + * @description + * Commit all form controls pending updates to the `$modelValue`. + * + * Updates may be pending by a debounced event or because the input is waiting for a some future + * event defined in `ng-model-options`. This method is rarely needed as `NgModelController` + * usually handles calling this in response to input events. + */ + form.$commitViewValue = function() { + forEach(controls, function(control) { + control.$commitViewValue(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$addControl + * @param {object} control control object, either a {@link form.FormController} or an + * {@link ngModel.NgModelController} + * + * @description + * Register a control with the form. Input elements using ngModelController do this automatically + * when they are linked. + * + * Note that the current state of the control will not be reflected on the new parent form. This + * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine` + * state. + * + * However, if the method is used programmatically, for example by adding dynamically created controls, + * or controls that have been previously removed without destroying their corresponding DOM element, + * it's the developers responsiblity to make sure the current state propagates to the parent form. + * + * For example, if an input control is added that is already `$dirty` and has `$error` properties, + * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form. + */ + form.$addControl = function(control) { + // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored + // and not added to the scope. Now we throw an error. + assertNotHasOwnProperty(control.$name, 'input'); + controls.push(control); + + if (control.$name) { + form[control.$name] = control; + } + + control.$$parentForm = form; + }; + + // Private API: rename a form control + form.$$renameControl = function(control, newName) { + var oldName = control.$name; + + if (form[oldName] === control) { + delete form[oldName]; + } + form[newName] = control; + control.$name = newName; + }; + + /** + * @ngdoc method + * @name form.FormController#$removeControl + * @param {object} control control object, either a {@link form.FormController} or an + * {@link ngModel.NgModelController} + * + * @description + * Deregister a control from the form. + * + * Input elements using ngModelController do this automatically when they are destroyed. + * + * Note that only the removed control's validation state (`$errors`etc.) will be removed from the + * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be + * different from case to case. For example, removing the only `$dirty` control from a form may or + * may not mean that the form is still `$dirty`. + */ + form.$removeControl = function(control) { + if (control.$name && form[control.$name] === control) { + delete form[control.$name]; + } + forEach(form.$pending, function(value, name) { + form.$setValidity(name, null, control); + }); + forEach(form.$error, function(value, name) { + form.$setValidity(name, null, control); + }); + forEach(form.$$success, function(value, name) { + form.$setValidity(name, null, control); + }); + + arrayRemove(controls, control); + control.$$parentForm = nullFormCtrl; + }; + + + /** + * @ngdoc method + * @name form.FormController#$setValidity + * + * @description + * Sets the validity of a form control. + * + * This method will also propagate to parent forms. + */ + addSetValidityMethod({ + ctrl: this, + $element: element, + set: function(object, property, controller) { + var list = object[property]; + if (!list) { + object[property] = [controller]; + } else { + var index = list.indexOf(controller); + if (index === -1) { + list.push(controller); + } + } + }, + unset: function(object, property, controller) { + var list = object[property]; + if (!list) { + return; + } + arrayRemove(list, controller); + if (list.length === 0) { + delete object[property]; + } + }, + $animate: $animate + }); + + /** + * @ngdoc method + * @name form.FormController#$setDirty + * + * @description + * Sets the form to a dirty state. + * + * This method can be called to add the 'ng-dirty' class and set the form to a dirty + * state (ng-dirty class). This method will also propagate to parent forms. + */ + form.$setDirty = function() { + $animate.removeClass(element, PRISTINE_CLASS); + $animate.addClass(element, DIRTY_CLASS); + form.$dirty = true; + form.$pristine = false; + form.$$parentForm.$setDirty(); + }; + + /** + * @ngdoc method + * @name form.FormController#$setPristine + * + * @description + * Sets the form to its pristine state. + * + * This method can be called to remove the 'ng-dirty' class and set the form to its pristine + * state (ng-pristine class). This method will also propagate to all the controls contained + * in this form. + * + * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after + * saving or resetting it. + */ + form.$setPristine = function() { + $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); + form.$dirty = false; + form.$pristine = true; + form.$submitted = false; + forEach(controls, function(control) { + control.$setPristine(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$setUntouched + * + * @description + * Sets the form to its untouched state. + * + * This method can be called to remove the 'ng-touched' class and set the form controls to their + * untouched state (ng-untouched class). + * + * Setting a form controls back to their untouched state is often useful when setting the form + * back to its pristine state. + */ + form.$setUntouched = function() { + forEach(controls, function(control) { + control.$setUntouched(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$setSubmitted + * + * @description + * Sets the form to its submitted state. + */ + form.$setSubmitted = function() { + $animate.addClass(element, SUBMITTED_CLASS); + form.$submitted = true; + form.$$parentForm.$setSubmitted(); + }; + } + + /** + * @ngdoc directive + * @name ngForm + * @restrict EAC + * + * @description + * Nestable alias of {@link ng.directive:form `form`} directive. HTML + * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a + * sub-group of controls needs to be determined. + * + * Note: the purpose of `ngForm` is to group controls, + * but not to be a replacement for the `
    ` tag with all of its capabilities + * (e.g. posting to the server, ...). + * + * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into + * related scope, under this name. + * + */ + + /** + * @ngdoc directive + * @name form + * @restrict E + * + * @description + * Directive that instantiates + * {@link form.FormController FormController}. + * + * If the `name` attribute is specified, the form controller is published onto the current scope under + * this name. + * + * # Alias: {@link ng.directive:ngForm `ngForm`} + * + * In Angular, forms can be nested. This means that the outer form is valid when all of the child + * forms are valid as well. However, browsers do not allow nesting of `` elements, so + * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to + * `` but can be nested. This allows you to have nested forms, which is very useful when + * using Angular validation directives in forms that are dynamically generated using the + * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name` + * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an + * `ngForm` directive and nest these in an outer `form` element. + * + * + * # CSS classes + * - `ng-valid` is set if the form is valid. + * - `ng-invalid` is set if the form is invalid. + * - `ng-pending` is set if the form is pending. + * - `ng-pristine` is set if the form is pristine. + * - `ng-dirty` is set if the form is dirty. + * - `ng-submitted` is set if the form was submitted. + * + * Keep in mind that ngAnimate can detect each of these classes when added and removed. + * + * + * # Submitting a form and preventing the default action + * + * Since the role of forms in client-side Angular applications is different than in classical + * roundtrip apps, it is desirable for the browser not to translate the form submission into a full + * page reload that sends the data to the server. Instead some javascript logic should be triggered + * to handle the form submission in an application-specific way. + * + * For this reason, Angular prevents the default action (form submission to the server) unless the + * `` element has an `action` attribute specified. + * + * You can use one of the following two ways to specify what javascript method should be called when + * a form is submitted: + * + * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element + * - {@link ng.directive:ngClick ngClick} directive on the first + * button or input field of type submit (input[type=submit]) + * + * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit} + * or {@link ng.directive:ngClick ngClick} directives. + * This is because of the following form submission rules in the HTML specification: + * + * - If a form has only one input field then hitting enter in this field triggers form submit + * (`ngSubmit`) + * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter + * doesn't trigger submit + * - if a form has one or more input fields and one or more buttons or input[type=submit] then + * hitting enter in any of the input fields will trigger the click handler on the *first* button or + * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) + * + * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is + * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` + * to have access to the updated model. + * + * ## Animation Hooks + * + * Animations in ngForm are triggered when any of the associated CSS classes are added and removed. + * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any + * other validations that are performed within the form. Animations in ngForm are similar to how + * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well + * as JS animations. + * + * The following example shows a simple way to utilize CSS transitions to style a form element + * that has been rendered as invalid after it has been validated: + * + *
    +	 * //be sure to include ngAnimate as a module to hook into more
    +	 * //advanced animations
    +	 * .my-form {
    +	 *   transition:0.5s linear all;
    +	 *   background: white;
    +	 * }
    +	 * .my-form.ng-invalid {
    +	 *   background: red;
    +	 *   color:white;
    +	 * }
    +	 * 
    + * + * @example + + + + + + userType: + Required!
    + userType = {{userType}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    + +
    + + it('should initialize to model', function() { + var userType = element(by.binding('userType')); + var valid = element(by.binding('myForm.input.$valid')); + + expect(userType.getText()).toContain('guest'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + var userType = element(by.binding('userType')); + var valid = element(by.binding('myForm.input.$valid')); + var userInput = element(by.model('userType')); + + userInput.clear(); + userInput.sendKeys(''); + + expect(userType.getText()).toEqual('userType ='); + expect(valid.getText()).toContain('false'); + }); + +
    + * + * @param {string=} name Name of the form. If specified, the form controller will be published into + * related scope, under this name. + */ + var formDirectiveFactory = function(isNgForm) { + return ['$timeout', '$parse', function($timeout, $parse) { + var formDirective = { + name: 'form', + restrict: isNgForm ? 'EAC' : 'E', + require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form + controller: FormController, + compile: function ngFormCompile(formElement, attr) { + // Setup initial state of the control + formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS); + + var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false); + + return { + pre: function ngFormPreLink(scope, formElement, attr, ctrls) { + var controller = ctrls[0]; + + // if `action` attr is not present on the form, prevent the default action (submission) + if (!('action' in attr)) { + // we can't use jq events because if a form is destroyed during submission the default + // action is not prevented. see #1238 + // + // IE 9 is not affected because it doesn't fire a submit event and try to do a full + // page reload if the form was destroyed by submission of the form via a click handler + // on a button in the form. Looks like an IE9 specific bug. + var handleFormSubmission = function(event) { + scope.$apply(function() { + controller.$commitViewValue(); + controller.$setSubmitted(); + }); + + event.preventDefault(); + }; + + addEventListenerFn(formElement[0], 'submit', handleFormSubmission); + + // unregister the preventDefault listener so that we don't not leak memory but in a + // way that will achieve the prevention of the default action. + formElement.on('$destroy', function() { + $timeout(function() { + removeEventListenerFn(formElement[0], 'submit', handleFormSubmission); + }, 0, false); + }); + } + + var parentFormCtrl = ctrls[1] || controller.$$parentForm; + parentFormCtrl.$addControl(controller); + + var setter = nameAttr ? getSetter(controller.$name) : noop; + + if (nameAttr) { + setter(scope, controller); + attr.$observe(nameAttr, function(newValue) { + if (controller.$name === newValue) return; + setter(scope, undefined); + controller.$$parentForm.$$renameControl(controller, newValue); + setter = getSetter(controller.$name); + setter(scope, controller); + }); + } + formElement.on('$destroy', function() { + controller.$$parentForm.$removeControl(controller); + setter(scope, undefined); + extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards + }); + } + }; + } + }; + + return formDirective; + + function getSetter(expression) { + if (expression === '') { + //create an assignable expression, so forms with an empty name can be renamed later + return $parse('this[""]').assign; + } + return $parse(expression).assign || noop; + } + }]; + }; + + var formDirective = formDirectiveFactory(); + var ngFormDirective = formDirectiveFactory(true); + + /* global VALID_CLASS: false, + INVALID_CLASS: false, + PRISTINE_CLASS: false, + DIRTY_CLASS: false, + UNTOUCHED_CLASS: false, + TOUCHED_CLASS: false, + ngModelMinErr: false, + */ + + // Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231 + var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/; + var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; + var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i; + var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/; + var DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/; + var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; + var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/; + var MONTH_REGEXP = /^(\d{4})-(\d\d)$/; + var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; + + var inputType = { + + /** + * @ngdoc input + * @name input[text] + * + * @description + * Standard HTML text input with angular data binding, inherited by most of the `input` elements. + * + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Adds `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object, then this is used directly. + * If the expression evaluates to a string, then it will be converted to a RegExp + * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to + * `new RegExp('^abc$')`.
    + * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to + * start at the index of the last search's match, thus not taking the whole input value into + * account. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + * This parameter is ignored for input[type=password] controls, which will never trim the + * input. + * + * @example + + + +
    + +
    + + Required! + + Single word only! +
    + text = {{example.text}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + var text = element(by.binding('example.text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('guest'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if multi word', function() { + input.clear(); + input.sendKeys('hello world'); + + expect(valid.getText()).toContain('false'); + }); + +
    + */ + 'text': textInputType, + + /** + * @ngdoc input + * @name input[date] + * + * @description + * Input with date validation and transformation. In browsers that do not yet support + * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 + * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many + * modern browsers do not yet support this input type, it is important to provide cues to users on the + * expected input format via a placeholder or label. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a + * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute + * (e.g. `min="{{minDate | date:'yyyy-MM-dd'}}"`). Note that `min` will also add native HTML5 + * constraint validation. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be + * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute + * (e.g. `max="{{maxDate | date:'yyyy-MM-dd'}}"`). Note that `max` will also add native HTML5 + * constraint validation. + * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string + * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. + * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string + * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + + +
    + + Required! + + Not a valid date! +
    + value = {{example.value | date: "yyyy-MM-dd"}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + var value = element(by.binding('example.value | date: "yyyy-MM-dd"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (see https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2013-10-22'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-01-01'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
    + */ + 'date': createDateInputType('date', DATE_REGEXP, + createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']), + 'yyyy-MM-dd'), + + /** + * @ngdoc input + * @name input[datetime-local] + * + * @description + * Input with datetime validation and transformation. In browsers that do not yet support + * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation + * inside this attribute (e.g. `min="{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`). + * Note that `min` will also add native HTML5 constraint validation. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation + * inside this attribute (e.g. `max="{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`). + * Note that `max` will also add native HTML5 constraint validation. + * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string + * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. + * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string + * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + + +
    + + Required! + + Not a valid date! +
    + value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + var value = element(by.binding('example.value | date: "yyyy-MM-ddTHH:mm:ss"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2010-12-28T14:57:00'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-01-01T23:59:00'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
    + */ + 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP, + createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']), + 'yyyy-MM-ddTHH:mm:ss.sss'), + + /** + * @ngdoc input + * @name input[time] + * + * @description + * Input with time validation and transformation. In browsers that do not yet support + * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a + * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this + * attribute (e.g. `min="{{minTime | date:'HH:mm:ss'}}"`). Note that `min` will also add + * native HTML5 constraint validation. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this + * attribute (e.g. `max="{{maxTime | date:'HH:mm:ss'}}"`). Note that `max` will also add + * native HTML5 constraint validation. + * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the + * `ngMin` expression evaluates to. Note that it does not set the `min` attribute. + * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the + * `ngMax` expression evaluates to. Note that it does not set the `max` attribute. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + + +
    + + Required! + + Not a valid date! +
    + value = {{example.value | date: "HH:mm:ss"}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + var value = element(by.binding('example.value | date: "HH:mm:ss"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('14:57:00'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('23:59:00'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
    + */ + 'time': createDateInputType('time', TIME_REGEXP, + createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']), + 'HH:mm:ss.sss'), + + /** + * @ngdoc input + * @name input[week] + * + * @description + * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support + * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * week format (yyyy-W##), for example: `2013-W02`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this + * attribute (e.g. `min="{{minWeek | date:'yyyy-Www'}}"`). Note that `min` will also add + * native HTML5 constraint validation. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this + * attribute (e.g. `max="{{maxWeek | date:'yyyy-Www'}}"`). Note that `max` will also add + * native HTML5 constraint validation. + * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string + * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. + * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string + * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + +
    + + Required! + + Not a valid date! +
    + value = {{example.value | date: "yyyy-Www"}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + var value = element(by.binding('example.value | date: "yyyy-Www"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2013-W01'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-W01'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
    + */ + 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'), + + /** + * @ngdoc input + * @name input[month] + * + * @description + * Input with month validation and transformation. In browsers that do not yet support + * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * month format (yyyy-MM), for example: `2009-01`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * If the model is not set to the first of the month, the next view to model update will set it + * to the first of the month. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this + * attribute (e.g. `min="{{minMonth | date:'yyyy-MM'}}"`). Note that `min` will also add + * native HTML5 constraint validation. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this + * attribute (e.g. `max="{{maxMonth | date:'yyyy-MM'}}"`). Note that `max` will also add + * native HTML5 constraint validation. + * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string + * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. + * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string + * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. + + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + + +
    + + Required! + + Not a valid month! +
    + value = {{example.value | date: "yyyy-MM"}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + var value = element(by.binding('example.value | date: "yyyy-MM"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2013-10'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-01'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
    + */ + 'month': createDateInputType('month', MONTH_REGEXP, + createDateParser(MONTH_REGEXP, ['yyyy', 'MM']), + 'yyyy-MM'), + + /** + * @ngdoc input + * @name input[number] + * + * @description + * Text input with number validation and transformation. Sets the `number` validation + * error if not a valid number. + * + *
    + * The model must always be of type `number` otherwise Angular will throw an error. + * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt} + * error docs for more information and an example of how to convert your model if necessary. + *
    + * + * ## Issues with HTML5 constraint validation + * + * In browsers that follow the + * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29), + * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}. + * If a non-number is entered in the input, the browser will report the value as an empty string, + * which means the view / model values in `ngModel` and subsequently the scope value + * will also be an empty string. + * + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object, then this is used directly. + * If the expression evaluates to a string, then it will be converted to a RegExp + * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to + * `new RegExp('^abc$')`.
    + * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to + * start at the index of the last search's match, thus not taking the whole input value into + * account. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + +
    + + Required! + + Not valid number! +
    + value = {{example.value}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + var value = element(by.binding('example.value')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + it('should initialize to model', function() { + expect(value.getText()).toContain('12'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if over max', function() { + input.clear(); + input.sendKeys('123'); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('false'); + }); + +
    + */ + 'number': numberInputType, + + + /** + * @ngdoc input + * @name input[url] + * + * @description + * Text input with URL validation. Sets the `url` validation error key if the content is not a + * valid URL. + * + *
    + * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex + * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify + * the built-in validators (see the {@link guide/forms Forms guide}) + *
    + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object, then this is used directly. + * If the expression evaluates to a string, then it will be converted to a RegExp + * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to + * `new RegExp('^abc$')`.
    + * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to + * start at the index of the last search's match, thus not taking the whole input value into + * account. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    +
    + + var text = element(by.binding('url.text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('url.text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('http://google.com'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if not url', function() { + input.clear(); + input.sendKeys('box'); + + expect(valid.getText()).toContain('false'); + }); + +
    + */ + 'url': urlInputType, + + + /** + * @ngdoc input + * @name input[email] + * + * @description + * Text input with email validation. Sets the `email` validation error key if not a valid email + * address. + * + *
    + * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex + * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can + * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide}) + *
    + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object, then this is used directly. + * If the expression evaluates to a string, then it will be converted to a RegExp + * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to + * `new RegExp('^abc$')`.
    + * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to + * start at the index of the last search's match, thus not taking the whole input value into + * account. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + +
    + + Required! + + Not valid email! +
    + text = {{email.text}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    + myForm.$error.email = {{!!myForm.$error.email}}
    +
    +
    + + var text = element(by.binding('email.text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('email.text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('me@example.com'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if not email', function() { + input.clear(); + input.sendKeys('xxx'); + + expect(valid.getText()).toContain('false'); + }); + +
    + */ + 'email': emailInputType, + + + /** + * @ngdoc input + * @name input[radio] + * + * @description + * HTML radio button. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string} value The value to which the `ngModel` expression should be set when selected. + * Note that `value` only supports `string` values, i.e. the scope model needs to be a string, + * too. Use `ngValue` if you need complex models (`number`, `object`, ...). + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {string} ngValue Angular expression to which `ngModel` will be be set when the radio + * is selected. Should be used instead of the `value` attribute if you need + * a non-string `ngModel` (`boolean`, `array`, ...). + * + * @example + + + +
    +
    +
    +
    + color = {{color.name | json}}
    +
    + Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`. +
    + + it('should change state', function() { + var color = element(by.binding('color.name')); + + expect(color.getText()).toContain('blue'); + + element.all(by.model('color.name')).get(0).click(); + + expect(color.getText()).toContain('red'); + }); + +
    + */ + 'radio': radioInputType, + + + /** + * @ngdoc input + * @name input[checkbox] + * + * @description + * HTML checkbox. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {expression=} ngTrueValue The value to which the expression should be set when selected. + * @param {expression=} ngFalseValue The value to which the expression should be set when not selected. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    +
    +
    + value1 = {{checkboxModel.value1}}
    + value2 = {{checkboxModel.value2}}
    +
    +
    + + it('should change state', function() { + var value1 = element(by.binding('checkboxModel.value1')); + var value2 = element(by.binding('checkboxModel.value2')); + + expect(value1.getText()).toContain('true'); + expect(value2.getText()).toContain('YES'); + + element(by.model('checkboxModel.value1')).click(); + element(by.model('checkboxModel.value2')).click(); + + expect(value1.getText()).toContain('false'); + expect(value2.getText()).toContain('NO'); + }); + +
    + */ + 'checkbox': checkboxInputType, + + 'hidden': noop, + 'button': noop, + 'submit': noop, + 'reset': noop, + 'file': noop + }; + + function stringBasedInputType(ctrl) { + ctrl.$formatters.push(function(value) { + return ctrl.$isEmpty(value) ? value : value.toString(); + }); + } + + function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + stringBasedInputType(ctrl); + } + + function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { + var type = lowercase(element[0].type); + + // In composition mode, users are still inputing intermediate text buffer, + // hold the listener until composition is done. + // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent + if (!$sniffer.android) { + var composing = false; + + element.on('compositionstart', function(data) { + composing = true; + }); + + element.on('compositionend', function() { + composing = false; + listener(); + }); + } + + var listener = function(ev) { + if (timeout) { + $browser.defer.cancel(timeout); + timeout = null; + } + if (composing) return; + var value = element.val(), + event = ev && ev.type; + + // By default we will trim the value + // If the attribute ng-trim exists we will avoid trimming + // If input type is 'password', the value is never trimmed + if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) { + value = trim(value); + } + + // If a control is suffering from bad input (due to native validators), browsers discard its + // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the + // control's value is the same empty value twice in a row. + if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) { + ctrl.$setViewValue(value, event); + } + }; + + // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the + // input event on backspace, delete or cut + if ($sniffer.hasEvent('input')) { + element.on('input', listener); + } else { + var timeout; + + var deferListener = function(ev, input, origValue) { + if (!timeout) { + timeout = $browser.defer(function() { + timeout = null; + if (!input || input.value !== origValue) { + listener(ev); + } + }); + } + }; + + element.on('keydown', function(event) { + var key = event.keyCode; + + // ignore + // command modifiers arrows + if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return; + + deferListener(event, this, this.value); + }); + + // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it + if ($sniffer.hasEvent('paste')) { + element.on('paste cut', deferListener); + } + } + + // if user paste into input using mouse on older browser + // or form autocomplete on newer browser, we need "change" event to catch it + element.on('change', listener); + + ctrl.$render = function() { + // Workaround for Firefox validation #12102. + var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue; + if (element.val() !== value) { + element.val(value); + } + }; + } + + function weekParser(isoWeek, existingDate) { + if (isDate(isoWeek)) { + return isoWeek; + } + + if (isString(isoWeek)) { + WEEK_REGEXP.lastIndex = 0; + var parts = WEEK_REGEXP.exec(isoWeek); + if (parts) { + var year = +parts[1], + week = +parts[2], + hours = 0, + minutes = 0, + seconds = 0, + milliseconds = 0, + firstThurs = getFirstThursdayOfYear(year), + addDays = (week - 1) * 7; + + if (existingDate) { + hours = existingDate.getHours(); + minutes = existingDate.getMinutes(); + seconds = existingDate.getSeconds(); + milliseconds = existingDate.getMilliseconds(); + } + + return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); + } + } + + return NaN; + } + + function createDateParser(regexp, mapping) { + return function(iso, date) { + var parts, map; + + if (isDate(iso)) { + return iso; + } + + if (isString(iso)) { + // When a date is JSON'ified to wraps itself inside of an extra + // set of double quotes. This makes the date parsing code unable + // to match the date string and parse it as a date. + if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') { + iso = iso.substring(1, iso.length - 1); + } + if (ISO_DATE_REGEXP.test(iso)) { + return new Date(iso); + } + regexp.lastIndex = 0; + parts = regexp.exec(iso); + + if (parts) { + parts.shift(); + if (date) { + map = { + yyyy: date.getFullYear(), + MM: date.getMonth() + 1, + dd: date.getDate(), + HH: date.getHours(), + mm: date.getMinutes(), + ss: date.getSeconds(), + sss: date.getMilliseconds() / 1000 + }; + } else { + map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 }; + } + + forEach(parts, function(part, index) { + if (index < mapping.length) { + map[mapping[index]] = +part; + } + }); + return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0); + } + } + + return NaN; + }; + } + + function createDateInputType(type, regexp, parseDate, format) { + return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) { + badInputChecker(scope, element, attr, ctrl); + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + var timezone = ctrl && ctrl.$options && ctrl.$options.timezone; + var previousDate; + + ctrl.$$parserName = type; + ctrl.$parsers.push(function(value) { + if (ctrl.$isEmpty(value)) return null; + if (regexp.test(value)) { + // Note: We cannot read ctrl.$modelValue, as there might be a different + // parser/formatter in the processing chain so that the model + // contains some different data format! + var parsedDate = parseDate(value, previousDate); + if (timezone) { + parsedDate = convertTimezoneToLocal(parsedDate, timezone); + } + return parsedDate; + } + return undefined; + }); + + ctrl.$formatters.push(function(value) { + if (value && !isDate(value)) { + throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); + } + if (isValidDate(value)) { + previousDate = value; + if (previousDate && timezone) { + previousDate = convertTimezoneToLocal(previousDate, timezone, true); + } + return $filter('date')(value, format, timezone); + } else { + previousDate = null; + return ''; + } + }); + + if (isDefined(attr.min) || attr.ngMin) { + var minVal; + ctrl.$validators.min = function(value) { + return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal; + }; + attr.$observe('min', function(val) { + minVal = parseObservedDateValue(val); + ctrl.$validate(); + }); + } + + if (isDefined(attr.max) || attr.ngMax) { + var maxVal; + ctrl.$validators.max = function(value) { + return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal; + }; + attr.$observe('max', function(val) { + maxVal = parseObservedDateValue(val); + ctrl.$validate(); + }); + } + + function isValidDate(value) { + // Invalid Date: getTime() returns NaN + return value && !(value.getTime && value.getTime() !== value.getTime()); + } + + function parseObservedDateValue(val) { + return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val; + } + }; + } + + function badInputChecker(scope, element, attr, ctrl) { + var node = element[0]; + var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity); + if (nativeValidation) { + ctrl.$parsers.push(function(value) { + var validity = element.prop(VALIDITY_STATE_PROPERTY) || {}; + // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430): + // - also sets validity.badInput (should only be validity.typeMismatch). + // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email) + // - can ignore this case as we can still read out the erroneous email... + return validity.badInput && !validity.typeMismatch ? undefined : value; + }); + } + } + + function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { + badInputChecker(scope, element, attr, ctrl); + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + + ctrl.$$parserName = 'number'; + ctrl.$parsers.push(function(value) { + if (ctrl.$isEmpty(value)) return null; + if (NUMBER_REGEXP.test(value)) return parseFloat(value); + return undefined; + }); + + ctrl.$formatters.push(function(value) { + if (!ctrl.$isEmpty(value)) { + if (!isNumber(value)) { + throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); + } + value = value.toString(); + } + return value; + }); + + if (isDefined(attr.min) || attr.ngMin) { + var minVal; + ctrl.$validators.min = function(value) { + return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal; + }; + + attr.$observe('min', function(val) { + if (isDefined(val) && !isNumber(val)) { + val = parseFloat(val, 10); + } + minVal = isNumber(val) && !isNaN(val) ? val : undefined; + // TODO(matsko): implement validateLater to reduce number of validations + ctrl.$validate(); + }); + } + + if (isDefined(attr.max) || attr.ngMax) { + var maxVal; + ctrl.$validators.max = function(value) { + return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal; + }; + + attr.$observe('max', function(val) { + if (isDefined(val) && !isNumber(val)) { + val = parseFloat(val, 10); + } + maxVal = isNumber(val) && !isNaN(val) ? val : undefined; + // TODO(matsko): implement validateLater to reduce number of validations + ctrl.$validate(); + }); + } + } + + function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { + // Note: no badInputChecker here by purpose as `url` is only a validation + // in browsers, i.e. we can always read out input.value even if it is not valid! + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + stringBasedInputType(ctrl); + + ctrl.$$parserName = 'url'; + ctrl.$validators.url = function(modelValue, viewValue) { + var value = modelValue || viewValue; + return ctrl.$isEmpty(value) || URL_REGEXP.test(value); + }; + } + + function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { + // Note: no badInputChecker here by purpose as `url` is only a validation + // in browsers, i.e. we can always read out input.value even if it is not valid! + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + stringBasedInputType(ctrl); + + ctrl.$$parserName = 'email'; + ctrl.$validators.email = function(modelValue, viewValue) { + var value = modelValue || viewValue; + return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value); + }; + } + + function radioInputType(scope, element, attr, ctrl) { + // make the name unique, if not defined + if (isUndefined(attr.name)) { + element.attr('name', nextUid()); + } + + var listener = function(ev) { + if (element[0].checked) { + ctrl.$setViewValue(attr.value, ev && ev.type); + } + }; + + element.on('click', listener); + + ctrl.$render = function() { + var value = attr.value; + element[0].checked = (value == ctrl.$viewValue); + }; + + attr.$observe('value', ctrl.$render); + } + + function parseConstantExpr($parse, context, name, expression, fallback) { + var parseFn; + if (isDefined(expression)) { + parseFn = $parse(expression); + if (!parseFn.constant) { + throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' + + '`{1}`.', name, expression); + } + return parseFn(context); + } + return fallback; + } + + function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) { + var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true); + var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false); + + var listener = function(ev) { + ctrl.$setViewValue(element[0].checked, ev && ev.type); + }; + + element.on('click', listener); + + ctrl.$render = function() { + element[0].checked = ctrl.$viewValue; + }; + + // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false` + // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert + // it to a boolean. + ctrl.$isEmpty = function(value) { + return value === false; + }; + + ctrl.$formatters.push(function(value) { + return equals(value, trueValue); + }); + + ctrl.$parsers.push(function(value) { + return value ? trueValue : falseValue; + }); + } + + + /** + * @ngdoc directive + * @name textarea + * @restrict E + * + * @description + * HTML textarea element control with angular data-binding. The data-binding and validation + * properties of this element are exactly the same as those of the + * {@link ng.directive:input input element}. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any + * length. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object, then this is used directly. + * If the expression evaluates to a string, then it will be converted to a RegExp + * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to + * `new RegExp('^abc$')`.
    + * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to + * start at the index of the last search's match, thus not taking the whole input value into + * account. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + */ + + + /** + * @ngdoc directive + * @name input + * @restrict E + * + * @description + * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding, + * input state control, and validation. + * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers. + * + *
    + * **Note:** Not every feature offered is available for all input types. + * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`. + *
    + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {boolean=} ngRequired Sets `required` attribute if set to true + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any + * length. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object, then this is used directly. + * If the expression evaluates to a string, then it will be converted to a RegExp + * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to + * `new RegExp('^abc$')`.
    + * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to + * start at the index of the last search's match, thus not taking the whole input value into + * account. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + * This parameter is ignored for input[type=password] controls, which will never trim the + * input. + * + * @example + + + +
    +
    + +
    + + Required! +
    + +
    + + Too short! + + Too long! +
    +
    +
    + user = {{user}}
    + myForm.userName.$valid = {{myForm.userName.$valid}}
    + myForm.userName.$error = {{myForm.userName.$error}}
    + myForm.lastName.$valid = {{myForm.lastName.$valid}}
    + myForm.lastName.$error = {{myForm.lastName.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    + myForm.$error.minlength = {{!!myForm.$error.minlength}}
    + myForm.$error.maxlength = {{!!myForm.$error.maxlength}}
    +
    +
    + + var user = element(by.exactBinding('user')); + var userNameValid = element(by.binding('myForm.userName.$valid')); + var lastNameValid = element(by.binding('myForm.lastName.$valid')); + var lastNameError = element(by.binding('myForm.lastName.$error')); + var formValid = element(by.binding('myForm.$valid')); + var userNameInput = element(by.model('user.name')); + var userLastInput = element(by.model('user.last')); + + it('should initialize to model', function() { + expect(user.getText()).toContain('{"name":"guest","last":"visitor"}'); + expect(userNameValid.getText()).toContain('true'); + expect(formValid.getText()).toContain('true'); + }); + + it('should be invalid if empty when required', function() { + userNameInput.clear(); + userNameInput.sendKeys(''); + + expect(user.getText()).toContain('{"last":"visitor"}'); + expect(userNameValid.getText()).toContain('false'); + expect(formValid.getText()).toContain('false'); + }); + + it('should be valid if empty when min length is set', function() { + userLastInput.clear(); + userLastInput.sendKeys(''); + + expect(user.getText()).toContain('{"name":"guest","last":""}'); + expect(lastNameValid.getText()).toContain('true'); + expect(formValid.getText()).toContain('true'); + }); + + it('should be invalid if less than required min length', function() { + userLastInput.clear(); + userLastInput.sendKeys('xx'); + + expect(user.getText()).toContain('{"name":"guest"}'); + expect(lastNameValid.getText()).toContain('false'); + expect(lastNameError.getText()).toContain('minlength'); + expect(formValid.getText()).toContain('false'); + }); + + it('should be invalid if longer than max length', function() { + userLastInput.clear(); + userLastInput.sendKeys('some ridiculously long name'); + + expect(user.getText()).toContain('{"name":"guest"}'); + expect(lastNameValid.getText()).toContain('false'); + expect(lastNameError.getText()).toContain('maxlength'); + expect(formValid.getText()).toContain('false'); + }); + +
    + */ + var inputDirective = ['$browser', '$sniffer', '$filter', '$parse', + function($browser, $sniffer, $filter, $parse) { + return { + restrict: 'E', + require: ['?ngModel'], + link: { + pre: function(scope, element, attr, ctrls) { + if (ctrls[0]) { + (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer, + $browser, $filter, $parse); + } + } + } + }; + }]; + + + + var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; + /** + * @ngdoc directive + * @name ngValue + * + * @description + * Binds the given expression to the value of `